arXiv 2606.23525 introduces SelfCompact, a context-compression framework for LLM Agents that decides "when to compress" automatically, removing the burden from the Agent itself. The result: +18.1 average points across 6 long-horizon Agent benchmarks, with 30-70% token cost reduction.
The problem: LLM Agents that handle long-horizon tasks (e.g., 100+ turns of conversation) face a context-window overflow. The Agent must decide "when to compress" — too early, and you lose important information; too late, and you run out of context. This "when to compress" decision is itself a hard problem, and existing Agents either compress too aggressively (losing information) or too late (overflowing context).
SelfCompact's fix: a separate "compression controller" (a small 1.5B model) that monitors the Agent's context in real time and decides when to compress. The controller is trained with a reinforcement signal: compress when it would improve downstream task performance, don't compress when it would hurt. The training data is generated by running Agents on long-horizon tasks and observing the optimal compression points.
The result: SelfCompact improves Agent accuracy by 18.1 points on average across 6 benchmarks (WebShop, ALFWorld, ToolBench, etc.), while reducing token consumption by 30-70%. The biggest improvement is on tasks where the Agent must remember specific details from many turns ago.
The bigger takeaway: "compression as a separate module" is the right architecture. Most current Agents handle compression inline, which is a distraction from the main task. SelfCompact's separate controller is a cleaner design, and the RL-trained compression policy is significantly more accurate than heuristic-based compression. For the industry, this means the next generation of Agent frameworks will have "compression" as a first-class, separately-trained component.