How many context tokens does a language model actually use? Measuring effective attention set size
Timur Mudarisov · hf · 2026-10-01
- Question: How many context tokens does an LM actually use? Without retraining, the authors retain only the highest-attention tokens per head/layer/query and measure NLL increase to estimate the effective attention set size needed to stay within a loss tolerance.
- Findings: Relatively small selected sets keep NLL close to the full-attention baseline (size varies across models); attention-based selection substantially beats random selection, and selected sets show geometric structure — though geometric separation alone doesn't preserve loss.
- Context effects: Extending context while evaluating the same targets increases the required set size, but its fraction of context decreases; background text pushes a fixed supporting fact down the attention ranking and reduces its attention mass.
- Aggregation matters: Renormalizing retained weights substantially shrinks the required set size. Conditional theoretical models explain how competition and attention-mass retention can grow set sizes without more distinct information to retrieve.
More from Research
- Whole-human-kidney blood flow imaging achieved with multi-lens ultrasound arrays + 3D ULM — Promptmethus · 2026-11-29
- GPU Power-Current Sensor Spots Hidden AI Training in 3 Seconds — bigdata · 2026-11-29
- Agentic GraphRAG unifies enterprise knowledge and agent memory in one traversable graph — vm324234 · 2026-11-29
- Same 80% accuracy, Brier scores 0.1961 vs 0.1600: a tiny demo of probability quality — Heavy-Confidence1826 · 2026-11-29
- Riemann Hypothesis proof condensed to 117 pages in paper rebuilt with Claude's help — birchlse · 2026-11-29
- AI agents solve 909 open math problems in 2 days on 18-year-old's Left to Solve site — julianibarz · 2026-11-29