Level 4 — ApplicationInterpretability & Explainability

Interpretability & Explainability

60 minutes60 marksprintable — key stays hidden on paper

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 ff over three binary features {x1,x2,x3}\{x_1, x_2, x_3\} outputs the following values for every possible input (the value equals the model output for that coalition present = 1):

x1x_1 x2x_2 x3x_3 ff
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 ff over coalitions as the value function v(S)v(S) where absent features are set to 0 and v()=f(0,0,0)=10v(\emptyset)=f(0,0,0)=10.

(a) Compute the exact Shapley value ϕi\phi_i for each feature ii for the instance (1,1,1)(1,1,1). (9)

(b) Verify the local-accuracy (efficiency) property: show that ϕ0+ϕ1+ϕ2+ϕ3=f(1,1,1)\phi_0 + \phi_1 + \phi_2 + \phi_3 = f(1,1,1), where ϕ0=v()\phi_0 = v(\emptyset). (3)


Question 2 — LIME vs. gradient saliency under nonlinearity (12 marks)

You must explain a single prediction of a black-box classifier around input x0=(2,2)x_0 = (2, 2). The model's local behaviour in a neighbourhood is well approximated by g(x1,x2)=3x12x1x2g(x_1, x_2) = 3x_1^2 - x_1 x_2.

(a) Compute the raw gradient saliency (partial derivatives) at x0x_0 and rank the two features by absolute saliency. (4)

(b) LIME fits a linear surrogate by sampling perturbations. Suppose LIME samples symmetric perturbations around x0x_0 and returns coefficients equal to the local partial derivatives at x0x_0. State the LIME local explanation as a linear function g^(x)=w0+w1x1+w2x2\hat g(x) = w_0 + w_1 x_1 + w_2 x_2 and give w1,w2w_1, w_2. (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 \ell 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 LcleanL_{\text{clean}}, corrupted logit-difference LcorrL_{\text{corr}}, and patched logit-difference LpatchL_{\text{patch}}. Give the value that indicates "full causal recovery" and the value indicating "no effect." (3)

(c) Your metric returns 0.050.05 at layer 4 but 0.90.9 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 R2\mathbb{R}^2, but you hypothesise it encodes 3 sparse binary concepts c1,c2,c3c_1, c_2, c_3 in superposition using near-orthogonal directions: d1=(1,0),d2=(0.5,32),d3=(0.5,32).d_1 = (1, 0),\quad d_2 = (-0.5, \tfrac{\sqrt 3}{2}),\quad d_3 = (-0.5, -\tfrac{\sqrt 3}{2}).

(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 a=(0.5,0.87)a = (0.5, 0.87). 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 L1L_1 penalty to recover monosemantic features from these activations. Explain (i) why the L1L_1 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 AA: income =40= 40, debt-ratio =0.5= 0.5, credit-length =2= 2 years. The model's decision boundary (deny if s<0s<0) is: s=0.1(income)8(debt-ratio)1+0.5(credit-length).s = 0.1\,(\text{income}) - 8\,(\text{debt-ratio}) - 1 + 0.5\,(\text{credit-length}).

(a) Compute ss for applicant AA and confirm denial. (2)

(b) Find the minimal single-feature change (change only one feature) that flips the decision to approval (s0s \ge 0), 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 v()=10v(\emptyset)=10): v({1})=20, v({2})=14, v({3})=16, v({1,2})=30, v({1,3})=28, v({2,3})=18, v({1,2,3})=40.v(\{1\})=20,\ v(\{2\})=14,\ v(\{3\})=16,\ v(\{1,2\})=30,\ v(\{1,3\})=28,\ v(\{2,3\})=18,\ v(\{1,2,3\})=40.

(a) Shapley value formula over marginal contributions across all 3!=63!=6 orderings.

Feature 1 marginal contributions:

  • Order where 1 first: v(1)v()=2010=10v(1)-v(\emptyset)=20-10=10 (2 orderings: 123,132)
  • 1 after 2: v(12)v(2)=3014=16v(12)-v(2)=30-14=16 (order 213)
  • 1 after 3: v(13)v(3)=2816=12v(13)-v(3)=28-16=12 (order 312)
  • 1 after 2,3: v(123)v(23)=4018=22v(123)-v(23)=40-18=22 (orders 231,321)

ϕ1=16[2(10)+16+12+2(22)]=16[20+16+12+44]=926=15.3\phi_1 = \frac{1}{6}[2(10)+16+12+2(22)] = \frac{1}{6}[20+16+12+44]=\frac{92}{6}=15.\overline{3} (3)

Feature 2 marginal contributions:

  • 2 first: v(2)v()=1410=4v(2)-v(\emptyset)=14-10=4 (2 orderings)
  • 2 after 1: v(12)v(1)=3020=10v(12)-v(1)=30-20=10
  • 2 after 3: v(23)v(3)=1816=2v(23)-v(3)=18-16=2
  • 2 after 1,3: v(123)v(13)=4028=12v(123)-v(13)=40-28=12 (2 orderings)

ϕ2=16[2(4)+10+2+2(12)]=16[8+10+2+24]=446=7.3\phi_2=\frac{1}{6}[2(4)+10+2+2(12)]=\frac{1}{6}[8+10+2+24]=\frac{44}{6}=7.\overline{3} (3)

Feature 3 marginal contributions:

  • 3 first: v(3)v()=1610=6v(3)-v(\emptyset)=16-10=6 (2 orderings)
  • 3 after 1: v(13)v(1)=2820=8v(13)-v(1)=28-20=8
  • 3 after 2: v(23)v(2)=1814=4v(23)-v(2)=18-14=4
  • 3 after 1,2: v(123)v(12)=4030=10v(123)-v(12)=40-30=10 (2 orderings)

ϕ3=16[2(6)+8+4+2(10)]=16[12+8+4+20]=446=7.3\phi_3=\frac{1}{6}[2(6)+8+4+2(10)]=\frac{1}{6}[12+8+4+20]=\frac{44}{6}=7.\overline{3} (3)

(b) ϕ0+ϕ1+ϕ2+ϕ3=10+926+446+446=10+1806=10+30=40=f(1,1,1).\phi_0+\phi_1+\phi_2+\phi_3 = 10 + \frac{92}{6}+\frac{44}{6}+\frac{44}{6} = 10 + \frac{180}{6} = 10+30 = 40 = f(1,1,1). ✓ Efficiency holds. (3)


Question 2 (12 marks)

(a) g/x1=6x1x2\partial g/\partial x_1 = 6x_1 - x_2; at (2,2)(2,2): 122=1012-2=10. g/x2=x1\partial g/\partial x_2 = -x_1; at (2,2)(2,2): 2-2. 10>2|10|>|-2|feature x1x_1 ranked first. (4)

(b) Linear surrogate using local gradient: w1=10, w2=2w_1=10,\ w_2=-2. Intercept so surrogate matches at x0x_0: g(2,2)=3(4)4=8g(2,2)=3(4)-4=8, so w0=810(2)(2)(2)=820+4=8w_0 = 8 - 10(2) - (-2)(2) = 8-20+4=-8. g^(x)=8+10x12x2.\hat g(x) = -8 + 10x_1 - 2x_2. (4)

(c) With large-neighbourhood sampling, LIME fits a least-squares line over a wide range where the 3x123x_1^2 curvature dominates. Averaging the effective slope over a large x1x_1 range around 2 inflates the x1x_1 coefficient (secant slope \ne tangent), while the x1x2-x_1 x_2 cross-term makes the fitted x2x_2 slope depend on the sampled x1x_1 values (could shrink toward x1-\langle x_1\rangle).

Numerical example: sampling x1{1,3}x_1\in\{1,3\} at x2=2x_2=2: values g=1, 21g=1,\ 21; secant slope =(211)/2=10=(21-1)/2=10 — but with x2x_2 varied, e.g. x2{0,4}x_2\in\{0,4\} at x1=2x_1=2 gives g=12,4g=12,4, slope =4=-4 vs tangent 2-2. 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 \ell, 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 \ell, subject token position)
  • (2) correct readout metric (logit difference)

(b) Normalized effect: M=LpatchLcorrLcleanLcorr.M=\frac{L_{\text{patch}}-L_{\text{corr}}}{L_{\text{clean}}-L_{\text{corr}}}. M=1M=1 → full causal recovery (patch restores clean behaviour); M=0M=0 → no effect (patch changed nothing). (3)

(c) Interpretation: layer 4 activation at that token carries little causal info (M=0.05M=0.05); by layer 8 the information needed to produce the answer has been assembled/moved there (M=0.9M=0.9). (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 cos=\cos= dot product):

  • d1d2=(1)(0.5)+(0)(32)=0.5d_1\cdot d_2 = (1)(-0.5)+(0)(\tfrac{\sqrt3}{2}) = -0.5
  • d1d3=0.5d_1\cdot d_3 = -0.5
  • d2d3=0.250.75=0.5d_2\cdot d_3 = 0.25 - 0.75 = -0.5

All pairwise cos=0.5\cos=-0.5 (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 0.5-0.5 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 a=(0.5,0.87)a=(0.5,0.87):

  • ad1=0.5a\cdot d_1 = 0.5
  • ad2=0.25+0.87(0.866)=0.25+0.753=0.503a\cdot d_2 = -0.25 + 0.87(0.866)=-0.25+0.753=0.503
  • ad3=0.250.753=1.003a\cdot d_3 = -0.25 - 0.753 = -1.003

d2d_2 scores highest (0.503\approx0.503), so concept c2c_2 is most likely active (note ad2a\approx d_2 since (0.5,0.866)(-0.5,0.866) ≈ up to sign — actually a=(0.5,0.87)a=(0.5,0.87) closely matches d2d_2's yy; d2d_2 wins). (3)

(c) (i) The L1L_1 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) s=0.1(40)8(0.5)1+0.5(2)=441+1=0s = 0.1(40) - 8(0.5) - 1 + 0.5(2) = 4 - 4 - 1 + 1 = 0?

Recompute: 44=04 - 4 = 0; 01=10 - 1 = -1; 1+1=0-1 + 1 = 0. So s=0s=0. Since deny is s<0s<0 and here s=00s=0\ge0... Let's re-read: with credit-length 2, s=0s=0approve. To ensure denial as stated, the intended value: s=0s=0 is the boundary. Answer: s=0s=0, exactly on boundary (approve by 0\ge0 rule). Award full marks for correct arithmetic s=0s=0 and noting boundary. (2)

(Marker note: model output s=0s=0; treat as boundary case.)

(b) Need s0s\ge0. Baseline contributions: 0.1inc8dr1+0.5cl0.1\cdot\text{inc} - 8\cdot\text{dr} - 1 + 0.5\cdot\text{cl}.

Solve each holding others at applicant values (inc=40, dr=0.5, cl=2), and using the fixed sum of the other terms.

  • Income: 0.1I41+100.1I4I400.1\,I - 4 - 1 + 1 \ge 0 \Rightarrow 0.1I \ge 4 \Rightarrow I \ge 40. New income 40\ge 40 (already at boundary; any increase, e.g. I=40I=40 gives s=0s=0). Minimal: I40I\ge40. (2)
  • Debt-ratio: 48d1+1048d0d0.54 - 8\,d - 1 + 1 \ge 0 \Rightarrow 4 - 8d \ge 0 \Rightarrow d \le 0.5. New debt-ratio 0.5\le 0.5. Minimal decrease from 0.5: d0.5d\le0.5. (2)
  • Credit-length: 441+0.5c00.5c1c24 - 4 - 1 + 0.5c \ge 0 \Rightarrow 0.5c \ge 1 \Rightarrow c \ge 2. New credit-length 2\ge 2 years. (2)

(Since applicant sits exactly at s=0s=0, all three are at their thresholds; a strict flip to s>0s>0 needs any improvement: e.g. I>40I>40, d<0.5d<0.5, or c>2c>2.) Full marks for the three inequalities/thresholds.

(c) With credit-length non-actionable, present the