arXiv(opens in a new tab)cs.SESep 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2609.08318

AttnCompress: Dynamic Attention-Guided Trajectory Compression for Software Engineering Agents

Zhengran Zeng, Yixin Li, Rui Xie, Wei Ye, Shikun Zhang

ZHENGRAN ZENG ∗^{*}, Peking University, China

YIXIN LI ∗^{*}, Peking University, China

RUI XIE †^{\dagger}, Peking University, China

WEI YE †^{\dagger}, Peking University, China

SHIKUN ZHANG †^{\dagger}, Peking University, China

The transition from human-centric assistance to Autonomous Software Engineering (ASE) agents has enabled the resolution of complex real-world SE tasks. However, the trial-and-error nature of these agents generates lengthy interaction trajectories, creating severe bottlenecks in terms of context window limits and cost. While context compression offers a potential remedy, prior approaches suffer from static pruning strategies and granularity mismatches, often failing to preserve the semantic dependencies and syntactic details crucial for SE tasks. To strictly preserve critical task evidence while reducing context length, we introduce AttnCompress, a dynamic attention-guided trajectory compression framework. Unlike existing approaches, AttnCompress bridges the gap between semantic integrity and dynamic adaptability through three key mechanisms: (1) structure-aware segmentation via perplexity (PPL) spikes to preserve the syntactic structure of code and logs; (2) relevance estimation using proxy attention weights to quantify the precise relevance of historical blocks to the agent's current reasoning; and (3) a dynamic rolling window to re-evaluate and recall historical context as the task evolves. Extensive evaluation on SWE-Bench-Verified and Multi-SWE-Bench demonstrates that AttnCompress achieves a pass rate of 53.17%, outperforming prior state-of-the-art baselines while reducing token consumption by 21.6% and total costs by 33.6%. The framework proves to be model-agnostic and generalizes effectively across diverse programming languages.

CCS Concepts: • Software and its engineering → Automatic programming.

Additional Key Words and Phrases: Software Engineering Agents, Large Language Models, Context Compression

ACM Reference Format:

Zhengran Zeng, Yixin Li, Rui Xie, Wei Ye, and Shikun Zhang. 2026. AttnCompress: Dynamic Attention-Guided Trajectory Compression for Software Engineering Agents. Proc. ACM Softw. Eng. 3, ISSTA, Article ISSTA058 (October 2026), 23 pages. https://doi.org/10.1145/3832149

References (9)