Search papers, labs, and topics across Lattice.
This paper introduces SWE-Pruner Pro, an innovative pruning method that leverages the internal representations of coding agents to efficiently manage context in tool outputs. By implementing a small head that generates keep-or-prune labels based on the agent's own understanding, SWE-Pruner Pro achieves significant reductions in token usage鈥攗p to 39%鈥攚hile maintaining high task quality and introducing minimal inference overhead. The method not only enhances performance metrics on various benchmarks but also improves specific accuracy rates, indicating its effectiveness in optimizing coding agents' context management.
Pruning tool outputs directly within the agent leads to a remarkable 39% reduction in token usage without sacrificing performance.
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.