From the source
Authors Tianjian Li†, Jingyu Zhang†, William Jurayj†, Xi Wang†, Chuanyang Jin†, Mehrdad Farajtabar, Eric Nalisnick†, Daniel Khashabi† Long agent traces composed of chains of thought and tool calls accumulate stale content that anchor subsequent generations, and eventually outgrow the context window.
Existing scaffolds mitigate it with fixed-interval compaction triggered at a token threshold.
Such triggers pay no heed to trajectory structure, risking discard of partial results mid-derivation or mid-search.
We propose SELFCOMPACT, a scaffold that allows the model itself to decide when and how to compact.
Specifically, it pairs two inference-time elements: (i) a compaction tool the model invokes to summarize the accumulated context, and (ii) a lightweight rubric specifying when to fire (a sub-task has resolved, or the trajectory is converging) and when to suppress (mid-derivation, or when stuck).
Both are needed.
The tool alone is unevenly used across open-weight models, often invoked at unhelpful moments or not at all; the rubric alone cannot act.
Together, they elicit effective adaptive compaction without any fine-tuning or external supervision.
…