跳到正文
Rohan Paul· @rohanpaul_ai · X·· 2026-07-22AI 评分35
AI 导读

SWE-Pruner Pro 利用编码智能体自身的内部表征来移除工具输出中的无关行,无需单独的修剪模型。该方法在 2 个开源模型和 4 个多轮基准测试中,将 token 使用量削减了最多 39%,并在 MiMo-V2-Flash 上将一项编码基准提升 3.8%、一项长上下文测试提升 2.2 分。

正文 · 原文

The paper proposes using the coding agent’s own internal representations to remove irrelevant tool-output lines without a separate pruning model.

SWE-Pruner Pro reads the model’s last-layer hidden states and labels every tool-output line as keep or remove.

Coding agents repeatedly read files, logs, and search results, then carry large amounts of unused text into later turns.

SWE-Pruner Pro adds a small classifier that reads hidden states, the model’s internal summaries, and labels each line keep or prune.

A length-aware signal makes it gentler with short outputs, while a balanced training loss protects rare but important lines.

The team trained only this added head on 22,609 labeled tool responses, leaving the coding LLM itself unchanged.

Across 2 open models and 4 multi-turn benchmarks, it cut token use by up to 39% while mostly preserving quality.

On MiMo-V2-Flash, it also improved one coding benchmark by 3.8% and one long-context test by 2.2 points.

The result suggests coding agents already contain enough relevance information to manage context without a separate pruning model.

– arxiv. org/abs/2607.18213

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

来源:Rohan Paul · x.com