mlsanityData to 7 Oct 2026

On-Demand Attention: Language Models Know When to Recall

arXiv 2609.20734 ↗First posted 17 Sep 2026cs.CLcited by 0

On the map: LLM agents and tool use → Agent memory systems

Abstract (arXiv)

Reasoning and agentic workloads increasingly demand efficient long-context inference. Yet full-attention decoding reads the growing history at every step, although the benefit of global access varies across prediction positions. We find that, before global attention is computed for the current step, the decoding states available after local computation in frozen pretrained models already contain information predictive of its benefit over local attention. Building on this finding, we introduce On-Demand Attention (ODA), a local-first decoding method: after local computation, a lightweight recall head decides whether to recompute the current step with global attention. ODA trains only the recall head with modest data and compute budgets, leaving pretrained weights unchanged and retaining the complete historical KV cache so that information skipped at one step remains available for later access. Experiments across model scales and families, including hybrid attention backbones, show that ODA recovers most of the performance lost under local attention while substantially reducing the frequency of global attention. Controlled long-context measurements in vLLM further show that GPU-side conditional execution translates fewer global reads into practical decoding speedups over full attention. These findings show that pretrained decoding states can support both token prediction and decisions about accessing distant information, allowing models to allocate global computation as needed during decoding.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 43 of its 51 references that are in the map. First posted on arXiv 17 Sep 2026.

Builds on

43 of 51 references.

Closest ancestors · 1

Same direction, newest first

  1. 2024InfLLM: Training-Free Long-Context Extrapolation for LLMs with an Efficient Context Memory7 Feb

Other references · 42

  1. 2017Attention Is All You Needcited by 59,932
  2. 2025Qwen3 Technical Reportcited by 8,195
  3. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,767
  4. 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
  5. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,115
  6. 2023Self-RAG: Learning to Retrieve, Generate, and Critique through Self-Reflectioncited by 1,800
  7. 2020GLU Variants Improve Transformercited by 1,724
  8. 2022Fast Inference from Transformers via Speculative Decodingcited by 1,615
  9. 2019Root Mean Square Layer Normalizationcited by 1,425
  10. 2023LongBench: A Bilingual, Multitask Benchmark for Long Context Understandingcited by 1,378
  11. 2024RULER: What's the Real Context Size of Your Long-Context Language Models?cited by 1,270
  12. 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 848
30 more
  1. 2023YaRN: Efficient Context Window Extension of Large Language Modelscited by 584
  2. 2023Active Retrieval Augmented Generationcited by 506
  3. 2024Quest: Query-Aware Sparsity for Efficient Long-Context LLM Inferencecited by 487
  4. 2024Gated Delta Networks: Improving Mamba2 with Delta Rulecited by 483
  5. 2024LongBench v2: Towards Deeper Understanding and Reasoning on Realistic Long-context Multitaskscited by 367
  6. 2022Confident Adaptive Language Modelingcited by 297
  7. 2024DuoAttention: Efficient Long-Context LLM Inference with Retrieval and Streaming Headscited by 283
  8. 2023LooGLE: Can Long-Context Language Models Understand Long Contexts?cited by 200
  9. 2026Gemma 4 Technical Reportcited by 187
  10. 2023ZeroSCROLLS: A Zero-Shot Benchmark for Long Text Understandingcited by 175
  11. 2024Language Model Cascades: Token-level uncertainty and beyondcited by 115
  12. 2024RetrievalAttention: Accelerating Long-Context LLM Inference via Vector Retrievalcited by 114
  13. 2023CoLT5: Faster Long-Range Transformers with Conditional Computationcited by 84
  14. 2024What is Wrong with Perplexity for Long-context Language Modeling?cited by 68
  15. 2024Faster Cascades via Speculative Decodingcited by 38
  16. 2024Probing-RAG: Self-Probing to Guide Language Models in Selective Document Retrievalcited by 28
  17. 2025SeerAttention-R: Sparse Attention Adaptation for Long Reasoningcited by 28
  18. 2025LongSpec: Long-Context Lossless Speculative Decoding with Efficient Drafting and Verificationcited by 19
  19. 2024RefreshKV: Updating Small KV Cache During Long-form Generationcited by 11
  20. 2024Self-Selected Attention Span for Accelerating Large Language Model Inferencecited by 4
  21. 2025Knowing When to Stop: Efficient Context Processing via Latent Sufficiency Signalscited by 4
  22. 2026Switch Attention: Towards Dynamic and Fine-grained Hybrid Transformerscited by 4
  23. 2026SpotAttention: Plug-In Block-Sparse Routing for Pretrained Long-Context Transformerscited by 4
  24. 2026Learning When to Attend: Conditional Memory Access for Long-Context LLMscited by 3
  25. 2025Short-Context Dominance: How Much Local Context Natural Language Actually Needs?cited by 1
  26. 2025Learning When Not to Attend Globallycited by 1
  27. 2026Predicting the Benefit of Retrieval Augmentation in Open-Domain Question Answeringcited by 1
  28. 2026NLL-Guided Full-Attention Layer Selection for Training-Free Sliding-Window Adaptationcited by 1
  29. 2026LoGo: Token-Level Dynamic Local-Global Attentioncited by 1
  30. 2026Language Models Can Control Their Own Attentioncited by 1

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024Simple linear attention language models balance the recall-throughput tradeoff
  2. 2026MKA: Memory-Keyed Attention for Efficient Long-Context Reasoning
  3. 2025Training-free Context-adaptive Attention for Efficient Long Context Modeling
  4. 2026Memory Control Signals Emerge Before Action in Long Horizon Agents
  5. 2026LoKiFormer: Locality-aware Attention with Decoupled Knowledge Memory for Efficient Large Language Model Pretraining
  6. 2026DySCO: Dynamic Attention-Scaling Decoding for Long-Context Language Models
  7. 2026Attention Routing Stabilizes Early: Working-Set Inference for Recurrent Language Models
  8. 2026Slow-Fast Inference: Training-Free Inference Acceleration via Within-Sentence Support Stability