Length Is Cheap, Competition Is Not: Attention Predicts Context Rot in Retrieval
Abstract
In retrieval tasks, language model failure on long inputs stems from attention competition rather than sequence length, as rival evidence statements sharply reduce accuracy while neutral filler does not.
Why do language models fail on long inputs? The common answer is length. We show that, for retrieval, length is cheap and competition is not. On five open models (0.5B to 3B parameters, four families), neutral filler costs nothing: accuracy stays at 0.97 to 1.00, up to 32K tokens on Qwen2.5-1.5B. Statements in the format of the evidence, placed at the same positions, drop it to 0.16 to 0.33. A single statement that gives the queried key a rival value multiplies the loss by 9 to 110, and every additional rival adds to it. Inside the model, one quantity tracks the failure: the attention mass left on the evidence. Across 126,473 trials it explains up to 58% of the variance in loss; log length explains at most 8%. The masked-filler protocol behind the claim that length alone hurts reproduces on MMLU (11 to 18 points lost at 30K tokens), but fails a visible control in retrieval: masking costs 45 accuracy points at 32K tokens, while the same filler left visible costs none. In retrieval, context rot is a competition for attention. We release the probe and all 126K trial-level measurements.
Community
Author here. Thank you for taking a look.
Short version: in a key-value retrieval task, 32K tokens of neutral text cost Qwen2.5-1.5B almost nothing (accuracy 0.97 to 1.00). Filling the same positions with statements in the evidence format drops accuracy to 0.11 to 0.21. A single statement that gives the queried key a rival value multiplies the loss by 9 to 110.
Inside the model, the attention mass left on the evidence predicts the loss (up to 58% of variance over 126,473 trials), while log length explains at most 8%.
We also replicate the masked-filler protocol of Du et al. (2025) on MMLU, and show that in retrieval the same masking costs 46 accuracy points at 32K tokens while the visible filler costs none.
Limits: correlational (no intervention on attention), one synthetic task, models up to 3B. All trial-level data are on the Hub: https://huggingface.co/datasets/yliusci/length-is-cheap
Happy to answer questions or run checks people suggest.
Get this paper in your agent:
hf papers read 2611.04169 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 1
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper