Invariance Probe¶
Specification-driven behavioral test — instantiates Shortcut-Reliance Mitigation
Feeds minimal pairs that change only the surface and, separately, only the substance — checking that predictions stay put when they should and move when they should.
A shortcut betrays itself as a mismatch between what should move a prediction and what actually does. Invariance Probe makes that mismatch measurable by turning the intended semantics into executable minimal-pair tests. For each thing that ought to be irrelevant, it produces near-identical inputs differing only in that surface feature and checks the prediction does not move; for each thing that ought to be decisive, it changes only the substance and checks the prediction does move. Its signature is this two-sided demand — invariance where the model should be blind and sensitivity where it should be sharp — which is why it catches both a classifier that over-reacts to an irrelevant token and one that shrugs at a genuine change of meaning. Unlike an ablation, it never removes information; it holds almost everything fixed and varies one controlled thing, reading the model's response against an explicit statement of what that thing is supposed to mean.
Example¶
A sentiment classifier for product reviews is probed against its intended semantics. On the invariance side, the probe swaps only an identity term or a place name — "the technician was great" → "the technician was great" with a different gender pronoun, or a different city — inputs whose sentiment is unchanged. In an illustrative run the prediction flips on ≈22% of these pairs, which means the model has tied sentiment to features that carry none. On the sensitivity side, it swaps only the evaluative word — "great" → "disappointing" — where the label must change; the model fails to flip on ≈9%, meaning it is sometimes ignoring the very words that carry the meaning. Neither result is visible in aggregate accuracy, and neither names a pixel or token weight; together they show the decision is resting partly on the wrong features and partly missing the right ones — a finding an accuracy score can never surface.
How it works¶
What distinguishes it is that every test case is a paired counterfactual derived from a specification of intended structure, and the check runs in both directions. Invariance cases hold meaning constant and vary a should-be-irrelevant feature; sensitivity cases hold surface constant and vary the meaning-bearing one. A prediction that drifts on the first, or fails to shift on the second, is a violation localized to a named semantic relationship — not a vague brittleness but "the model treats pronoun as sentiment" or "the model ignores negation." Run across the specified invariances, the probe returns a semantic-feature verdict: which intended relationships the model actually honors and which it violates.
Tuning parameters¶
- Invariance set — which features are declared irrelevant and which decisive. This is the specification itself; an unlisted invariance is simply never tested.
- Perturbation generator — templated swaps, rule-based edits, or model-generated counterfactuals. Richer generators cover more, but only if each pair stays minimal and label-preserving; a sloppy edit that changes meaning invalidates the test.
- Drift tolerance — how much prediction change on an invariance pair counts as a violation. Loose tolerance hides real over-sensitivity; zero tolerance flags harmless numerical noise.
- Directionality — invariance-only, or invariance plus required sensitivity. The two-sided form catches under-reaction that an invariance-only probe misses.
- Coverage per relationship — how many pairs test each declared invariance, trading confidence against cost.
When it helps, and when it misleads¶
Its strength is testing the model against an explicit statement of what should matter, which catches reliance that an ablation can miss and that aggregate metrics hide entirely — and, because it is two-sided, it flags both spurious sensitivity and missing sensitivity. It is metamorphic testing for a learner: no ground-truth label needed for the invariance cases, only the relationship that must hold between paired inputs.[^metamorphic]
It misleads when the specification is incomplete or the pairs are not truly minimal. An invariance nobody declared goes unchecked, so a clean probe certifies only the relationships you thought to state. And if a "surface-only" edit secretly alters meaning, a legitimate prediction change is misread as a violation. Passing also proves only that the model ignores the wrong features it was told to ignore — not that it uses the right ones for the right reason. The classic misuse is loosening the drift tolerance until the violations disappear. The discipline is to derive the invariance set from the intended-structure specification (and from what the Causal Feature Review Panel deems legitimate), verify each pair is genuinely minimal, and hold tolerance fixed across runs.
How it implements the components¶
Invariance Probe realizes the semantics side of the archetype — checking behavior against what the target is supposed to depend on:
intended_structure_specification— it operationalizes the intended structure as a concrete set of required invariances and sensitivities: an executable statement of what must and must not change the prediction.causal_or_semantic_feature_review— its two-sided verdict is the automated form of this review, judging whether the model's decisions track the semantic features rather than surface correlates.
It does not quantify how much the model leans on any one cue — that scalar is Feature Ablation or Occlusion Test's shortcut_reliance_score — it does not maintain a standing counter-correlated evaluation set (Counter-Correlated Holdout Set), and it repairs nothing (Hard-Negative Data Augmentation).
Related¶
- Instantiates: Shortcut-Reliance Mitigation — supplies the specification-driven semantic check the appraisal reasons over.
- Consumes: Causal Feature Review Panel — its judgment of which features are semantically legitimate defines the invariances this probe encodes.
- Sibling mechanisms: Feature Ablation or Occlusion Test · Domain-Shift Stress Test · Counter-Correlated Holdout Set · Causal Feature Review Panel · Hard-Negative Data Augmentation