6.3.5 · D3Interpretability & Explainability

Worked examples — Probing classifiers

3,397 words15 min readBack to topic

This is the drill page for Probing classifiers. The parent note told you what a probe is: a tiny classifier (like logistic regression) trained on frozen activations to predict some property . Here we run that machine through every kind of situation you will ever face — clean cases, edge cases, and the traps that fool people.

Before we start, let me re-earn every symbol so line one makes sense on its own:


The scenario matrix

Every probing situation is one of these cells. The worked examples below each carry a tag like [Cell A1] so you can see we left no gap. Cells are numbered inside each letter group in increasing difficulty, so the drill reads top-to-bottom.

Cell Situation What makes it tricky
A1 Clean linear separation, positive margin () The easy baseline — probe wins big
A2 Separable but zero margin () Points sit on the boundary — knife-edge case
A3 Info present but only nonlinearly Linear probe fails, feature map succeeds
B1 Zero / degenerate input: property absent Accuracy collapses to the majority-class baseline
B2 Degenerate: representation is constant ( same for all) Probe can't separate anything — chance level
C1 Limiting behaviour across layers (early → deep) Accuracy curve rises then may fall
C2 Limiting: selectivity (control task) near zero High accuracy but the probe memorised — a false positive
D1 Sign / direction flip in Same boundary, mirrored labels — must handle both signs
E1 Real-world word problem Full study from raw numbers
F1 Exam-style twist Probe beats the model itself — what does it mean?

We now hit each cell.


Worked examples

Example 1 — the clean baseline [Cell A1, D1]

Forecast: Guess — will the boundary sit near ? Positive or negative margin?

Figure s01 plots the four points on a single horizontal number line (the 1-D representation axis ). The two red dots at and are the (singular) class; the two blue dots at and are the (plural) class. The vertical yellow line at is the learned boundary . The green arrow marks the gap of size from the boundary to the nearest point — that gap is the margin .

Figure — Probing classifiers

Steps.

  1. Pick the boundary. The two negatives sit at , the two positives at . A boundary at splits them. Set so the score is . Why this step? The decision rule is "predict when ". We just need any hyperplane (here a single point on the line) that puts each label on its correct side. Since the boundary sits exactly at the origin.

  2. Check each point's signed score . This product is positive exactly when the prediction is correct (right sign matches label). Why this step? All four are ⇒ every point is on the correct side ⇒ linearly separable.

  3. Compute the margin . Here , and the smallest numerator is . Why this step? The margin is the distance from the boundary to the nearest point. confirms a robust, easy linear encoding — the hallmark of a good probe result.

  4. Sign flip (Cell D1). If we instead learned , the score flips sign and every point is now misclassified. Flipping the labels' meaning (call "singular") restores correctness. Moral: the probe direction and the label convention must agree; the geometry (the boundary at ) is identical. Why this step? It shows both signs are legal descriptions of the same separating plane — you must fix a convention.

Verify: With all 4 points classify correctly ⇒ accuracy . Margin . ✔


Example 2 — separable but zero margin [Cell A2]

Forecast: If a point sits on the line, is its signed score positive, negative, or zero?

Steps.

  1. Place the boundary on a point. Choose , so the boundary is at — right on top of the point at . Why this step? We are deliberately constructing the degenerate case the margin definition must handle: a data point lying on the decision surface.

  2. Signed score of the on-boundary point. . Why this step? The point contributes a numerator of , so the minimum over all points is : .

  3. What means. The data is still separable in the weak sense (no point is on the wrong side), but there is no cushion. Any tiny wiggle in flips this point's prediction — the probe is fragile. A logistic-loss probe would keep growing to push this point off the line, which is exactly why we add L2 regularization. Why this step? It closes the gap in the margin story: (robust, Ex 1), (knife-edge, here), (misclassified, impossible for separable data).

Verify: , and the minimum signed score over the four points is , not positive. ✔


Example 3 — present but nonlinear [Cell A3]

Forecast: A single threshold on a line — can it fence off the middle from the outsides?

Figure s02 shows the same 1-D axis. Blue dots at and are the agent class (sitting on the two outer flanks); red dots stacked at are the patient class (trapped in the middle). Two dashed yellow lines show that any single linear cut leaves agents on both sides — no cut isolates the red middle. The caption reminds us we then square the axis to fix this.

Figure — Probing classifiers

Steps.

  1. Try linear. A linear rule is "predict agent when ". Whatever line we draw, it cuts the axis into two rays. But agents live on both outer rays and patients in the middle — no single cut isolates the middle. Why this step? This is the XOR-shaped trap: linearly inseparable even though the classes are perfectly distinct.

  2. Best a linear probe can do — counted exactly on the 6 samples. Any threshold leaves at least one class straddling it. Take the boundary at : it labels (agent) as one side and everything (the three patients at and the agent at ) as the other. The best labelling then gets the 3 patients + 1 agent correct on the majority side and the 1 agent at correct → but the agent is forced to share the patient label. Counting the 6 points, the maximum correct is , giving . Why this step? With the dataset now pinned down (6 balanced samples), the figure is exact, not hand-wavy.

  3. Add an explicit nonlinear feature map. Apply the feature map first, then probe linearly on . Now agents map to , patients to . A boundary at separates them perfectly. Why this step? A linear probe reading the hand-crafted feature nails it. In practice you don't get to choose ; you hope the network's deeper layers already contain such a coordinate. Caveat on MLPs: a ReLU MLP does not reproduce exactly — ReLU is piecewise-linear, so it can only build a piecewise-linear approximation of a parabola (more hidden units = finer approximation). The point stands: nonlinear probes succeed where linear ones fail. A big MLP-vs-linear gap = "info is here but entangled" — see Disentangled Representations.

Verify: After squaring, agents , patients ⇒ all 6 correct, accuracy . Linear best . ✔


Example 4 — property absent, majority baseline [Cell B1]

Forecast: Zero? 50%? Something set by the label proportions?

Steps.

  1. What "absent" means. Random activations carry no reliable signal about POS. The best any classifier can do is ignore and always guess the most common label. Why this step? Establishes the floor — a probe can never do worse than the majority class on average.

  2. Compute the majority baseline. Always predict "noun": correct on 70% of samples. Why this step? sounds impressive but is worthless here — it's pure class imbalance, not encoded information.

  3. The lesson. Never report raw accuracy alone. Report accuracy above baseline: . Zero gain ⇒ no information about . Why this step? Guards against the classic "high number = model understands" fallacy from the parent's Mistake 1.

Verify: ; gain over baseline . ✔


Example 5 — constant representation, chance level [Cell B2]

Forecast: If every input looks identical, can any classifier tell them apart?

Steps.

  1. Score is constant. — the same number for all inputs. Why this step? A single fixed score means every input gets the same predicted label.

  2. Best strategy. Predict whichever label is more common. On a 50/50 split that's just . Why this step? Confirms the theoretical chance floor for a balanced binary task.

Verify: Balanced binary majority baseline . ✔ Mutual information because is constant. ✔


Example 6 — layer-wise limiting curve [Cell C1]

Forecast: Monotone up? Or rise-then-dip?

Figure s03 is a line plot: the horizontal axis is the layer index , the vertical axis is POS probe accuracy . The blue curve rises steeply from at layer 0 to a yellow-highlighted peak of at layer 6 (circled in green), then dips slightly to at layer 12. A dashed red line marks the multi-class uniform-chance baseline far below, showing all layers crush chance.

Figure — Probing classifiers

Steps.

  1. Read the trend. From layer 0 to 6 accuracy climbs (); from 6 to 12 it dips (). Why this step? Establishes the classic rise-then-fall signature: middle layers hold the most explicit syntax.

  2. Find the argmax. The peak is at with . Why this step? pinpoints where the property is most linearly accessible — the actionable output of a probing study.

  3. Get the baseline right — this is multi-class. POS is not binary. With tags, uniform random guessing gives , not . (If you always guessed the single most common tag, say nouns at , the majority baseline would be — still far below .) Either way, all layers are vastly above chance. Why this step? Using as the baseline for a 17-way task would badly understate how impressive is — the baseline must be (uniform) or the majority-class rate.

  4. Explain the fall. Output layers specialise toward the pre-training objective (masked-token prediction), partially discarding task-irrelevant syntax — an attention-driven re-focus. Why this step? Interprets the limit : deeper isn't always more informative.

Verify: at index 6; slope 0→6 positive, 6→12 negative; uniform chance . ✔


Example 7 — control task / selectivity [Cell C2]

Forecast: Is trustworthy? What does an on random labels imply?

Steps.

  1. Define selectivity. . It subtracts off how much the probe can fit nonsense — its raw memorisation power. Why this step? A probe that scores high on shuffled labels is just memorising word identities, not reading real structure out of ; that memorisation inflates the real score, so we must subtract it away.

  2. Compute. Why this step? Only points of the come from genuine structure in ; the rest is probe capacity — a near-false-positive result.

  3. Judge and fix. Selectivity of is low: the probe is too expressive and mostly memorising. Shrink the probe (stronger L2, fewer hidden units) until falls near the majority/uniform baseline, then re-measure . Only a high selectivity lets you trust the claim "layer encodes ". Pair with Causal Intervention Methods to confirm the info is actually used, not just present. Why this step? Selectivity turns the question "is it there?" into the stronger "is it there and not just memorised?" — the safeguard against the parent note's Mistake 1.

Verify: . ✔


Example 8 — real-world word problem [Cell E1]

Forecast: With 2000 balanced samples over two classes, what's the chance baseline? Is 1740 good?

Steps.

  1. Accuracy. . Why this step? Raw score — but by itself meaningless (Cell B1 warning).

  2. Baseline. Balanced binary ⇒ chance . Gain over baseline . Why this step? Confirms real lift above guessing (this task is binary, so is the correct baseline — contrast Example 6's multi-class case).

  3. Selectivity. ; . Why this step? Control sits at chance ⇒ almost all the lift is genuine structure. Verdict: negation is linearly encoded at layer 9, and it's not memorisation.

Verify: ; ; gain ; selectivity . ✔


Example 9 — exam twist: probe beats the model [Cell F1]

Forecast: Can the model "know" something it fails to use?

Steps.

  1. Separate presence from usage. Probing measures presence in ( = strongly encoded). Output accuracy measures usage in the final decision (). Why this step? These are different quantities; is not a contradiction.

  2. Interpret the gap. The gap points means the information exists but the model's later layers / decoding fail to exploit it — a wiring problem, not a knowledge problem. Why this step? Points the fix downstream (decoding, fine-tuning the head), not at pre-training.

  3. Caution. Confirm with a causal test — patch the gender direction and see if outputs change (Causal Intervention Methods). A probe alone can't prove the model would use it. Also relevant to Adversarial Robustness: encoded-but-unused features can be adversarially flipped. Why this step? Closes the presence-vs-usage loop rigorously.

Verify: Gap ; presence usage, no contradiction. ✔


Recall Self-check

A probe hits 0.70 on a 70/30 imbalanced task — is the property encoded? ::: No — that equals the majority baseline; gain over baseline is 0. Linear probe 0.667, feature-map probe 1.0 on the same 6-point set — what does the gap mean? ::: Info is present but nonlinearly entangled (Cell A3). Real accuracy 0.94, control accuracy 0.85 — trust it? ::: Weakly — selectivity is only 0.09, the probe is partly memorising (Cell C2). A point lies exactly on the boundary — what is its signed score and the margin? ::: Signed score 0, so margin γ=0 (Cell A2, knife-edge). For a 17-tag POS probe, what is the uniform-chance baseline? ::: 1/17 ≈ 0.059, not 0.50 — it's multi-class. Probe 0.92 but model output 0.65 — contradiction? ::: No — presence ≠ usage (Cell F1).