Module 4 – Transparency and Explainability
2025-08-29
Note
🤔Framing: Explanations are a safety and accountability tool—not a magic truth serum for LLMS, nor a compliance checkbox.
There are alternative taxonomies.
Note
📚 (Doshi-Velez and Kim 2017; Lipton 2018; Barredo Arrieta et al. 2020)
Warning
Be aware of post-hoc reasoning. Was the interpretation for a decision extracted during the decision itself, or did an LLM explain its own decision after the fact?
Warning
Misuse risk: Plausible stories can mislead if they aren’t faithful. Don’t mistake rationalizations for reasons. Beware confirmation bias.
What kinds of explanations do you encounter day-to-day? Are they satisfying?
Note
A model can be ‘black-box’ even if it is under your desk on your own Linux machine. It’s about inscrutability, not transparency.
Of course, the problem is exacerbated if you can only access the model remotely through API calls.
Note
| Factor | Black-box Models | Interpretable Models |
|---|---|---|
| Accuracy | Often higher | Sometimes lower |
| Transparency | Low | High |
| Trust | Requires justification | Built-in |
| Flexibility | High | Often limited |
These are not universally-acknowledged truths.
🤔 Where in your industry would you accept a small performance hit in exchange for clarity?
Heatmaps
(for images)
From here
Text attention overlays
From Feng, Shaib, and Rudzicz (2020)
Feature contribution charts
Useful when using ‘structured’ data
From here
\(g(E[y])=\beta_0 + \sum_j \color{green}{f_j}(x_j)\)
\(g(E[y])=\beta_0 + \sum_j \color{green}{f_j}(x_j) + \sum_{i\neq j} \color{red}{f_{i,j}}(x_i, x_j)\)
Tip
OK, good. Risk of pneumonia increases with age.
Important
Uh oh, bad. Risk of pneumonia decreases if you have asthma??
Note
For an instance \(x_0\), LIME solves
\(\arg\min_{g \in \mathcal{G}} \underbrace{\mathcal{L}\!\big(f, g, \pi_{x_0}\big)}_{\text{local fidelity}} \;+\; \underbrace{\Omega(g)}_{\text{simplicity}}\)
From Ribeiro, Singh, and Guestrin (2016).
📊 Demo: LIME playground
LLMs can produce explanations along with their response, called self-explanations. (S. Huang et al. 2023)
For example, when analyzing the sentiment of a movie review, the model may output not only the positivity of the sentiment, but also an explanation (e.g., by listing the sentiment-laden words such as “fantastic” and “memorable” in the review). How good are these automatically generated self-explanations?
Self-explanations cannot be assumed to be faithful without structured validation. (Madsen, Chandar, and Reddy 2024)
Note
Key idea: Share the prediction among features according to their marginal contributions over many coalitions.
For an instance \(x_0\), each feature \(i\) receives a Shapley value \(\phi_i\) summarizing its average marginal contribution across feature coalitions: \[ \phi_i = \sum_{S \subseteq F \setminus \{i\}} \frac{|S|!\,(|F|-|S|-1)!}{|F|!}\; \Big(f_{S \cup \{i\}} - f_S\Big) \]
Keep in mind: Explainer choice affects speed, variance, and assumptions.
Is:
Isn’t:
Warning
Caveat: Correlated features, leakage, or irrelevant features can distort SHAP importance. Recent work (e.g., X. Huang and Marques-Silva (2024)) shows SHAP can assign zero to relevant features and high weight to irrelevant ones.
Keep Your Guard Up!
Definition Sundararajan, Taly, and Yan (2017): \[ IG_i(x) \;=\; (x_i - x'_i)\, \int_{0}^{1} \frac{\partial f\!\left(x' + \alpha(x - x')\right)}{\partial x_i}\, d\alpha \]
Note
Takeaway: Choose method based on context, validate with sanity checks, and never confuse attribution with causality.
Jiang et al. (2024) formalizes robustness, failure modes, and evaluation.
VanNostrand et al. (2024) ran a between-subjects user study (\(N = 252\)) to examine the effects of counterfactual explanation types .
Qualitative themes (why users liked regions):
Note
Why this matters: This isolates what (point vs region) from how (numeric vs text vs visual), so we can teach design choices with evidence—not “vibes”.
Version-stamped: Model v1.9, trained to 2025-06, valid until 2025-09
Choose a real or hypothetical AI decision-making system and answer:
Next module: Accountability & Governance