AI Pulse
📄 论文解读

AI编程助手自己知道哪些代码该删

现在的AI编程助手处理长代码时,通常需要额外挂一个分类器来裁剪无关内容。但研究者发现,AI助手在阅读代码时,自己内部就已经知道哪些行重要——就像你读文章时自然知道哪些段落可以跳过。他们直接在AI内部加了一个小模块,利用AI自己的判断来裁剪代码,省掉最多39%的token,任务质量不降,甚至在两个测试集上还略有提升。这不是你明天就能用的功能,但它指向一个趋势:AI工具会越来越像人一样,自己学会管理注意力。

📄 原文摘要(英文)

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.

arXiv 原文

订阅 AI Pulse

每天 08:00 · 12:30 · 18:30 · 23:50 更新