ArXiv

SWE-Pruner Pro: The Coder LLM Already Knows What to Prune

Authors
Yuhang Wang, Yuling Shi, Shaoqiu Zhang...
Categories
cs.CL, cs.SE
arXiv
https://arxiv.org/abs/2607.18213v1
PDF
https://arxiv.org/pdf/2607.18213v1

Brief

SWE-Pruner Pro tackles long-context pruning for coding agents by reading relevance signals from the agent’s internal activations: a small head plus length-aware line embeddings predict keep-or-prune labels for tool-output lines, eliminating an external classifier. Across two open-weight backbones and four multi-turn benchmarks it cuts up to 39% of tokens and improves MiMo-V2-Flash metrics (+3.8% verify, +2.2 Oolong). Summary based on the abstract; full text not reviewed.

Why it matters

SWE-Pruner Pro prunes tool outputs inside the agent by converting the model’s own internal representations into keep-or-prune labels per line using a small classification head and a length-aware embedding keyed to each tool output's line count, removing the need for a separate external code classifier (contrast to SWE-Pruner).

Key details

  • Evaluated on two open-weight backbones and four multi-turn benchmarks, SWE-Pruner Pro saves up to 39% of prompt+completion tokens while maintaining task quality; on MiMo-V2-Flash it raises the SWE-Bench Verified resolve rate by +3.8% and long-context Oolong accuracy by +2.2 points, with bounded inference overhead.
Source evidence

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.

Comment: Project page: https://github.com/Ayanami1314/swe-pruner-pro