Skip to content

Attention is not Explanation

optionalextendedfundamentalpaperrubric 8/122019 · NAACL 2019 · ~25 min

Sarthak Jain, Byron C. Wallace

Status

TL;DR. Attention heatmaps are often shown as explanations. Jain and Wallace test two things such an explanation should satisfy. First, attention should agree with other importance measures. Second, a different attention pattern should change the prediction. For BiLSTM models on classification, QA and NLI, both mostly fail. Wiegreffe and Pinter’s reply, Attention is not not Explanation (EMNLP 2019, code), argues the tests were too loose and proposes stricter ones.

Jain and Wallace. They measure (1) the Kendall τ between attention and gradient-based or leave-one-out importance, and (2) whether alternative attention changes the output. For (2), they randomly permute attention and they search, per instance, for an adversarial distribution that maximises Jensen–Shannon divergence from the learned one while keeping the output within ε in total variation distance (§4.2).

Wiegreffe and Pinter. An explanation is a property of a model, so the counterfactual should be a model too. They add four tests:

  • freeze attention to uniform weights;
  • measure attention variance across random seeds;
  • use attention weights as fixed guides for a context-free MLP;
  • train a whole adversarial model with loss TVD(ŷ_a, ŷ_b) − λ·KL(α_a ‖ α_b) (§3–4).

Jain and Wallace cover SST, IMDB, bAbI tasks 1–3, SNLI, CNN QA and clinical datasets. The finding is that for BiLSTM encoders attention is only weakly and inconsistently related to other importance measures, and adversarial distributions with near-identical outputs are common. In Wiegreffe and Pinter’s diagnostic, positive-class F1 with LSTM attention guides is 0.753 (Diabetes), 0.931 (Anemia), 0.824 (SST) and 0.905 (IMDb). Uniform guides give 0.404, 0.873, 0.812 and 0.863. Consistent adversarial guides give 0.503, 0.932, 0.592 and 0.700 (Table 3). Their conclusion: consistent adversaries exist for the binary classification sets but are less extreme than per-instance ones.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Mechanism

    Jain and Wallace search for adversarial attention distributions that keep the prediction within ε (in total variation distance) while maximising Jensen–Shannon divergence from the learned attention. Explain why such distributions can exist in a BiLSTM classifier, and why Wiegreffe and Pinter argue this per-instance search is too weak a test.

    What a strong answer covers
    • In a BiLSTM each hidden state already mixes information from neighbouring tokens, so very different weightings over hidden states can produce nearly the same pooled vector and output.
    • The adversary optimises a separate attention vector for each instance with the rest of the model fixed. It does not have to come from any model that could be trained.
    • Wiegreffe and Pinter: attention is not a free parameter of the explanation; it is produced by the model. A fair adversary must be a whole model trained to match predictions on all instances while diverging in attention (their TVD − λ·KL objective).
    • They also show that seed-to-seed variance is already large on some datasets (Diabetes), so a divergent adversary there is less surprising.
  2. What if…

    Wiegreffe and Pinter compare four attention "guides" fed to a token-level MLP that cannot see context: uniform, learned by the MLP itself, taken from the trained LSTM, and taken from a consistent adversary. Explain what each comparison tests and what the ordering of results implies.

    What a strong answer covers
    • Uniform vs learned (Trained MLP) tests whether any weighting helps when tokens are processed without context.
    • Base LSTM weights vs Trained MLP tests whether the LSTM's attention carries transferable token-importance information.
    • Adversary vs Base LSTM tests whether the adversarial weights are truly an equally good alternative explanation.
    • Results (Table 3): Base LSTM ≥ Trained MLP ≥ Uniform on all four datasets (for example 0.753 / 0.699 / 0.404 F1 on Diabetes), and adversarial weights do worse (0.503 on Diabetes, 0.592 on SST). So learned attention encodes model-independent token importance, and adversarial weights are not equivalent.
  3. Critique

    The debate principally studies attention over recurrent (BiLSTM) encoders; Jain and Wallace also test QA and NLI, while Wiegreffe and Pinter's diagnostics focus on classification. List what changes when you ask "is attention explanation?" for a transformer reranker or an LLM citing retrieved passages, and design one test that adapts the debate to that setting.

    What a strong answer covers
    • Many layers and heads: there is no single attention distribution, and later layers attend over already-mixed states, which weakens any direct token reading.
    • Attention can be attention to a "sink" token or to formatting, which carries little meaning.
    • Faithfulness and plausibility differ: users may find attention-based highlights plausible even if the model does not use them.
    • Test: for a RAG model, compare passage-level attention mass with leave-one-passage-out effects on the answer; then train a consistent adversary or permute attention and measure answer change, mirroring both papers.

Done with this page?

Status