Paper Overview
Field: NLP Authors: Yuhang Wang, Yuling Shi, Shaoqiu Zhang, Jialiang Liang, Shilin He, et al. (9 authors) Published: 2026-07-20 arXiv: 2607.18213 Categories: cs.CL, cs.SE
Summary
Pruning long context for coding agents has long been a key technique for efficient context management. While existing context-pruning methods such as SWE-Pruner achieve this by attaching a separate code classifier, the authors find that the agent itself encodes internal representations indicating the relevance of code context when reading tool outputs.
Based on this finding, they propose SWE-Pruner Pro, which prunes tool outputs directly inside the agent. Specifically, a small head network converts the agent's own internal representations into per-line keep-or-prune labels, using length-aware embeddings based on the number of lines in each tool output.
Results
- Evaluated on two open-source backbone models and four multi-turn benchmarks
- Saves up to 39% of prompt and completion tokens while maintaining task quality
- Inference overhead is bounded
- On MiMo-V2-Flash, SWE-Pruner Pro additionally improves SWE-Bench Verified resolve rate by +3.8% and long-context Oolong accuracy by +2.2 percentage points
Original Abstract (Condensed)
> We find coding agents encode internal representations indicating code context relevance. SWE-Pruner Pro prunes tool outputs inside the agent, saving up to 39% tokens while raising SWE-Bench Verified resolve rate by +3.8% on MiMo-V2-Flash.
---
*Auto-collected on 2026-07-22*