Attention Deficits in Language Models: Causal Explanations for Procedural Hallucinations
Organizations: Hassana Labs · University of Oxford
Abstract
Large language models can follow complex procedures yet fail at a seemingly trivial final step: reporting a value they themselves computed moments earlier. We study this phenomenon as procedural hallucination: failure to execute a verifiable, prompt-grounded specification even when the correct value is present in context. In long-context binding tasks with a known single-token candidate set, we find that many errors are readout-stage routing failures. Specifically, failures decompose into Stage2A (gating) errors, where the model does not enter answer mode, and Stage2B (binding) errors, where it enters answer mode but selects the wrong candidate (often due to recency bias). In the hard regime, Stage2B accounts for most errors across model families in our tasks (Table1). On Stage2B error trials, a linear probe on the final-layer residual stream recovers the correct value far above chance (e.g., 74% vs.\ 2% on Qwen2.5-3B; Table2), indicating that the answer is encoded but not used. We formalize ``present but not used'' via available vs.\ used mutual information and pseudo-prior interventions, yielding output-computable diagnostics and information-budget certificates. Finally, an oracle checkpointing intervention that restates the true binding near the query can nearly eliminate Stage2B failures at long distance (e.g., Qwen2.5-3B at ; Table8).
Figures & tables
| competing_vars | primacy_recency |
|---|---|
| KEY1 = [apple] | KEY = [alpha] |
| [k filler tokens] | [k filler tokens] |
| KEY2 = [banana] | KEY = [beta] |
| [k filler tokens] | [k filler tokens] |
| What is KEY1? KEY1 = [ | KEY = [gamma] |
| [k filler tokens] |
| Model | Task | Acc | Cand Acc | Frac 2A | Frac 2B | GateGap | ValueGap | |
|---|---|---|---|---|---|---|---|---|
| Qwen2.5-3B | competing | 256 | 0.107 | 0.158 | 0.350 | 0.650 | 0.56 | -1.81 |
| Qwen2.5-3B | primacy | 256 | 0.043 | 0.045 | 0.185 | 0.815 | 0.96 | -3.40 |
| Qwen2.5-3B-Inst. | competing | 256 | 0.276 | 0.360 | 0.402 | 0.598 | 0.61 | -0.77 |
| Qwen2.5-3B-Inst. | primacy | 256 | 0.061 | 0.059 | 0.072 | 0.928 | 2.10 | -3.96 |
| Gemma-2-2B | competing | 256 | 0.995 | 0.995 | 0.000 | 1.000 | 3.03 | 2.28 |
| Gemma-2-2B | primacy | 256 | 0.801 | 0.804 | 0.013 | 0.987 | 1.65 | 0.47 |
| Task | Acc | Cand Acc | Frac 2B | Probe@0 | Probe@18 | Probe@35 | |
|---|---|---|---|---|---|---|---|
| competing | 256 | 0.200 | 0.255 | 0.641 | 0.019 | 0.083 | 0.739 |
| competing | 512 | 0.000 | 0.000 | 0.968 | 0.008 | 0.029 | 0.390 |
| primacy | 256 | 0.069 | 0.074 | 0.754 | 0.020 | 0.040 | 0.354 |
| primacy | 512 | 0.000 | 0.000 | 0.994 | 0.020 | 0.020 | 0.124 |
| Model | Task | Baseline | +Checkpoint | |
|---|---|---|---|---|
| Qwen2.5-3B | competing | 1024 | 0.000 | 0.998 |
| Qwen2.5-3B | primacy | 1024 | 0.000 | 0.763 |
| Llama-3.2-3B-Inst. | competing | 2048 | 0.000 | 0.853 |
| Llama-3.2-3B-Inst. | primacy | 1024 | 0.003 | 0.915 |
| Gemma-2-2B-it | primacy | 1024 | 0.440 | 0.968 |
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Acc(%) | Pass(%) | Acc(pass)(%) | Acc(flag)(%) | Lift(pp) | |
|---|---|---|---|---|---|---|
| Mistral-7B (baseline) | 1024 | 98.3 | 54.8 | 100.0 | 97.0 | 3.0 |
| Mistral-7B (baseline) | 2048 | 87.0 | 68.6 | 99.5 | 63.7 | 35.8 |
| Variant | Pass(%) | Acc(pass)(%) | Acc(flag)(%) | Lift(pp) | |||
|---|---|---|---|---|---|---|---|
| baseline | 369 | 21.1 | 83.3 | 61.5 | 21.8 | 0.398 | 0.036 |
| rag | 378 | 25.1 | 81.1 | 60.4 | 20.6 | 0.428 | 0.039 |
| checkpoint | 383 | 24.0 | 82.6 | 59.5 | 23.2 | 0.430 | 0.037 |
| Head | Mean patch restoration | Mean ablation margin | |
|---|---|---|---|
| L25H2 (misbinding/interference) | 0.169 | +0.508 | 159 |
| L22H3 (counterbalances recency) | 0.121 | -0.321 | 159 |
| Task | Qwen2.5-3B | Llama-3.2-3B-Inst. | Gemma-2-2b-it | |
|---|---|---|---|---|
| competing_vars | 256 | 0.203 | 0.993 | 1.000 |
| 512 | 0.008 | 0.993 | 1.000 | |
| 1024 | 0.000 | 0.455 | 0.998 | |
| 2048 | — | 0.000 | — | |
| primacy_recency | 256 | 0.060 | 0.868 | 0.963 |
| 512 | 0.003 | 0.553 | 0.798 |
| Model | Task | Baseline | +Checkpoint | Acc | ValueGap | ValueGap | |
|---|---|---|---|---|---|---|---|
| Qwen2.5-3B | competing_vars | 256 | 0.203 | 0.973 | +0.770 | -1.02 | +2.81 |
| competing_vars | 512 | 0.008 | 0.993 | +0.985 | -5.75 | +2.61 | |
| competing_vars | 1024 | 0.000 | 0.998 | +0.998 | -9.93 | +2.88 | |
| primacy_recency | 256 | 0.060 | 0.760 | +0.700 | -2.88 | +0.80 | |
| primacy_recency | 512 | 0.003 | 0.573 | +0.570 | -6.53 | +0.26 | |
| primacy_recency | 1024 | 0.000 | 0.763 | +0.763 | -9.05 | +1.01 |
| Meta-Llama-3.1-8B-Instruct | Gemma-2-9b-it | |||||
|---|---|---|---|---|---|---|
| Acc (base) | (base) | Acc (+Chk) | Acc (base) | (base) | Acc (+Chk) | |
| 0 | 0.435 | 0.185 | 0.510 | 0.330 | 0.490 | 1.000 |
| 64 | 0.575 | 0.130 | 0.590 | 0.415 | 0.300 | 1.000 |
| 256 | 0.550 | 0.155 | 0.550 | 0.640 | 0.150 | 0.995 |
| 1024 | 0.435 | 0.105 | 0.580 | 0.740 | 0.015 | 1.000 |
| 2048 | 0.430 | 0.055 | 0.600 | 0.820 | 0.000 | 1.000 |
| Qwen2.5-3B-Instruct | Llama-3.2-3B-Instruct | Gemma-2-2b-it | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| L | C | Rest | M | L | C | Rest | M | L | C | Rest | M |
| 28 | attn | -0.03 | -0.50 | 20 | attn | -0.04 | 0.04 | 18 | attn | 0.02 | -0.41 |
| 28 | mlp | 0.03 | 0.59 | 20 | mlp | 0.04 | 0.03 | 18 | mlp | 0.01 | 0.17 |
| 29 | attn | 0.06 | 1.02 | 21 | attn | 0.23 | 0.06 | 19 | attn | 0.10 | 0.12 |
| 29 | mlp | -0.01 | -0.24 | 21 | mlp | -0.04 | 0.00 | 19 | mlp | -0.03 | -0.05 |
| 30 | attn | -0.04 | -0.71 | 22 | attn | -0.03 | 0.09 | 20 | attn | -0.01 | 0.02 |
| Task | Filler | Acc | Cand-Acc | Frac-2A | Frac-2B | GateGap | ValueGap | |
|---|---|---|---|---|---|---|---|---|
| competing_vars | decoy_heavy | 128 | 0.999 | 0.999 | 0.000 | 1.000 | 3.74 | 5.12 |
| competing_vars | decoy_heavy | 256 | 0.107 | 0.158 | 0.350 | 0.650 | 0.56 | -1.81 |
| competing_vars | decoy_heavy | 512 | 0.003 | 0.001 | 0.023 | 0.977 | 1.99 | -7.26 |
| competing_vars | decoy_heavy | 1024 | 0.000 | 0.000 | 0.033 | 0.968 | 1.79 | -10.10 |
| competing_vars | repeat | 128 | 0.030 | 0.080 | 0.570 | 0.430 | -0.07 | -3.39 |
| competing_vars | repeat | 256 | 0.026 | 0.069 | 0.792 | 0.208 | -0.80 | -4.33 |
| Task | Cand-Acc | Probe@35 (Stage 2B err) | |||
|---|---|---|---|---|---|
| competing_vars | 256 | 0.255 | 0.45 | 0.739 | 2.32 |
| competing_vars | 512 | 0.000 | 0.00 | 0.390 | 0.87 |
| primacy_recency | 256 | 0.074 | 0.04 | 0.354 | 0.75 |
| primacy_recency | 512 | 0.000 | 0.00 | 0.124 | 0.13 |
| Variant | Pass(%) | Acc(pass)(%) | Acc(flag)(%) | Lift(pp) | |
|---|---|---|---|---|---|
| 0.65 | baseline | 24.7 | 83.5 | 60.4 | 23.1 |
| 0.65 | checkpoint | 27.4 | 81.0 | 59.0 | 22.0 |
| 0.65 | rag | 28.6 | 79.6 | 60.0 | 19.6 |
| 0.70 | baseline | 22.5 | 84.3 | 60.8 | 23.5 |
| 0.70 | checkpoint | 25.3 | 82.5 | 59.1 | 23.4 |
| 0.70 | rag | 26.2 | 81.8 | 59.9 | 22.0 |
| Null operator | Variant | Pass(%) | Acc(pass)(%) | Acc(flag)(%) | Lift(pp) |
|---|---|---|---|---|---|
| no-evidence | baseline | 22.8 | 79.8 | 62.1 | 17.7 |
| no-evidence | checkpoint | 25.1 | 81.2 | 59.6 | 21.7 |
| no-evidence | rag | 26.5 | 79.0 | 60.8 | 18.2 |
| redact-span | baseline | 27.4 | 81.2 | 60.4 | 20.7 |
| redact-span | checkpoint | 30.8 | 78.8 | 58.9 | 19.9 |
| redact-span | rag | 31.2 | 80.5 | 58.8 | 21.7 |
| Pass(%) | ||||
|---|---|---|---|---|
| 512 | 200 | 66.0 | 0.756 | [0.179, 0.272] |
| 1024 | 200 | 0.0 | 0.728 | [0.097, 0.184] |
| 2048 | 200 | 100.0 | 0.841 | [0.181, 0.361] |
Hallucination in Language Models
Hallucination in language models studies how systems produce unsupported or false claims and how to detect, explain, and reduce them.
See all 254 papers