ACE: Pluggable Adaptive Context Elasticizer across Agents

Ning Liao, Zihao Long, Xiaoxing Wang, Xue Yang, Yaoming Wang, Ziyuan Zhuang, Xunliang Cai, Rongxiang Weng, Junchi YanarXiv 2026

TL;DR

As Large Language Model (LLM) agents tackle increasingly complex, long-horizon tasks, their interaction histories quickly overwhelm fixed context windows. Traditional fixes like truncation or summarization are irreversible, permanently destroying details that might become crucial later. Adaptive Context Elasticizer (ACE) solves this by introducing a plug-and-play, two-layer architecture that dynamically toggles historical steps between raw, abstracted, or dropped states at every decision point, ensuring a compact yet lossless context.

What Problem Does This Paper Address?

When an LLM agent executes a multi-step task (e.g., using the ReAct paradigm), it logs its reasoning, actions, and environment observations into a trajectory. For complex tasks, this trajectory grows linearly, leading to a classic long-context bottleneck: information density drops, attention disperses, and reasoning quality degrades.

Existing context management techniques fall short due to two major flaws:

  1. Inflexibility: They treat all historical steps equally, ignoring the fact that a step's relevance changes as the task evolves.
  2. Irreversibility: Truncation (sliding windows) blindly discards distant history. Summarization permanently compresses it. If the agent later needs a specific URL, ID, or error message from an early step, that information is gone forever.

Methods

ACE addresses these flaws by decoupling the agent's actual prompt context from its raw message storage using a training-free, plug-and-play external wrapper.

Overview of the ACE architecture, showcasing the separation between the Message Maintenance Layer and the Context Orchestration Layer.

The framework consists of two primary layers:

  • Message Maintenance Layer: An immutable, lossless storage layer. For every historical step, it preserves both the raw message (reasoning, actions, observations) and a compressed abstraction generated by an auxiliary LLM. This abstraction highlights key outcomes and preserves critical tokens like numbers, URLs, and tool schemas.
  • Context Orchestration Layer: At each decision step $t$, an LLM-based elasticizer ($\mathcal{E}$) reviews the task description and the historical abstractions to assign an advisory "elastic type" to each past step:
  • Raw: The full, uncompressed step is included (crucial for steps containing fine-grained evidence).
  • Abs: Only the short abstraction is included (ideal for high-level transitional context).
  • Drop: The step is omitted entirely from the current prompt (for redundant or currently irrelevant steps).

Crucially, because the maintenance layer is immutable, these decisions are completely reversible. A step dropped at turn 5 can be fully restored to Raw at turn 10 if the agent's focus shifts back to it. To maintain immediate situational awareness, the very last step ($t-1$) is always kept as Raw.

Datasets

The authors evaluated ACE across several complex, long-horizon agent benchmarks:

  • GAIA: General AI Assistants benchmark, testing multimodal, multi-step web and file tasks.
  • HLE: Humanity's Last Exam, a dataset of highly advanced, multi-disciplinary reasoning problems.
  • WebShop: A simulated e-commerce environment for web navigation and purchasing.
  • WebWalkerQA, xBench-DS, and BrowseComp-ZH: Specialized benchmarks used to test specific agent framework adaptations (WebThinker and MiroFlow).

Key Insights and Ideas

  • Context Length is Fluctuating, Not Fixed: Unlike truncation or threshold-triggered summarization, which enforce a rigid token cap, ACE allows the context length to naturally wave up and down based on task complexity.
  • The Power of Hindsight: An agent cannot know what details will be important in the future. By allowing the context manager to "un-erase" and "un-summarize" past events, ACE mitigates the compounding errors common in long-horizon planning.
  • Architectural Agnosticism: Because ACE wraps around the agent's external loop, it requires zero modifications to the agent's internal state, action space, or underlying model weights. The authors successfully plugged it into four distinct agent topologies: single-agent (ReAct), main-auxiliary (DeepAgent), and multi-agent (WebThinker, MiroFlow).

Key Results

ACE consistently outperformed standard context management baselines across different backend models (GPT-4.1 and Gemini-3.1-flash-lite-preview).

Comparison of average per-step input token lengths across different context management strategies.
  • Baseline Superiority: On the GAIA benchmark using the ReAct framework, ACE improved the overall score from 38.8 to 42.4 (with GPT-4.1) and from 46.1 to 52.7 (with Gemini-3.1), outperforming both truncation and summarization baselines.
  • Framework Enhancement: When adapted to frameworks that already utilize native context management (like DeepAgent's memory fold mechanism), ACE provided a substantial boost, raising DeepAgent's GAIA score from 46.7 to 51.5 on Gemini.
  • Token Efficiency: As shown in the token length analysis, vanilla ReAct suffers from linear token growth. While truncation and summarization keep token counts low at the expense of accuracy, ACE manages to suppress token explosion while maintaining high information density through its elastic allocation.

Limitations and Future Work

The paper notes a few areas for improvement:

  • API Overhead: Running the elasticizer and generating abstractions requires additional LLM calls at each step. This introduces extra API latency and monetary costs, though the authors argue this is offset by the token savings in the main LLM prompts.
  • Dependence on Elasticizer Quality: The efficiency of context orchestration relies heavily on the capability of the elasticizer LLM to accurately predict which historical steps are relevant to the current task state. Future work could explore training smaller, specialized models to act as the elasticizer module.

Summary updated

BibTeX
@misc{liao2026ace,
  author = {Ning Liao and Zihao Long and Xiaoxing Wang and Xue Yang and Yaoming Wang and Ziyuan Zhuang and Xunliang Cai and Rongxiang Weng and Junchi Yan},
  title = {{ACE: Pluggable Adaptive Context Elasticizer across Agents}},
  year = {2026},
  eprint = {2606.31564},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.31564},
}
Figure