Part XXI — Explainable AI & Model Interpretability · Chapter 13

Audit one model, five different ways

Hook

One model: predict 11 only when x1>3x_1 > 3 and x2>3x_2 > 3. One instance: (5,5)(5, 5). Five explainability methods from this course, all pointed at the exact same question — does x1x_1 or x2x_2 matter more here? They don't all give the same answer.

Intuition

Tree importance, Shapley values, and integrated gradients, applied to the same model and the same instance. Switch between them and watch which feature comes out on top change depending on which question you asked.

Formalize

Five methods, five different questions about the same (x1,x2)=(5,5)(x_1, x_2) = (5, 5):

anchor: what rule guarantees this prediction?tree: what did training find useful?Shapley: fair credit over all orderings?\text{anchor: what rule guarantees this prediction?} \quad\big|\quad \text{tree: what did training find useful?} \quad\big|\quad \text{Shapley: fair credit over all orderings?}IG: integral of gradient along the path from baseline?PDP: average behavior as x1 sweeps?\text{IG: integral of gradient along the path from baseline?} \quad\big|\quad \text{PDP: average behavior as } x_1 \text{ sweeps?}
  1. None of these is wrong

    Each method is answering a genuinely different question about the same instance — disagreement between them isn't a bug in any one of them.

  2. Each draws on different information
    • Tree importance reads a training dataset's split structure
    • Shapley plays a coalition game over feature presence
    • Integrated gradients integrates a smooth surrogate's gradient field
    • PDP and anchors work directly off the raw grid itself
Play
PDP: average predicted probability as x1 sweeps, across three representative x2 rows

Shapley and integrated gradients agree perfectly — both are symmetric in x1x_1 and x2x_2, and both split credit exactly down the middle. Tree importance doesn't: whichever feature happens to win the root split (a near-arbitrary tie here) ends up with less total credit than the feature that gets to clean up the remaining impurity deeper in the tree.

Worked example
  1. Shapley values: perfectly symmetric

    Coalition values:

    • v()=0v(\emptyset)=0
    • v({x1})=0v(\{x_1\})=0
    • v({x2})=0v(\{x_2\})=0
    • v({x1,x2})=1v(\{x_1,x_2\})=1

    Two orderings, each feature's marginal contribution depending on whether it joins first or second:

    • Order (x1,x2)(x_1,x_2): x1x_1 joins an empty coalition, contributing v({x1})v()=00=0v(\{x_1\})-v(\emptyset)=0-0=0; x2x_2 joins after x1x_1, contributing v({x1,x2})v({x1})=10=1v(\{x_1,x_2\})-v(\{x_1\})=1-0=1
    • Order (x2,x1)(x_2,x_1): x2x_2 joins first, contributing v({x2})v()=00=0v(\{x_2\})-v(\emptyset)=0-0=0; x1x_1 joins after x2x_2, contributing v({x1,x2})v({x2})=10=1v(\{x_1,x_2\})-v(\{x_2\})=1-0=1

    Averaging each feature's two contributions:

    • ϕx1=(0+1)/2=0.5\phi_{x_1}=(0+1)/2=0.5
    • ϕx2=(1+0)/2=0.5\phi_{x_2}=(1+0)/2=0.5

    Exactly equal, exactly summing to the total change in value (10=11-0=1).

  2. Integrated gradients: also symmetric, and nearly exact

    The surrogate σ(2(x13))σ(2(x23))\sigma(2(x_1-3))\cdot\sigma(2(x_2-3)) is integrated along α:01\alpha:0\to1 via a 500-step Riemann sum of (surrogate)/x1\partial(\text{surrogate})/\partial x_1 at each α(5,5)\alpha\cdot(5,5). At the endpoint α=1\alpha=1 — the point (5,5)(5,5) itself — s1=s2=σ(2×2)=σ(4)0.982s_1=s_2=\sigma(2\times2)=\sigma(4)\approx0.982, giving one term of that sum, 2×0.982×(10.982)×0.9820.03472\times0.982\times(1-0.982)\times0.982\approx0.0347: one of 500 such terms that get averaged and scaled by x1=5x_1=5. Carrying that out for both features gives IGx1IGx20.482\text{IG}_{x_1}\approx\text{IG}_{x_2}\approx0.482, summing to 0.965\approx0.965 — within 0.00040.0004 of the surrogate's true output change, just like the completeness check from earlier in this part.

  3. Tree importance: the tie-break at the root cascades

    Training a tree on this model's own grid gives:

    • x1x_1 the root split (a tie with x2x_2, broken arbitrarily) with gain 0.266\approx0.266, weighted by all 49 samples: 49/49×0.2660.26649/49\times0.266\approx0.266
    • x2x_2's only split happens one level deeper, on just 21 samples, at a far higher gain 0.985\approx0.985: 21/49×0.9850.42221/49\times0.985\approx0.422

    Net importance: x20.422x_2\approx0.422 actually edges out x10.266x_1\approx0.266, despite the two features being logically interchangeable in the true rule.

Checkpoint

Find the one method, among the three, whose verdict on x1 vs x2 disagrees with the other two.

Pick a method to try it
Summary
5 methods, 1 model, 1 instance    2 say "exactly tied," 1 says "x2 matters more," 2 more (PDP, anchors) don’t even ask that question\text{5 methods, 1 model, 1 instance} \;\Rightarrow\; \text{2 say "exactly tied," 1 says "x2 matters more," 2 more (PDP, anchors) don't even ask that question}

This is the honest state of model explainability: there is no single number that "the" importance of a feature. Shapley values answer a precise, symmetric, game-theoretic question and get a clean answer here because the underlying model happens to be symmetric. Tree importance answers a different question — "what did this particular training procedure find useful, in this particular tree structure" — and that answer is sensitive to arbitrary tie-breaks in a way Shapley values structurally cannot be. Anchors and PDP — short for Partial Dependence Plot — don't rank features against each other at all; they answer their own separate questions about reliability and average behavior. Auditing a model well means running several of these, expecting some disagreement, and understanding why they disagree — not searching for the one that confirms what you already believed. This closes Part XI — Explainability, Continued. The next part turns to multimodal AI, continued: audio, video, and text-conditioned generation.