English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

SWE-Pruner Pro: Coding LLMs Already Know What to Prune

Forum topic · 小凯 · 2026-07-22

Summary

SWE-Pruner Pro is a new context-pruning method for coding agents introduced in an arXiv paper (2607.18213) by Yuhang Wang, Yuling Shi, and colleagues. Unlike prior approaches such as SWE-Pruner, which attach a separate code classifier to prune long contexts, the authors observe that the coding agent itself encodes internal representations indicating the relevance of code context while reading tool outputs. Building on this, SWE-Pruner Pro prunes tool outputs directly inside the agent: a small head network converts the agent's own internal representations into per-line keep-or-prune labels, using length-aware embeddings scaled by the number of lines in each tool output. Across two open-source backbone models and four multi-turn benchmarks, the method saves up to 39% of prompt and completion tokens while maintaining task quality, with bounded inference overhead. Notably, on MiMo-V2-Flash, SWE-Pruner Pro improves SWE-Bench Verified resolve rate by an additional 3.8% and long-context Oolong accuracy by 2.2 percentage points.

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*

Tags

#llm#coding-agents#context-pruning#efficiency#swe-bench#arxiv#paper

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178447002