Self-Compacting Language Model Agents
On the map: LLM agents and tool use → Agent memory systems
Abstract (arXiv)
Long agent traces composed of chains of thought and tool calls accumulate stale content that anchor subsequent generations, and eventually outgrow the context window. Existing scaffolds mitigate it with fixed-interval compaction triggered at a token threshold. Such triggers pay no heed to trajectory structure, risking discard of partial results mid-derivation or mid-search. We propose SelfCompact, a scaffold that allows the model itself to decide when and how to compact. Specifically, it pairs two inference-time elements: (i) a compaction tool the model invokes to summarize the accumulated context, and (ii) a lightweight rubric specifying when to fire (a sub-task has resolved, or the trajectory is converging) and when to suppress (mid-derivation, or when stuck). Both are needed. The tool alone is unevenly used across open-weight models, often invoked at unhelpful moments or not at all; the rubric alone cannot act. Together, they elicit effective adaptive compaction without any fine-tuning or external supervision. We present empirical results on six benchmarks (competitive math and agentic search) and seven models. Our results show that SelfCompact matches or exceeds fixed-interval summarization at a fraction of the token cost, improving over a no-summarization baseline by up to 18.1 points on math and 5-9 points on agentic search at 30-70% lower per-question cost. Our results expose a meta-cognitive gap: although unprompted models cannot reliably tell when their own context is rotting, a lightweight rubric closes this gap, reframing when to compact as a capability that scaffolds can supply without training.
Key facts. Cited by 11 papers in the map (data through 14 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 33 of its 44 references that are in the map. First posted on arXiv 22 Jun 2026.
Builds on
33 of 44 references.
Closest ancestors · 4
Same direction, newest first
- 2025FoldAct: Efficient and Stable Context Folding for Long-Horizon Search Agents28 Dec
- 2025AgentFold: Long-Horizon Web Agents with Proactive Context Management28 Oct
- 2025Scaling Long-Horizon LLM Agent via Context-Folding13 Oct
- 2025ReSum: Unlocking Long-Horizon Search Intelligence via Context Summarization16 Sep
Other references · 29
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
- 2024SnapKV: LLM Knows What You are Looking for Before Generationcited by 880
- 2025AlphaEvolve: A coding agent for scientific and algorithmic discoverycited by 867
- 2025BrowseComp: A Simple Yet Challenging Benchmark for Browsing Agentscited by 647
- 2025LLMs Get Lost In Multi-Turn Conversationcited by 429
- 2025MathArena: Evaluating LLMs on Uncontaminated Math Competitionscited by 297
- 2025BrowseComp-Plus: A More Fair and Transparent Evaluation Benchmark of Deep-Research Agentcited by 200
- 2025SWE-rebench: An Automated Pipeline for Task Collection and Decontaminated Evaluation of Software Engineering Agentscited by 142
- 2025A Survey of Context Engineering for Large Language Modelscited by 126
- 2025WebExplorer: Explore and Evolve for Training Long-Horizon Web Agentscited by 92
17 more
- 2025Cartridges: Lightweight and general-purpose long context representations via self-studycited by 86
- 2026Emergent Introspective Awareness in Large Language Modelscited by 82
- 2025MiroThinker: Pushing the Performance Boundaries of Open-Source Research Agents via Model, Context, and Interactive Scalingcited by 81
- 2025Towards Robust Mathematical Reasoningcited by 73
- 2025InftyThink: Breaking the Length Limits of Long-Context Reasoning in Large Language Modelscited by 54
- 2025KeyDiff: Key Similarity-Based KV Cache Eviction for Long-Context LLM Inference in Resource-Constrained Environmentscited by 51
- 2026DeepSearchQA: Bridging the Comprehensiveness Gap for Deep Research Agentscited by 50
- 2026Fast KV Compaction via Attention Matchingcited by 31
- 2026MEMENTO: Teaching LLMs to Manage Their Own Contextcited by 18
- 2026Agentic Aggregation for Parallel Scaling of Long-Horizon Agentic Taskscited by 18
- 2026Reasoning Cache: Continual Improvement Over Long Horizons via Short-Horizon RLcited by 12
- 2026Accordion-Thinking: Self-Regulated Step Summaries for Efficient and Readable LLM Reasoningcited by 6
- 2025Breadcrumbs Reasoning: Memory-Efficient Reasoning with Compression Beaconscited by 5
- 2025MOTIF: Modular Thinking via Reinforcement Fine-tuning in LLMscited by 4
- 2026Contextual Drag: How Errors in the Context Affect LLM Reasoningcited by 4
- 2026LightThinker++: From Reasoning Compression to Memory Managementcited by 4
- 2026Rethinking LoRA Memory Through the Lens of KV Cache Compressioncited by 2
Built on by
Citing papers per year: 2026: 11.
11 papers.
- 2026Prefix Sliding for efficient test-time scalingcited by 2
- 2026Memory Control Signals Emerge Before Action in Long Horizon Agentscited by 1
- 2026StateComp: Learning When to Compress History in Long Horizon Agentscited by 1
- 2026KV-streams for Efficient Compaction in Agentic Reinforcement Learningcited by 1
- 2026Context Language Modelscited by 1
- 2026CliffCompaction: Cost-Efficient Compaction for Long-Horizon Coding Agentscited by 0
- 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agentscited by 0
- 2026Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compressioncited by 0
- 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compressioncited by 0
- 2026Continuous Context Managementcited by 0
- 2026AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agentscited by 0
- 2026AutoCompact: Learning When to Compact Context in Long-Horizon Coding Agents1 Oct 2026
- 2026Context Language Models29 Sep 2026
- 2026KV-streams for Efficient Compaction in Agentic Reinforcement Learning28 Sep 2026
- 2026Continuous Context Management28 Sep 2026
- 2026When Can Agents Forget Their Reasoning? ICLR for Long-Horizon Agent Context Compression24 Sep 2026
- 2026Stable Geometry with Divergent Task Evidence for Efficient Long-Horizon Agent Compression23 Sep 2026
- 2026StateComp: Learning When to Compress History in Long Horizon Agents23 Sep 2026
- 2026Memory Control Signals Emerge Before Action in Long Horizon Agents23 Sep 2026
- 2026DRSR: Learning Set-Level Deletion Risk for Efficient Long-Horizon Agents23 Sep 2026
- 2026CliffCompaction: Cost-Efficient Compaction for Long-Horizon Coding Agents22 Sep 2026
- 2026Prefix Sliding for efficient test-time scaling26 Aug 2026
Similar, not cited
Close in wording, no citation either way
- 2026The Compaction Cliff in Long-Running AI Agent Memory
- 2026Self-Consolidation for Self-Evolving Agents
- 2026Prune the Summary, Not the History: Source-Judged Compaction for Long-Horizon Agents
- 2025Self-Correcting Large Language Models: Generation vs. Multiple Choice
- 2026Self-GC: Self-Governing Context for Long-Horizon LLM Agents
- 2026GenericAgent: A Token-Efficient Self-Evolving LLM Agent via Contextual Information Density Maximization (V1.0)
- 2026Can We Break LLMs Out of Self-Loops? Fine-Grained Reasoning Control with Activation Steering
- 2025ACON: Optimizing Context Compression for Long-horizon LLM Agents