AIAny
Icon for item

ContextPilot: Teaching Agents for Proactive Context Management via Fine-grained RL

Trains LLM agents to proactively edit and manage their working context for long-horizon tasks using an expanded toolset (planning, long-term memory, soft offloading) and a fine-grained RL algorithm that identifies critical edits and assigns action-level credit. Improves accuracy while keeping contexts compact on long-context QA and deep search.

Introduction

Long-horizon agentic tasks steadily bloat an agent's working context, hurting inference cost and reasoning stability. ContextPilot reframes context management as a proactive decision-making problem: rather than only pruning or summarizing after the fact, the agent is taught to choose when and how to edit its working context using a richer toolset and an RL algorithm tailored to assign credit at the action level.

Key Findings
  • Expanded toolset with planning, long-term memory, and soft offloading — so what? Enables agents to preserve relevant progress and defer low-utility details without losing provenance, yielding smaller working contexts with fewer reasoning regressions.
  • Critical-edit identification via context and entropy variation — so what? Focuses exploration budget on edits that meaningfully change downstream trajectories, making offline branch sampling more sample-efficient than uniform exploration.
  • Fine-grained action-level advantage estimation from branched rollouts — so what? Replaces coarse trajectory-level rewards with action-specific signals, producing more stable policy learning and better editing policies.
  • Empirical gains on long-context QA and deep search — so what? Demonstrates consistent accuracy improvements across base models while reducing peak token usage, showing the approach is practical for extended agent sessions.
Who it's for and tradeoffs

Great fit if you build or evaluate LLM-based agents for multi-turn web search, research-style deep exploration, or other long-horizon workflows where preserving task state and reducing token pressure both matter. The method is also suitable when you can run branched rollouts for RL and accept additional training complexity.

Look elsewhere if you need an out-of-the-box, zero-training solution for closed-source agents, or if your environment prohibits the extra compute and engineering required for branched RL and fine-grained credit assignment.

Where it fits

ContextPilot sits between lightweight heuristics (summaries/pruning) and full model retraining for memory capabilities: it augments agent toolsets and trains a context-management policy so the agent itself learns when to offload, plan, or compress, rather than relying on fixed heuristics.

Method highlights

The paper combines (1) an expanded set of context-editing tools (planning, long-term memory writes/queries, soft offload) with (2) an RL procedure that (a) uses context- and entropy-based signals to identify candidate edit points for branching, (b) samples multiple branched continuations through each edit to estimate action-specific advantages, and (c) updates the context-management policy using these fine-grained returns. Code is provided alongside the paper.

Information

  • Websitearxiv.org
  • OrganizationsTsinghua University, Tencent Youtu Lab, Shanghai AI Lab
  • AuthorsZhuoshi Pan, Qizhi Pei, Junru Lu, Honglin Lin, H. Vicky Zhao, Di Yin, Xing Sun
  • Published date2026/08/28

More Items

Proposes VLAct, a representation-centric continued pre-training method for Vision-Language-Action models that preserves VLM priors and enforces cross-embodiment action semantics to turn limited robot trajectories into transferable visual-action representations; shows strong gains and sample efficiency on multiple VLA benchmarks using modest compute.

Proposes treating game development as a recursive data engine and introduces RLHEV (Reinforcement Learning with Human-Engine Verification) to combine dense engine checks (collision, physics, navigability) with human acceptance feedback, producing trajectory data and rewards for post-training world models.

Provides a real-scale 3D Hong Kong sandbox to evaluate whether multimodal LLM agents can turn local street-view perception into sustained spatial action, supporting closed-loop first-person interaction, an interactive map, and controlled tests of grounding, long-range navigation, and robustness.