6.3.1 · D4Interpretability & Explainability

Exercises — Importance of interpretability

3,070 words14 min readBack to topic

Before we start, one symbol we will reuse. When we write we mean: the probability that the model outputs the label "1" (say, "high risk"), given that we already know the input features . The bar | reads as "given that we already know". The little hat on marks it as the model's guess, not the real truth . Everything numeric in these exercises is built from that one object.

Recall The Five Pillars (referenced throughout — keep this open as a cheat-sheet)

The parent note lists five reasons interpretability matters. These exercises invoke them by number, so here they are stated in one place:

  1. Trust and Adoption — humans must verify the model's reasoning matches domain expertise before acting on it.
  2. Debugging and Model Improvement — interpretability reveals what the model actually learned (e.g. a spurious shortcut), which high accuracy can hide.
  3. Regulatory and Legal Compliance — laws require you to articulate, contest and audit automated decisions.
  4. Bias Detection and Fairness — interpretability shows which features carry historical discrimination, not just that bias exists.
  5. Safety in High-Stakes Domains — you must prove the reasoning is sound (autonomous vehicles, medical devices), not merely usually correct.

Level 1 — Recognition

Goal: can you tell the two basic kinds of interpretability apart, and name the concept?

Exercise 1.1

For each statement, say whether it describes Global or Local interpretability.

  • (a) "Across all patients, cholesterol is the feature the model relies on most."
  • (b) "For this patient, the model flagged high blood pressure as the deciding factor."
  • (c) "The decision tree's top split (income) is what most influences every prediction."
Recall Solution 1.1

Recall the parent definitions: Global = understanding the entire model logic across all inputs; Local = understanding one single prediction.

  • (a) Global — "across all patients" is the whole-model view.
  • (b) Local — "for this patient" is a single prediction.
  • (c) Global — "influences every prediction" is model-wide behaviour.

Exercise 1.2

Fill the blank: The degree to which a human can understand the cause of a decision made by an ML model is called ______ .

Recall Solution 1.2

Interpretability (also called model transparency). It answers "Why did the model make this prediction?" and "How does it work?"


Level 2 — Application

Goal: plug numbers into the two formulas the parent gave you.

Exercise 2.1 — The Value function

The parent's decision cost function is

Two of these terms need unpacking before you use them:

  • ==TrustGap== = how far short of "humans will actually rely on it" the model falls (0 = users fully trust and adopt it, 1 = they refuse to use it). A bare "78% risk" black box has a high TrustGap because a doctor can't verify it; a model listing named risk factors has a low TrustGap.
  • The ==weights == say how heavily each penalty counts in this domain. They are not universal constants: you set them from the stakes. In banking, ComplianceCost is punishing (regulators audit every denial) so is large; in a low-stakes photo app all three 's are near zero. In practice they are chosen by domain experts and risk/compliance officers (e.g. from the expected fine for a violation, or the revenue lost to distrust), then tuned so the formula ranks past decisions the way the organisation actually would.

Every quantity is on a 0–1 scale. Compare two fraud models:

Accuracy DeploymentRisk ComplianceCost TrustGap
Black box 0.90 0.40 0.30 0.50
Interpretable 0.85 0.10 0.05 0.10

Use (a fraud/regulated setting: compliance weighted heaviest). Which wins on Value?

Recall Solution 2.1

What we do: substitute each row into the formula. Why: the whole point of the parent's lesson is that accuracy alone is the wrong scoreboard in regulated, high-stakes settings.

Black box: Interpretable: Interpretable wins, , even though it is 5 accuracy points worse. The penalties for risk, compliance and distrust erase the black box's raw accuracy edge.

Exercise 2.2 — Group disparity check

Recall the fairness inequality from the parent: This inequality is the statement that a fairness criterion called ==demographic parity== (equal predicted-positive rate across groups) is violated. A loan model, on applicants with identical financial features, approves ("") at rate 0.72 for group and 0.51 for group . Compute the disparity gap and say whether demographic parity holds.

Recall Solution 2.2

Demographic parity would require (equal approval rate across groups). Since (a 21 percentage-point gap) on otherwise comparable applicants, parity is violated — a fairness red flag. The inequality holds, so equal treatment fails.


Level 3 — Analysis

Goal: reason about why a scenario goes wrong, using the five pillars above.

Exercise 3.1 — The snow detector

A classifier scores 95% on the wolf-vs-husky test set. A saliency map (a picture that highlights the pixels that most drove the decision) lights up the background snow, not the animal. Explain, in cause-and-effect terms: (a) what the model actually learned, (b) why 95% test accuracy did not catch it, (c) which of the five pillars this failure belongs to, and (d) the fix.

The figure below shows exactly this. Left: the input photo a human sees — an animal against a snowy background. Right: the saliency map of the same photo — the amber region (top, the snow) is what the model treated as HIGH importance, while the animal itself (cyan) barely mattered. The lesson to read off it: the model's "reasoning" landed on the background, not the subject, so its rule is really if snow → wolf.

Figure — Importance of interpretability
Recall Solution 3.1

(a) What it learned: the rule if snow → wolf. Because the training photos had wolves in snow and huskies on grass, snow was a shortcut perfectly correlated with the label — a spurious correlation. The model latched onto the easy signal (bright white background) instead of the animal — exactly the amber region in the figure.

(b) Why accuracy hid it: the test set came from the same biased distribution as training — wolves in snow, huskies in grass — so the shortcut kept working. High test accuracy only proves the model matches that distribution, not that it learned the intended concept. This is exactly why the parent warns: high accuracy on test data doesn't guarantee the right features.

(c) Which pillar: Pillar 2, Debugging and Model Improvement. Interpretability revealed what was learned, turning an invisible bug into a visible one. (See Post-hoc Interpretability Methods for how saliency maps are computed.)

(d) Fix: augment the data with diverse backgrounds — huskies in snow, wolves on grass — so the snow shortcut no longer predicts the label, forcing the model to attend to the animal.

Exercise 3.2 — COMPAS proxy

COMPAS never uses "race" as an input, yet interpretability analysis showed a higher false-positive rate for Black defendants, traced to heavy weight on "number of prior arrests." Explain how bias entered a model that excluded the protected attribute.

Recall Solution 3.2

The mechanism is a proxy. "Prior arrests" is not race, but it is statistically entangled with race because policing patterns produced more arrests in minority communities for the same underlying offense rate. So "arrests" secretly carries the historical discrimination that "race" would have carried directly.

Removing the protected attribute is therefore not enough — the bias re-enters through a correlated feature. This is why the parent stresses that fairness metrics alone don't show how bias enters; interpretability reveals which feature is the carrier. (Deeper treatment: Fairness in Machine Learning.)


Level 4 — Synthesis

Goal: combine the pillars, the trade-off, and the decision framework into one judgement.

Exercise 4.1 — Trust equation reasoning

The parent gives . A hospital tests two heart-disease models:

  • Model P: 99% accurate, black box, outputs only "78% risk."
  • Model Q: 88% accurate, lists "cholesterol 240, BP 160/95, family history, smoking."

Doctors adopt Q, not P. Using all three arguments of , explain why higher accuracy lost.

Recall Solution 4.1

Trust is a function of three inputs, and P is strong in only one:

  • Accuracy: P wins (99 vs 88).
  • Interpretability: Q wins decisively — it names features; P is a bare number.
  • Alignment with domain knowledge: Q wins — cholesterol, BP, smoking are exactly what cardiologists already trust as risk factors, so doctors can verify the reasoning. P offers nothing to check against, so doctors fear it may ride a spurious correlation (the parent's "zip code ↔ race" worry).

Two of three arguments favour Q, and the two it wins are the ones that let a human validate before acting on a high-stakes decision. A single dominant accuracy input can't compensate for zero interpretability and zero verifiable alignment — so ranks Q higher. This mirrors the parent's line: an 85%-accurate interpretable model often beats a 99%-accurate black box in adoption.

Exercise 4.2 — Apply the decision framework

Classify each deployment as favor interpretability or favor accuracy (+ post-hoc) using the parent's IF high_stakes OR regulated OR needs_trust ... rule.

  • (a) A meme-caption generator in a photo app.
  • (b) A model deciding parole eligibility.
  • (c) A bank's automated loan-denial system.
  • (d) A recommender suggesting which song plays next.
Recall Solution 4.2

Check each against the three triggers high_stakes, regulated, needs_trust:

  • (a) Meme captions → low stakes, unregulated, low trust demand → favor accuracy (black box + optional post-hoc is fine).
  • (b) Parole → high stakes and affects liberty, subject to legal challenge → favor interpretability.
  • (c) Loan denial → regulated (Fair Credit Reporting Act / ECOA require stating principal reasons and proving non-discrimination) → favor interpretability.
  • (d) Song recommender → low stakes, no regulation, mistakes are cheap → favor accuracy.

The rule is an OR — a single trigger flips you to interpretability. (b) and (c) each fire at least one trigger; (a) and (d) fire none.


Level 5 — Mastery

Goal: design and defend a full decision, integrating trade-off math with the pillars.

Exercise 5.1 — Break-even accuracy

A regulator will accept a fraud model only if its Value (parent formula, same 's as Ex 2.1: ) is at least 0.75. Your candidate interpretable model has DeploymentRisk , ComplianceCost , TrustGap . What is the minimum accuracy it must reach to clear the bar? Interpret the result.

Recall Solution 5.1

Set up the inequality. Penalties are fixed: So . Require : Interpretation: because its penalties are tiny (0.07 total), this interpretable model needs only 82% accuracy to satisfy a regulator demanding Value . A black box carrying the Ex-2.1 penalties (0.34 total) would need impossible, since accuracy caps at 1. That is the mathematical statement of the parent's whole thesis: interpretability lowers the accuracy bar you must clear by shrinking the penalty terms.

Exercise 5.2 — Design a defensible pipeline

You must deploy a deep neural network (chosen for accuracy) for radiology, but the FDA expects the tool to "show reasoning." You cannot swap in a simpler model. Design a two-part strategy and justify each part with a pillar. Which vault topics support each part?

Recall Solution 5.2

Strategy = keep the accurate model, bolt on explanation + documentation.

Part 1 — Post-hoc local explanations. Attach attention/saliency maps so each scan's prediction highlights the region driving it (e.g., the actual lesion, not an image artifact).

  • Pillar: Pillar 5, Safety in high-stakes domains — clinicians must confirm the model looked at real pathology, not a scanner watermark, exactly like the autonomous-car attention-map example.
  • Vault: Post-hoc Interpretability Methods, Explainable AI (XAI) Techniques.

Part 2 — Global documentation of scope and limits. Ship a model card — a short standardized document stating the model's training population, intended use, known failure modes, and per-subgroup test performance.

  • Pillar: Pillar 3, Regulatory / Legal compliance — the model card provides the audit trail and "meaningful information about the logic" regulators want, and lets you contest / review decisions.
  • Vault: Model Cards and Documentation.

Bonus robustness note: since deep nets are vulnerable to Adversarial Examples, the saliency maps also serve as a sanity check — if the highlighted region is nonsensical for a confident prediction, that's a signal of an adversarial or corrupted input. This ties Pillar 2, Debugging into a safety-critical deployment.

Why this design is defensible: you satisfied the "show reasoning" demand without sacrificing the accuracy that motivated the deep net — the parent's recommended path for pure_prediction ... add post-hoc interpretability, upgraded for a regulated domain by adding the global documentation layer.


Recall One-line self-test before you leave

Disparity (demographic parity) is measured between which two things? ::: The two conditional group distributions and — group vs group, never group vs overall average.