Learning Agent-Compatible Context Management for Long-Horizon Tasks

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yi, Lu, Lei, Runlin, Yao, Liuyi, Xie, Yuexiang, Li, Yuyang, Zhang, Wenhao, Wei, Zhewei, Li, Yaliang, Nie, Jian-Yun
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911731042746368
author Yi, Lu
Lei, Runlin
Yao, Liuyi
Xie, Yuexiang
Li, Yuyang
Zhang, Wenhao
Wei, Zhewei
Li, Yaliang
Nie, Jian-Yun
author_facet Yi, Lu
Lei, Runlin
Yao, Liuyi
Xie, Yuexiang
Li, Yuyang
Zhang, Wenhao
Wei, Zhewei
Li, Yaliang
Nie, Jian-Yun
contents LLM agents increasingly face long-horizon tasks such as web search and deep research in real-world applications, where accumulated context can cause long-context degradation and reasoning failures. Prior work mitigates this through context management with agent-side context control or fixed strategies such as summarization, which require training the agent itself for adaptation - making it impractical for closed-source agents and ignoring that different agents may require different strategies. We introduce Adaptive Context Management (AdaCoM), which trains an external LLM to manage the context of a frozen agent through flexible modification actions and end-to-end reinforcement learning. Across diverse agents on web search and deep research benchmarks, AdaCoM substantially improves performance by preserving task constraints and progress while pruning stale content. The learned strategies reveal a Fidelity-Reliability Trade-off: agents with higher vanilla ReAct performance benefit from higher-fidelity context preservation, whereas lower-performing agents require more aggressive compression to stay within a reliable reasoning regime. Transfer experiments show that AdaCoM generalizes most effectively across agents with similar capability (measured by vanilla ReAct performance), suggesting a practical path toward reusable context managers for agent systems.
format Preprint
id arxiv_https___arxiv_org_abs_2605_30785
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Learning Agent-Compatible Context Management for Long-Horizon Tasks
Yi, Lu
Lei, Runlin
Yao, Liuyi
Xie, Yuexiang
Li, Yuyang
Zhang, Wenhao
Wei, Zhewei
Li, Yaliang
Nie, Jian-Yun
Artificial Intelligence
LLM agents increasingly face long-horizon tasks such as web search and deep research in real-world applications, where accumulated context can cause long-context degradation and reasoning failures. Prior work mitigates this through context management with agent-side context control or fixed strategies such as summarization, which require training the agent itself for adaptation - making it impractical for closed-source agents and ignoring that different agents may require different strategies. We introduce Adaptive Context Management (AdaCoM), which trains an external LLM to manage the context of a frozen agent through flexible modification actions and end-to-end reinforcement learning. Across diverse agents on web search and deep research benchmarks, AdaCoM substantially improves performance by preserving task constraints and progress while pruning stale content. The learned strategies reveal a Fidelity-Reliability Trade-off: agents with higher vanilla ReAct performance benefit from higher-fidelity context preservation, whereas lower-performing agents require more aggressive compression to stay within a reliable reasoning regime. Transfer experiments show that AdaCoM generalizes most effectively across agents with similar capability (measured by vanilla ReAct performance), suggesting a practical path toward reusable context managers for agent systems.
title Learning Agent-Compatible Context Management for Long-Horizon Tasks
topic Artificial Intelligence
url https://arxiv.org/abs/2605.30785