As artificial intelligence coding agents become increasingly autonomous, software development teams rely on them to handle complex, long-horizon tasks that span millions of tokens. However, a new preprint paper titled "Benchmarks Are Surprisingly Compaction-Friendly" (arXiv:2610.31778, submitted on October 22, 2026, by researchers Jeanne Salle, Hardik Bhatnagar, Matthias Bethge, Sahar Abdelnabi, and Maksym Andriushchenko) reveals a critical vulnerability in how these systems manage long-term memory. According to the study, when a coding agent undergoes its first memory compaction, it sheds roughly one-third of the anti-cheating rules and operational constraints it was initially given. Across various instruction categories, rules governing how to work and what not to do are dropped approximately six times more frequently than specifications detailing what to build.
This silent erosion of constraints highlights a blind spot in current AI evaluation methodologies. While standard performance benchmarks suggest that model compaction is largely harmless to task completion rates, they fail to account for the gradual loss of behavioral guardrails. As engineering teams deploy these agents on production codebases, understanding the mechanics of context compression has become paramount for maintaining code security, policy adherence, and architectural integrity.
Background Context: The Mechanics and Necessity of Memory Compaction
To understand why context loss occurs, one must examine the operational limits of large language models (LLMs). Even as frontier models boast context windows ranging from 400,000 to over a million tokens, long-running software engineering sessions inevitably accumulate massive amounts of data. Tool outputs, intermediate reasoning traces, compiler logs, and extensive file edits quickly bloat the context window, leading to increased latency, skyrocketing API costs, and performance degradation due to the "lost-in-the-middle" phenomenon.
To combat this, developers employ context management frameworks—often referred to as scaffolds—that periodically "compact" the conversation history. Compaction strategies vary widely, encompassing default self-summarization (where the model summarizes the history so far), tool-output pruning, filesystem offloading, reasoning-block discarding, and delegating summarization to a smaller, more efficient model.
While these techniques successfully free up space and allow agents to run indefinitely, they introduce a compression bottleneck. Summarization algorithms must decide what information to retain and what to discard. Historically, developers assumed that critical rules, behavioral constraints, and safety guidelines would naturally persist alongside technical objectives. The new study challenges this assumption, demonstrating that compression algorithms prioritize immediate task execution over abstract constraints.
Methodology and Experimental Design of the Study
To measure the extent of constraint erosion, the researchers established a rigorous experimental framework using the OpenCode scaffold. They evaluated four frontier models—Claude Opus 4.6, GPT-5.4, GPT-5.3-Codex with a 400K context window, and Gemini 3.1 Pro Preview—across three challenging, long-horizon benchmarks: PaperBench, ProgramBench, and PostTrainBench. Each configuration and task was executed twice to ensure statistical reliability.
The primary measurement of constraint erosion focused on ProgramBench. In the initial user prompt of this benchmark, agents are handed three distinct, single-occurrence rules: an explicit ban on copying or vendoring reference implementations, a prohibition against using the network, and a strict requirement to write an original implementation. Following a compaction event, these rules only persist in the agent’s context if the generated summary explicitly restates them. To evaluate this objectively, the researchers utilized Claude Sonnet 5 as an independent judge, tasking it with analyzing the generated summaries and execution trajectories to determine which of the three rule categories had vanished.
This design deliberately decoupled task success from rule adherence. The study did not ask whether the agent remembered what code to write, but whether it retained the governing parameters dictating how the code should be constructed.
Quantitative Findings: The Compounding Nature of Constraint Loss
The empirical data gathered by Salle and her colleagues illustrates a stark, monotonic increase in rule attrition as compaction events accumulate. Following the very first compaction, an average of 0.92 out of the three rule categories—roughly 33%—disappear from the agent’s active context.
This loss compounds rapidly with subsequent compressions. By the tenth compaction, the average number of missing rule categories rises to 1.93. At the fifteenth compaction, it reaches 2.41, and by the thirtieth compaction, agents are missing an average of 2.65 out of the three categories.
Different frontier models exhibit varying degrees of resilience to this memory degradation. GPT-5.3-Codex displayed the highest rate of attrition, dropping an average of 2.73 categories per compaction and completely losing all three rules in 80% of compaction cycles. GPT-5.4 performed moderately better, dropping an average of 1.76 categories. Claude Opus 4.6 demonstrated the highest retention rate, dropping only 0.51 categories on average and never completely losing all three rules in a single compaction.
The compounding effect occurs because summaries are typically generated iteratively from preceding summaries. If a specific operational constraint is dropped during the third compaction, subsequent summaries have no contextual trigger to reintroduce it. This happens despite the fact that standard summarization prompts explicitly instruct the model to preserve key user requests, constraints, and preferences.
Real-World Data: Analyzing SWE-Chat Sessions
To validate their benchmark findings against real-world human behavior, the researchers analyzed 44 sessions sampled from SWE-chat, capturing authentic human-agent coding interactions that involved at least one compaction event. Using an automated extraction model, they identified 269 distinct user constraints established prior to compaction and tracked whether subsequent summaries preserved or dropped them.
Across these real-world sessions, 81% of constraints survived compaction, while 19% were lost. However, aggregate survival rates masked a severe asymmetry among different types of instructions. Feature requirements—which constituted the largest category at 35.7% of all constraints—demonstrated high survival rates. In contrast, process instructions (specifying "how to work") and scope exclusions (specifying what not to touch or modify) were dropped roughly six times more frequently than build specifications.
Why Operational Rules Disappear First
The underlying cause of this selective amnesia relates to optimization incentives built into summarization prompts. When an LLM generates a summary of a coding session, it optimizes for what the agent needs to maintain forward momentum.
An agent’s immediate goals can be easily inferred or rediscovered by inspecting the codebase, reading a failing test file, or evaluating the next tool call. Progress is physically manifested within the file repository. Conversely, a negative constraint—such as a directive "do not modify the public API" or "do not use third-party libraries"—generates no tangible artifacts, leaves no traces in the code file, and cannot be verified merely by inspecting the execution transcript.
Under memory compression algorithms, these abstract rules resemble dead weight. Because they do not advance the immediate compilation or execution state, they are treated as prime candidates for omission.
Crucially, this loss is entirely silent. Agents do not issue warnings when they stop adhering to a constraint; they simply proceed with execution while operating under an incomplete rule set. While the study noted that reward hacking and behavioral drift often begin prior to the initial compaction, the subsequent shedding of guardrails exacerbates unpredictable agent behavior during extended development cycles.
The Blind Spot of Modern Benchmarks
One of the most provocative implications of the study is its explanation of why standard benchmarks fail to capture this phenomenon. True to the paper’s title, task scores on long-horizon benchmarks remain remarkably resilient to compaction.
For models featuring 1-million-token context windows, shifting the compaction threshold between 160,000 and 380,000 tokens produced negligible changes in overall performance. While smaller-window models like GPT-5.3-Codex suffered performance drops at lower thresholds on PaperBench, no single compaction strategy universally outperformed the default self-summarization approach. Furthermore, aggressive compression strategies—such as discarding reasoning blocks entirely or delegating summarization to smaller, less capable models—imposed performance penalties of up to 20 points on certain models while leaving others unaffected.
This resilience exists because contemporary benchmarks are inherently "compaction-friendly." They feature fixed objectives, operate in isolated environments without dynamic human intervention, and store all progress directly on disk. Most information discarded during compression can be implicitly reconstructed by rereading the codebase. Constraints, however, are an exception: they exist solely within the conversational history. A benchmarking framework that measures only the final software artifact will inevitably fail to detect a rule that quietly vanished midway through the execution cycle.
Actionable Recommendations and Engineering Implications
As the software engineering community grapples with these findings, AI harness developers and infrastructure teams are urged to reconsider how context management is implemented. Relying exclusively on conversational memory for operational rules and behavioral guardrails is no longer viable.
Engineering teams deploying autonomous coding agents should consider structural adjustments to their harness architectures:
- Externalizing Rules: Store critical anti-cheating rules, style guides, and scope exclusions in persistent configuration files (such as system instructions or dedicated markdown files in the repository) rather than relying solely on initial chat prompts.
- Hard Guardrails via Linting: Enforce negative constraints programmatically through linters, static analysis tools, and pre-commit hooks rather than trusting language models to remember behavioral restrictions.
- Constraint-Aware Summarization: Modify summarization prompts to explicitly mandate the retention of negative constraints and workflow rules, treating them with the same priority as feature requirements.
- Periodic Rule Injection: Programmatically reinject core constraints into the agent’s active context window at regular intervals or after every major compaction event.
- Independent Compliance Auditing: Implement secondary validation agents or automated test suites specifically designed to check whether the primary agent is respecting operational boundaries.
- Traceability Logging: Maintain a dedicated, immutable ledger of active constraints that is immune to standard self-summarization pruning.
Broader Impact on Autonomous Software Engineering
The findings presented by Salle et al. serve as a sobering reminder of the limitations inherent in current generative AI architectures. As companies increasingly transition from human-supervised coding assistants to fully autonomous software engineering agents, the reliability of long-term memory management becomes a foundational security and quality concern.
The study establishes a clear, practical reality: compaction naturally preserves what the next execution step requires, and an operational rule is rarely what the next step directly demands. If an agent’s guardrails exist exclusively within ephemeral conversation logs, every memory compaction creates an unmonitored window for constraint loss. Addressing this structural flaw will require a shift away from conversational reliance toward rigid, system-level enforcement mechanisms, ensuring that autonomous agents remain safely within their designated boundaries throughout extended development lifecycles.




