Skip to content
AI.info

The Pulse

Apple Researchers Build Agents That Choose When to Compress Context

Apple and Johns Hopkins researchers introduced SelfCompact, a method that lets language-model agents choose when to summarize long working histories. Tests across seven open-weight models found gains on math and agentic-search benchmarks, w

Apple Researchers Build Agents That Choose When to Compress Context

AI.info Team · Written with AI ·

Apple’s machine-learning research site added a study in October on a practical problem for AI agents: their work histories can grow so long that old mistakes and irrelevant search results start steering later answers. The paper, first posted on arXiv on June 22, describes SelfCompact, a method that lets an agent decide when to summarize its own context instead of waiting for a fixed token limit. The researchers report better results than a no-compaction baseline on math and search tasks, while using fewer tokens for search.

SelfCompact waits for a reasoning boundary

Agents accumulate chains of reasoning, tool calls and observations as they work. A fixed schedule can summarize that history in the middle of a calculation or a search, discarding facts the model still needs. Waiting for the context window to fill can also leave stale or mistaken material in the prompt for too long.

SelfCompact combines a summarization tool with a short rubric that tells the model when to use it. The rubric favors moments when a subtask has been resolved or the reasoning is converging; it tells the model to hold off mid-derivation or when it is stuck. The same model evaluates the rubric and writes the summary, and the approach requires no fine-tuning or external supervisor.

“Together, they elicit effective adaptive compaction without any fine-tuning or external supervision.”

The authors of “Self-Compacting Language Model Agents”

At regular probe points, the agent assesses its trajectory. If the rubric indicates that a section of work is ready to close, the model summarizes the history and continues from the shorter version; otherwise, it keeps working with the existing context. The authors say the rubric matters: offering models a summarization tool by itself led to uneven behavior, including calls at unhelpful moments or no calls at all.

Seven models, six benchmarks

The team evaluated seven open-weight models across six benchmarks covering competition mathematics and agentic search. In the math tests, SelfCompact achieved the best score in 11 of 12 model-and-benchmark settings against fixed-interval summarization when token budgets were matched. Against a no-compaction baseline, the reported math improvement reached 18.1 percentage points on one benchmark and model combination.

In agentic search, the paper reports gains of 5 to 9 percentage points over the no-compaction baseline, with 30% to 70% lower per-question token cost. The tests covered BrowseComp, BrowseComp-Plus and DeepSearch QA. Those percentages describe the reported search experiments—not a universal reduction for every model or task.

Fixed-interval summarization remained a meaningful comparison: SelfCompact matched or exceeded it in the researchers’ overall assessment, but the individual math results included an exception. For Qwen3-30B-A3B on the February HMMT benchmark, fixed-interval summarization scored 1.1 points higher. The paper’s result is therefore a pattern across tested settings, not a claim that adaptive timing wins every trial.

The evidence stops short of frontier models

The study tests open-weight systems, including Qwen models for math and MiniMax-M2.5, GLM-4.7-Flash and MiMo-V2-Flash for search. Its authors say they have not evaluated proprietary frontier models, which may be better at detecting when their own context has become unhelpful without a rubric. They describe the method as a training-free scaffold for addressing the gap where it exists, rather than evidence that every agent needs the same intervention.

The work shifts context management from a timer to a judgment the model makes with guidance. That distinction matters most when a long-running agent has just completed a useful subtask: in the paper’s tests, SelfCompact aims to preserve the resolved result while removing the surrounding history that no longer helps.

Sources

Explore

More articles