DTOC: Dynamic Tool Output Compression for Adaptive Context Management in AI Agents
cs.AI, cs.CL, cs.MA
Submitted: 2026-08-06
Updated: 2026-08-06
Comments: Accepted for 29th International Conference on Discovery Science, October 5-9, 2026, Mainz, Germany
Code: https://github.com/chaturvediabhay24/opencode
License: http://creativecommons.org/licenses/by-nc-nd/4.0/
The gist: As agent capabilities have grown, practical limitations increasingly stem from constrained context windows rather than model capacity.
Terminology
Abstract
As agent capabilities have grown, practical limitations increasingly stem from constrained context windows rather than model capacity. Common strategies, such as truncation, heuristic aging, and lossy summarization, may discard useful information or introduce hallucination risk. To address these challenges, we propose Dynamic Tool Output Compression (DTOC), a framework for scalable context management in LLM-based agents that models context updates as explicit and reversible operations within the agent reasoning loop. DTOC retains full tool outputs in external memory while inserting compact placeholders into the active context, enabling selective reconstruction when needed. We formalize the DTOC mechanism, integrate it into a ReAct-style agent architecture, and provide a production-oriented implementation supporting on-demand restoration of compressed outputs. Experiments on DeepSWE reveal model-dependent effects: for responsive models (Sonnet 4.6, GPT-5.4), DTOC reduces input tokens (10.3 and 12.7%) and agent steps (2.4 and 32.3%), while increasing solve rates (2.5 and 1.5 times higher) and lowering cost per solved task (3 and 3.5 times lower cost per solved task). For the other models results are more mixed, with GPT-5.5 doubling solve rate and halving cost, but no impact on solve rate and negative impact on cost for the other models. Ablation results show reversibility is critical: disable-only compression variants degraded performance, while full DTOC recovered baseline accuracy at substantially lower context cost. These findings indicate that explicit, reversible context management can improve the efficiency of long-horizon agent reasoning without degrading task performance.
Sources
- Context Engineering 2.0: The Context of Context Engineering
- DeepSWE: Measuring Frontier Coding Agents on Original, Long-Horizon Engineering Tasks
- A Survey of Context Engineering for Large Language Models
- From Autonomous Agents to Integrated Systems, A New Paradigm: Orchestrated Distributed Intelligence
- LongCat-Flash-Thinking-2601 Technical Report
- ReAct: Synergizing Reasoning and Acting in Language Models
- Agentic Context Engineering: Evolving Contexts for Self-Improving Language Models
- Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems
- VSAL: A Vision Solver with Adaptive Layouts for Graph Property Detection