{"slug": "recap-training-long-horizon-llm-agents-with-context-compaction", "title": "RECAP: Training Long-horizon LLM Agents with Context Compaction", "summary": "A new reinforcement learning framework called RECAP trains long-horizon LLM agents to compact context by rewarding summaries that preserve the behavior induced by the original interaction history, according to the arXiv paper 2611.31258v1. On Qwen3.5-4B, RECAP beat task-reward-only RL baselines by an absolute 4.6% on BrowseComp-plus and 4.3% on SWE-bench Verified. The authors formalize the approach with a behavior distortion objective whose gradient splits into a distortion-based reward for summary generation and self-distillation for subsequent actions, and ablations show joint supervision of summary generation and post-compaction behavior is what drives the gains.", "body_md": "arXiv:2611.31258v1 Announce Type: new \nAbstract: 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.", "url": "https://wpnews.pro/news/recap-training-long-horizon-llm-agents-with-context-compaction", "canonical_source": "https://www.machinebrief.com/news/recap-training-long-horizon-llm-agents-with-context-compacti-3ie7", "published_at": "2026-11-25 05:00:00+00:00", "updated_at": "2026-11-25 08:13:20.174751+00:00", "lang": "en", "topics": ["ai-agents", "large-language-models", "ai-research", "machine-learning"], "entities": ["RECAP", "Qwen3.5-4B", "BrowseComp-plus", "SWE-bench Verified", "arXiv"], "also_reported_by": [], "takeaway": "Training context compaction jointly with the agent policy via a behavior-distortion reward plus self-distillation lifted Qwen3.5-4B by 4.6 points on BrowseComp-plus and 4.3 points on SWE-bench Verified over task-reward-only RL.", "recommendation": {"advice": "When training long-horizon agents, supervise summary generation with a behavior-distortion reward alongside self-distillation on post-compaction actions instead of relying on task reward alone.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/recap-training-long-horizon-llm-agents-with-context-compaction", "markdown": "https://wpnews.pro/news/recap-training-long-horizon-llm-agents-with-context-compaction.md", "text": "https://wpnews.pro/news/recap-training-long-horizon-llm-agents-with-context-compaction.txt", "jsonld": "https://wpnews.pro/news/recap-training-long-horizon-llm-agents-with-context-compaction.jsonld"}}