RECAP: Training Long-horizon LLM Agents with Context Compaction
Paper · https://arxiv.org/abs/2611.31258
arXiv:2611.31258v1 Announce Type: new Abstract: Context compaction enables large language model agents to tackle long-horizon tasks within limited context budgets by replacing interaction histories with compressed summaries. However, learning effective compaction jointly with the agent policy remains challenging, as summaries affect task success over many subsequent interactions. We introduce RECAP, a reinforcement learning (RL) framework based on the principle that a summary should preserve the behavior induced by the original interaction history. We formalize this principle with a behavior distortion objective that measures the divergence between the agent's subsequent behavior under compressed and original contexts. We show that the gradient of the distortion objective decomposes into two complementary learning signals: distortion-based reward for summary generation and self-distillation for subsequent actions. Experiments on Qwen3.5-4B show that RECAP consistently outperforms the task-reward-only RL baselines on both environments, leading to an absolute improvement of 4.6% and 4.3% on BrowseComp-plus and SWE-bench Verified, respectively. Ablations further highlight the value of jointly supervising summary generation and post-compaction behavior for RECAP.
First seen by Oriel on .
AI summary
RECAP is an RL framework for training long-horizon LLM agents to compact interaction histories while preserving behavior, outperforming task-reward-only baselines on two benchmarks.
- RECAP measures behavior distortion between actions under compressed and original contexts.
- The distortion gradient provides two learning signals: a reward for summary generation and self-distillation for subsequent actions.
- With Qwen3.5-4B, RECAP improves results by 4.6% on BrowseComp-plus and 4.3% on SWE-bench Verified.
- Ablations indicate that jointly supervising summary generation and post-compaction behavior contributes to RECAP's results.
#llm agents #reinforcement learning #context compaction
Generated by gpt-5.6-sol. Check the original for details.
Aliases
| Source | External ID | URL |
|---|---|---|
| arXiv AI Papers | oai:arXiv.org:2611.31258v1 | https://arxiv.org/abs/2611.31258 Read discussion |