Manuscript Offprint

arXiv:2610.08722

Does an Agent's History Tell You When Compaction Will Hurt? A Modest, Bounded Effect on the TRACE Paired-Replay Corpus

Egor Pakhomov, Erik Nijkamp

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Many long-horizon agents compact their context on a global rule, usually a token budget, blind to what the agent was doing. We ask whether the agent's recent behaviour predicts when a compaction will hurt. TRACE's public corpus of 590 harness-triggered AppWorld compaction boundaries replays each boundary from a re-executed prefix state under the pre-compaction context and under the summary, and records the burden of the next actions: calls that error or repeat a call already made. We find that pre-boundary history predicts post-compaction harm only weakly. An internally prespecified contrast by prefix placement is a wide null, and the naive "has-written" label behind it turns out to measure trajectory phase. The best extension-protocol trigger reaches held-out AUROC 0.66 (0.64 on the replicate's own label) against a same-boundary replicate of 0.72; the best frozen, interpretable trigger avoids 21% of harmful (positive-burden) boundaries while keeping 84% of compaction opportunities, and exceeds the random-rule expectation on count but not on burden mass (a post hoc comparison). Whether the best trigger beats a token-budget rule at matched retention cannot be evaluated on the release. We state what corpora should ship to answer it.

1 Introduction

Many long-horizon agent harnesses compact [1–5]: past a budget, the raw history is replaced by a generated summary [6], and the decision of when is a global rule, blind to what the agent was doing (in the coding-agent scaffolds surveyed by Rombaut [7], typically a token threshold or a structural cap)—the natural next step is to defer compaction where the recent history says it is about to hurt. Agent-invoked compression [8], RL-learned context editing [9] and learned folding [10] condition the timing on the history but are judged by task success, which cannot say whether a given compaction hurt; that needs a counterfactual outcome per boundary.

TRACE [11, 12] supplies it (§2). The paired design, the burden channels, the first/later stratification and the thesis that compaction should be judged at the boundary by the agent's next actions, not only by task success (process-level evaluation [13]; failure attribution [14]; summaries can lengthen trajectories by masking failure signals [15]) are the source's [11, 12]. Behavioural interpretation of agents mostly labels completed transcripts [16]; a paired replay is the intervention such a science calls for [17]. We use the released cohort as is and ask: does what the agent did before a boundary predict whether compaction there will hurt?

Contributions. (i) An internally prespecified placement test with a post hoc diagnostic of what a naive write label measures (§3). (ii) A task-held-out risk ranking of boundaries and an opportunity-retention frontier against global ON/OFF and the random-rule expectation at matched retention (retention: the share of opportunities a rule still allows; the random-rule expectation: what a uniformly random rule achieves), not reported by the source [11] (§4). (iii) A benchmark of two fixed learners against a split-half replicate yardstick under a frozen extension protocol (post-freeze additions 40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: Interpreting Agent Behavior (IAB).

dated in App. A). The placement contrast is a wide null. The seven Table 2 policies sit two to seven points above the random-rule expectation on count (only the stump's interval crosses zero; the two-feature logistic does so too when refit under stem-grouped folds, App. F, Table 16) and zero to eleven points on burden mass, clear of zero under replay resampling for three of the seven (App. E, F). Held-out AUROC [18] is 0.404–0.635 across Table 11's original-label cells for the interpretable policies (0.55–0.62 on the primary target) and 0.66 for the boosted ones, against 0.72 for a replicate of the same boundary. Interpretability lessons: the phase proxy (§3) and first-compaction fragility (§5).

References (26)