arXiv:2607.18213cs.CLcs.SE2026-07被引 2

让编码大模型自己判断该删哪行代码,更省显存还更准。

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

论文配图:SWE-Pruner Pro: The Coder LLM Already Knows What to Prune
图 1 · 摘自论文原文
  • 利用模型内部表示直接判断代码相关性,无需额外分类器。
  • 最多节省39%提示与生成token,推理开销可控。
  • 适合追求高效长上下文处理的编程助手开发者。

为编码代理优化长上下文管理,现有方法如SWE-Pruner通过附加代码分类器实现修剪。我们发现代理在读取工具输出时已编码内部表征,可指示代码相关性。基于此,提出SWE-Pruner Pro,直接在代理内部对工具输出进行修剪。具体而言,一个小头部将代理自身内部表示转化为每行的保留或删除标签,并使用与每个工具输出行数相关的长度感知嵌入。在两个开源权重主干和四个多轮基准上,SWE-Pruner Pro 最多节省39%的提示与完成令牌,同时保持任务质量,推理开销有限。特别地,在MiMo-V2-Flash上,其使SWE-Bench Verified解决率提升+3.8%,长上下文Oolong准确率提升+2.2分。

原文摘要 · Abstract (English)

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.

模型剪枝编程助手上下文压缩

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。