Knowing When to Stop: Efficient Context Processing via Latent Sufficiency Signals
Organizations: Duke · Rice · JHU · UC Davis
Abstract
Large language models (LLMs) process entire input contexts indiscriminately, which is inefficient when the information required to answer a query is localized within the context. We present dynamic context cutoff, a novel method enabling LLMs to self-terminate processing upon acquiring sufficient task-relevant information. Through analysis of model internals, we discover that specific attention heads inherently encode "sufficiency signals" -- detectable through lightweight classifiers -- that predict when critical information has been processed. This reveals a new efficiency paradigm: models' internal understanding naturally dictates processing needs rather than external compression heuristics. Comprehensive experiments across six QA datasets (up to 40K tokens) with three model families (LLaMA/Qwen/Mistral, 1B-70B) demonstrate 3.4% accuracy improvement while achieving 1.33x token reduction on average. Furthermore, our method demonstrates superior performance compared to other context efficiency methods at equivalent token reduction rates. Additionally, we observe an emergent scaling phenomenon: while smaller models require probing for sufficiency detection, larger models exhibit intrinsic self-assessment capabilities through prompting.
Figures & tables
| Method | LLaMA3.2-1B | Ministral-8B | Qwen2.5-14B | LLaMA3.3-70B | Avg. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Multi | Single | Avg | Multi | Single | Avg | Multi | Single | Avg | Multi | Single | Avg | Multi | Single | Total | |
| Full Context | 10.4 | 17.9 | 14.2 | 29.6 | 44.8 | 37.2 | 30.4 | 57.6 | 44.0 | 37.1 | 75.0 | 56.1 | 26.6 | 48.7 | 37.9 |
| BM25 | 11.2 | 16.2 | 13.7 | 20.8 | 27.5 | 35.6 | 25.8 | 40.8 | 36.5 | 21.7 | 37.1 | 41.7 | 19.9 | 30.4 | 31.9 |
| SBERT | 10.2 | 17.8 | 14.0 | 19.6 | 37.5 | 35.2 | 26.3 | 51.3 | 42.3 | 22.1 | 41.7 | 40.8 | 19.6 | 37.1 | 33.1 |
| LLMlingua | 6.3 | 18.3 | 12.3 | 22.1 | 41.7 | 31.9 | 24.2 | 52.5 | 38.3 | 35.8 | 74.1 | 55.0 | 22.1 | 46.7 | 34.4 |
| LongLLMlingua | 6.7 | 20.0 | 13.3 | 22.1 | 41.7 | 31.9 | 26.3 | 55.8 | 41.1 | 35.4 | 71.7 | 53.6 | 22.6 | 47.3 | 35.0 |
| Method | LLaMA3.2-1B | Ministral-8B | Qwen2.5-14B | LLaMA3.3-70B | Avg. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Multi | Single | Avg | Multi | Single | Avg | Multi | Single | Avg | Multi | Single | Avg | Multi | Single | Total | |
| Full Context | 5.0 | 10.4 | 7.7 | 18.3 | 38.8 | 28.5 | 29.9 | 40.0 | 35.0 | 29.3 | 70.8 | 50.0 | 20.6 | 40.0 | 30.3 |
| BM25 | 5.7 | 12.2 | 8.9 | 20.9 | 38.7 | 29.8 | 30.2 | 39.2 | 34.7 | 28.7 | 68.7 | 48.7 | 21.3 | 40.0 | 30.5 |
| SBERT | 5.6 | 12.5 | 9.1 | 20.2 | 37.7 | 29.4 | 30.0 | 38.9 | 34.4 | 27.7 | 68.8 | 48.3 | 21.1 | 39.5 | 30.3 |
| LLMlingua | 3.8 | 12.1 | 7.9 | 17.1 | 35.8 | 26.5 | 27.1 | 41.8 | 34.5 | 23.3 | 65.4 | 44.4 | 17.8 | 38.8 | 28.3 |
| LongLLMlingua | 3.3 | 12.1 | 7.7 | 15.0 | 37.1 | 26.0 | 28.0 | 40.1 | 34.1 | 27.5 | 67.9 | 47.7 | 18.5 | 39.3 | 28.9 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Statistic | Single-hop | Multi-hop | ||
|---|---|---|---|---|
| Code | SQuAD & Natural Questions | KV | HotpotQA & MUSIQUE | |
| Token Count | ||||
| Mean | 22,758.96 | 22,653.68 | 22,494.19 | 24,970.78 |
| Median | 22,739.50 | 22,584.00 | 22,619.00 | 25,168.50 |
| Std Dev | 7,299.95 | 6,758.97 | 7,290.87 | 7,159.93 |
| Max | 35,465 | 36,888 | 35,426 | 40,622 |
| Statistic | Single-hop | Multi-hop | ||
|---|---|---|---|---|
| Code | SQuAD & Natural Questions | KV | HotpotQA & MUSIQUE | |
| Token Count | ||||
| Mean | 2951.23 | 1678.98 | 2723.65 | 1676.15 |
| Median | 2910.50 | 694.50 | 2704.00 | 1735.00 |
| Std Dev | 562.14 | 1269.42 | 450.02 | 646.41 |
| Max | 4990 | 4993 | 4616 | 2815 |
| Task Type | Synthetic | Original | ||
|---|---|---|---|---|
| 1B | 8B | 1B | 8B | |
| Single-hop | 82.1 | 84.4 | 85.7 | 89.3 |
| Multi-hop | 87.1 | 89.6 | 90.9 | 90.3 |
| Overall F1 | 84.6 | 87.0 | 88.3 | 89.8 |
| P90 | 79.3 | 82.7 | 85.9 | 90.1 |
| Head Numbers | Classifier Numbers | |||||
|---|---|---|---|---|---|---|
| Metrics | 5 | 10 | 20 | 2 | 4 | 6 |
| F1-Score | 88.3 | 87.3 | 87.9 | 87.4 | 88.3 | 87.3 |
| R@90P | 85.9 | 78.0 | 78.0 | 77.6 | 85.9 | 78.0 |
| Acc. | 13.9 | 13.0 | 12.8 | 12.7 | 13.9 | 12.9 |
| Model | GPUs Used |
|---|---|
| LLaMA 3.2-1B | 2 × Nvidia A5000 |
| Mistral 8B | 4 × Nvidia A5000 |
| Qwen 2.5-14B | 4 × Nvidia A5000 |
| LLaMA 3.3-70B | 4 × Nvidia A6000 |
| Base Model | Trained & Evaluated on | Test Accuracy |
|---|---|---|
| Llama3.2-1b | Short Dataset | 0.8346 |
| Llama3.2-1b | Long Dataset | 0.7515 |
| Llama3.2-3b | Short Dataset | 0.8413 |
| Llama3.2-3b | Long Dataset | 0.7456 |
LLM Context Management
Large language model context management studies how to select, compress, retrieve, and organize information within bounded model inputs.
See all 248 papers