🤖 AI Summary
This work addresses the high inference overhead in large language model–based coding agents caused by accumulating observational context during interaction, a challenge inadequately mitigated by existing compression methods that struggle to balance efficiency and performance. The authors propose CoACT, a novel approach that introduces the “Next Action Preservation” (NAP) principle as a criterion for effective compression, leveraging action consistency signals to guide the compression process. CoACT employs a teacher model to generate multiple candidate compressed observations and trains a lightweight compressor using a reward combining NAP fidelity and length reduction. Experimental results on SWE-bench Verified demonstrate that CoACT reduces total token consumption by 33.0% on average while maintaining task resolution rates comparable to those of the uncompressed baseline.
📝 Abstract
LLM-based coding agents solve software-engineering tasks through iterative interactions with development environments, where returned observations accumulate in the context and become a major source of inference cost. Observation compression reduces this cost by shortening observations before they are appended to the context. However, existing methods still exhibit an unsatisfactory efficiency-effectiveness trade-off, as they do not explicitly model how compression affects the agent's subsequent behavior. This paper proposes CoACT, an action-preserving observation compression method for coding agents. CoACT is built on next-action preservation (NAP), which requires a compressed observation to induce the same next action as the raw observation. By checking the agent's immediate next action, NAP provides a practical signal for whether a compression preserves the information needed for continued task solving. During training, a teacher model first generates multiple compressed candidates of each observation. CoACT then uses an action-preservation reward based on NAP to filter out candidates that would change the agent's next action, and uses a length-reduction reward to choose compact candidates as supervision for a lightweight compressor. Experiments on SWE-bench Verified with three agentic models show that CoACT reduces average total token consumption by 33.0% while maintaining task-solving effectiveness close to the uncompressed agent.