SWE-Pruner Pro: The Coder LLM Already Knows What to Prune
Yuhang Wang, Yuling Shi, Shaoqiu Zhang, Jialiang Liang, Shilin He, Siyu Ye, Yuting Chen, Kai Cai, Xiaodong Gu
Abstract
Pruning long context for coding agents has been a vital technology for efficient context management. While existing context pruning methods such as SWE-Pruner realize this by attaching a separate code classifier, we find the agent itself encodes internal representations indicating the relevance of code context when reading tool output. Based on this finding, we propose SWE-Pruner Pro, which prunes tool outputs directly inside the agent. Concretely, a small head turns the agent's own internal representations into a keep-or-prune label for each line, with a length-aware embedding keyed to each tool output's line count. Across two open-weight backbones and four multi-turn benchmarks, SWE-Pruner Pro saves up to 39% of prompt and completion tokens while preserving task quality, with bounded inference overhead. Notably, on MiMo-V2-Flash SWE-Pruner Pro additionally raises the SWE-Bench Verified resolve rate by +3.8% and the long-context Oolong accuracy by +2.2 points.
Create a lesson
Metadata
- Categories
- cs.CL, cs.SE
- Comments
- Accepted by EACL 2027
Related papers
The Linguistic Knowledge Benchmark: Do Language Models Know the Foundations of Early-Grade Literacy?
Shared title terminologycs.CLMaxime Lelièvre, Alasdair Mackintosh, Dominic Andrews et al.
Know the Design, Pick the Attack: Sentence-Keyed Watermarks for LLMs
Shared title terminologycs.CLJon Carmona, Jon Irureta, Jon Imaz et al.
Verifiable but Not Predictable: What Sentence Embeddings Know About Propositional Decomposition
Shared title terminologycs.CLQingan Li, Tianxiao Wu, Xiling Cui
Do small language models know what they don't know?
Shared title terminologycs.CLPrashant Mudgal
Does RAG Know When Retrieval Is Wrong? Diagnosing Context Compliance under Knowledge Conflict
Shared title terminologycs.CLYihang Chen, Pin Qian, Su Wang et al.
It Takes a MAESTRO To Prune Bad Experts
Shared title terminologycs.CLPalaash Goel, Ayush Maheshwari, Tanmoy Chakraborty