arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.33958cs.SEcs.CLcs.LG
收藏

小型编码智能体如何使用代码图与嵌入?

How Much Do Structural Tools Help Small Coding Agents? A Pre-Registered Scale Study of Code Localization

The University of Texas at Austin(德克萨斯大学奥斯汀分校)

Saurav Bellam

AI总结:

该研究在SWE-bench Verified上针对小型开放权重模型,通过消融实验等方法探究编码智能体使用代码图与嵌入的情况,发现结构化工具可提升编码任务性能,且跳深、模型规模等会影响工具增益。

摘要:

编码智能体被赋予嵌入搜索与代码图工具,前提是模型缺乏仓库结构,而工具可提供该结构。我们在SWE-bench Verified上针对小型开放权重模型验证该前提,按确定性跳深(即问题提及代码到黄金补丁修改代码的最短代码图路径,由配套论文定义并验证)对任务分层。首先,我们在深度均衡的160任务拆分集及全部500任务上,对10种模型(6种Qwen3规模,从0.6B到32B,每种5次解码,1个FP8对照,3种Gemma 4规模;共79k个回合),对定位智能体的工具集(仅grep;+嵌入搜索;+图工具;全部)进行消融实验。结构化工具使Qwen3-8B和Gemma 4 E4B的仅grep准确率翻倍;其增益在1.7-4B时达到峰值17-21个百分点,在32B时降至4-5个百分点(参数每翻倍,优势比为0.77-0.82)。从8B起,该增益约一半体现为提交形式而非目标查找;14B到32B的下降是因在相同仅grep准确率下工具使用率降低;4B规模的增益与否取决于检查点。每增加一跳,各规模下正确定位的优势比乘以0.50-0.67,且无工具集能消除该梯度:轨迹显示图工具的增益在跳0时为名称查找,在跳1时为一次扩展,智能体仅在12-14%的回合中进行链式扩展。固定修复模型从这些定位中解决160任务中的6-13个(神谕为26个)。其次,线性探针发现可在锚内、度分层协议下解码的直接调用边(AUC为0.74;智能体对话内为0.61-0.66),但低于词汇基线(0.99),两跳边为0.57。小型智能体在权重及使用中携带关于其仓库的单跳、大体词汇化的表征。我们发布该智能体、探针、日志及轨迹。

英文摘要:

Code-graph and embedding tools are routinely added to LLM coding agents on the premise that they supply repository structure the model lacks. We report a pre-registered study of how much such tools help off-the-shelf agents localize the code an issue requires changing and how the benefit varies with model size. Nine open-weight models (Qwen3 0.6B to 32B, Gemma 4 E2B to 12B) run one fixed localization harness on 500 held-out SWE-bench tasks under four tool sets (grep only; plus embedding search; plus code-graph tools; both) and a placebo arm whose structural tools return random entities, with five sampled seeds per condition: 170,500 episodes under hypotheses, tests and claim criteria frozen before the runs. The tools raise canonical function Acc@10 by +0.06 to +0.10 for the Qwen3 models up to 14B and the two small Gemma 4 models, by +0.03 at 32B (a near miss after correction), and not at all for Gemma 4 12B, which rarely submits; the gain is larger for small models than for the largest model in both families. The placebo shows that the gain is caused by what the tools return rather than by having them, and that random tool output harms two small models. The pre-registered claim that a 4B model with tools matches a 32B model without them fails. Secondary analyses show that the embedding index, not the code graph, carries the gain; that the gain replicates on tasks created after every model's release and survives a shell harness, thinking mode, FP8 serving and a file-level metric that output formatting cannot inflate; and that it is mostly exposure: the tools show the gold code more often. Injecting the gold code directly explains the size trend. A 32B model already finds the code without the tools, so they add little exposure, while small models act on a shown answer less often (conversion 0.09, 0.24 and 0.40 at 1.7B, 4B and 32B). We release registration, code, episodes and analyses.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑