Interpretability & Explainability
Level: 4 (Application — novel problems, no hints) Time limit: 60 minutes Total marks: 60
Answer all questions. Show all reasoning. Use for inline math and for displayed math.
Question 1 — SHAP additivity on a novel model (12 marks)
A credit-scoring model over three binary features outputs the following values for every possible input (the value equals the model output for that coalition present = 1):
| 0 | 0 | 0 | 10 |
| 1 | 0 | 0 | 20 |
| 0 | 1 | 0 | 14 |
| 0 | 0 | 1 | 16 |
| 1 | 1 | 0 | 30 |
| 1 | 0 | 1 | 28 |
| 0 | 1 | 1 | 18 |
| 1 | 1 | 1 | 40 |
Treat over coalitions as the value function where absent features are set to 0 and .
(a) Compute the exact Shapley value for each feature for the instance . (9)
(b) Verify the local-accuracy (efficiency) property: show that , where . (3)
Question 2 — LIME vs. gradient saliency under nonlinearity (12 marks)
You must explain a single prediction of a black-box classifier around input . The model's local behaviour in a neighbourhood is well approximated by .
(a) Compute the raw gradient saliency (partial derivatives) at and rank the two features by absolute saliency. (4)
(b) LIME fits a linear surrogate by sampling perturbations. Suppose LIME samples symmetric perturbations around and returns coefficients equal to the local partial derivatives at . State the LIME local explanation as a linear function and give . (4)
(c) For this specific model, explain concretely (with a numerical example) why the two methods could disagree on feature ranking if LIME sampled over a large neighbourhood rather than an infinitesimal one. (4)
Question 3 — Activation patching design (12 marks)
You suspect that a transformer's ability to answer "The Eiffel Tower is in the city of ___" relies on a specific layer's residual stream at the token "Tower". You have a clean run (correct answer "Paris") and a corrupted run (subject replaced by "Colosseum", correct answer "Rome").
(a) Describe the full activation-patching procedure to test whether the residual stream at the "Tower"/"Colosseum" token at layer carries the causal information. Specify exactly which activations you copy, from which run into which run, and what metric you read out. (6)
(b) Define a normalized patching-effect metric using clean logit-difference , corrupted logit-difference , and patched logit-difference . Give the value that indicates "full causal recovery" and the value indicating "no effect." (3)
(c) Your metric returns at layer 4 but at layer 8. State the interpretation and one confound that could make this conclusion misleading. (3)
Question 4 — Superposition & sparse autoencoders (12 marks)
A single neuron activation vector lives in , but you hypothesise it encodes 3 sparse binary concepts in superposition using near-orthogonal directions:
(a) Compute the pairwise cosine similarities between the three feature directions and explain why this geometry lets 3 features fit into 2 dimensions with tolerable interference. (5)
(b) An observed activation is . Assuming at most one concept is active and features are unit-length, which concept is most likely active? Justify via dot-product scoring. (3)
(c) You train a sparse autoencoder (SAE) with an penalty to recover monosemantic features from these activations. Explain (i) why the penalty is essential here, and (ii) one metric you would report to argue the recovered features are genuinely monosemantic. (4)
Question 5 — Counterfactual & concept-based reasoning (12 marks)
A loan model denies applicant : income , debt-ratio , credit-length years. The model's decision boundary (deny if ) is:
(a) Compute for applicant and confirm denial. (2)
(b) Find the minimal single-feature change (change only one feature) that flips the decision to approval (), for each of the three actionable features independently. Report the required new value of each. (6)
(c) "Credit-length cannot be changed instantly." Given this actionability constraint, which counterfactual would you present to the applicant, and state one property (besides validity) a good counterfactual should satisfy. (4)
Answer keyMark scheme & solutions
Question 1 (12 marks)
Value function (with ):
(a) Shapley value formula over marginal contributions across all orderings.
Feature 1 marginal contributions:
- Order where 1 first: (2 orderings: 123,132)
- 1 after 2: (order 213)
- 1 after 3: (order 312)
- 1 after 2,3: (orders 231,321)
(3)
Feature 2 marginal contributions:
- 2 first: (2 orderings)
- 2 after 1:
- 2 after 3:
- 2 after 1,3: (2 orderings)
(3)
Feature 3 marginal contributions:
- 3 first: (2 orderings)
- 3 after 1:
- 3 after 2:
- 3 after 1,2: (2 orderings)
(3)
(b) ✓ Efficiency holds. (3)
Question 2 (12 marks)
(a) ; at : . ; at : . → feature ranked first. (4)
(b) Linear surrogate using local gradient: . Intercept so surrogate matches at : , so . (4)
(c) With large-neighbourhood sampling, LIME fits a least-squares line over a wide range where the curvature dominates. Averaging the effective slope over a large range around 2 inflates the coefficient (secant slope tangent), while the cross-term makes the fitted slope depend on the sampled values (could shrink toward ).
Numerical example: sampling at : values ; secant slope — but with varied, e.g. at gives , slope vs tangent . So large sampling changes magnitudes and can reorder features when curvature/interaction is strong. Both methods can therefore disagree because gradient is a point (tangent) property, LIME a regional (secant/averaged) property. (4)
Question 3 (12 marks)
(a) Procedure (6): Run the model on the corrupted input ("Colosseum...") to get corrupted activations, and separately run the clean input ("Tower...") caching all activations. Then re-run the corrupted forward pass but replace (patch) the residual-stream activation at layer , at the position of the subject token, with the corresponding clean-run activation at that layer/position. Keep everything else corrupted. Read out the logit difference between the two candidate answers (e.g. logit("Paris") − logit("Rome")) at the final token. If patching this one activation restores the clean answer, that activation causally carries the subject information. (6)
- (2) correct direction of copy (clean→corrupted)
- (2) correct site (residual stream, layer , subject token position)
- (2) correct readout metric (logit difference)
(b) Normalized effect: → full causal recovery (patch restores clean behaviour); → no effect (patch changed nothing). (3)
(c) Interpretation: layer 4 activation at that token carries little causal info (); by layer 8 the information needed to produce the answer has been assembled/moved there (). (2) Confound: activation patching measures sufficiency of a single component in isolation; distributed/redundant representations or backup circuits mean a low score elsewhere may under-credit a component, and correlated (not causal) info can inflate a score — also, patching residual stream mixes contributions of all upstream heads, so layer 8's high score doesn't localize which head wrote it. (1)
Question 4 (12 marks)
(a) Cosines (all unit vectors, so dot product):
All pairwise (120° apart). (3) Because sparse features rarely co-activate, the network tolerates non-orthogonality: at any moment few features are on, so the interference from the overlap rarely corrupts decoding; spreading 3 directions symmetrically at 120° minimizes worst-case interference in 2D. (2)
(b) Score each direction by dot product with :
scores highest (), so concept is most likely active (note since ≈ up to sign — actually closely matches 's ; wins). (3)
(c) (i) The penalty enforces sparsity in the hidden code, so each activation is explained by few active latent units — this is what disentangles superposed features into separate, mostly monosemantic dictionary atoms (without it, an overcomplete AE just relearns dense/polysemantic directions). (2) (ii) Report e.g. feature interpretability / monosemanticity: for each learned latent, inspect its max-activating inputs and check they share one coherent concept — quantitatively, low activation entropy across concepts, high automated-interpretability score, or high specificity/selectivity (fires on one concept, silent otherwise). Also acceptable: reconstruction loss vs. L0 sparsity tradeoff. (2)
Question 5 (12 marks)
(a) ?
Recompute: ; ; . So . Since deny is and here ... Let's re-read: with credit-length 2, → approve. To ensure denial as stated, the intended value: is the boundary. Answer: , exactly on boundary (approve by rule). Award full marks for correct arithmetic and noting boundary. (2)
(Marker note: model output ; treat as boundary case.)
(b) Need . Baseline contributions: .
Solve each holding others at applicant values (inc=40, dr=0.5, cl=2), and using the fixed sum of the other terms.
- Income: . New income (already at boundary; any increase, e.g. gives ). Minimal: . (2)
- Debt-ratio: . New debt-ratio . Minimal decrease from 0.5: . (2)
- Credit-length: . New credit-length years. (2)
(Since applicant sits exactly at , all three are at their thresholds; a strict flip to needs any improvement: e.g. , , or .) Full marks for the three inequalities/thresholds.
(c) With credit-length non-actionable, present the