Question 16 of 20 Intermediate Interpretation
How would you interpret attention maps when assessing whether a model learned meaningful biology?
Short answer
Treat attention weights as a hint about where the model routed information, not as proof of why it predicted. Different attention patterns can give the same output, so test any biological reading with perturbations, controls and independent evidence.
Why
It is tempting to look at which residues of a protein or which regions of a slide a transformer attends to and call those the important biology. Jain and Wallace tested this across many NLP tasks and found attention weights were often uncorrelated with gradient-based importance, and that very different attention distributions could produce equivalent predictions. They concluded standard attention should not be treated as explanation.
Wiegreffe and Pinter replied that the answer depends on how explanation is defined, and proposed tests such as comparing with a uniform-attention baseline and checking variance across random seeds. The practical reading for a scientist is that attention is one view inside a model with many layers and heads, and information also flows through residual paths that attention maps do not show. To use it responsibly, check whether attention is stable across seeds, compare with a baseline, and perturb the attended region to see whether the prediction actually changes.
Then compare the highlighted positions with independent knowledge, such as known binding sites or a pathologist's annotation. Agreement with prior biology is encouraging but can be circular, because people notice the maps that match what they expected. A model attending to slide edges or scanner marks is a useful warning even if the map proves nothing else.
A strong answer covers
- Attention is not by itself an explanation
- Different attention patterns can give the same output
- Check stability across seeds and against a baseline
- Perturb attended regions to test effect
- Beware confirmation when maps match expectations
Common mistakes
- Publishing the highest-attention residues as functional sites without a perturbation test
- Looking at one head in one layer and treating it as the model's reasoning
The interviewer might ask next
What experiment would show that a highlighted region is necessary for the prediction?