arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2610.20683cs.LGcs.SE
收藏

CodeLMs中的因果句法回路:预算与探针决定什么看起来是局部化的

Causal Syntax Circuits in CodeLMs: Budget and Probe Decide What Looks Localised

Columbia University(哥伦比亚大学);BITS Pilani, K. K. Birla Goa Campus(BITS Pilani K. K. Birla果阿校区);National Institute of Technology Agartala(阿加尔塔拉国家技术学院)

Harsh Kumar, Tanmay Shailesh Joshi, Rahul Maity, Anusa Saha

AI总结:

该研究探究CodeLMs生成Python代码的机制,经多模型多语言实验发现,代码偏好的局部化结论取决于分析选择,其规模与预算、探针及指令微调相关。

摘要:

代码模型在提示未指定使用哪种语言时会生成Python代码。我们针对这一习惯提出一个机制性问题:它是否由模型内部一组小型、可定位的组件产生?我们在涵盖10个开源代码模型(5个基础模型和5个指令微调模型)、3种目标语言(Rust、C#、PHP)、2组提示集和2种组件预算的55个模型-语言设置上运行了一套流程——均值消融、激活修补、贪心回路提取、随机对照显著性测试和激活引导。我们报告五项发现:第一,这种偏好程度较大,且随模型规模增长,经指令微调后依然存在:每个指令微调检查点的偏好均比其基础模型更大,平均高出12%。第二,其测量规模主要取决于探针:将我们的对齐提示替换为XLCoST并行函数,对相同模型的相同测量值从约1.6降至约0.01。第三,这种偏好是否呈现局部化取决于搜索可保留的组件数量:预算为12时,15个设置中仅有1个产生的回路经多重比较校正后优于规模匹配的随机对照;预算为40时,15个设置中有6个符合要求。第四,小规模预算研究报告称干预措施均失败,但部分情况下确实有效:在45个设置中,修补使Python提示偏向目标语法的情况有2种,引导改变最可能的下一个token的情况有9种。第五,所有效果显著但指向非目标语言的回路均来自回路提取失败的设置,这类结果属于诊断而非现象。实际启示是,关于某一行为是否局部化的结论可能取决于论文极少报告的分析选择。我们发布了完整的网格,以便他人调整这些选择。

英文摘要:

Code models write Python when the prompt does not say which language to use. We ask a mechanistic question about that habit: is it produced by a small, findable group of components inside the model? We run one pipeline---mean ablation, activation patching, greedy circuit extraction, a random-control significance test, and activation steering---over 55 model-language settings spanning ten open code models (five base and five instruction-tuned), three target languages (Rust, C#, PHP), two prompt suites, and two component budgets. We report five findings. First, the preference is large, grows with model size, and survives instruction tuning: it is larger on every instruction-tuned checkpoint than on its base version, by 12% on average. Second, its measured size is mostly a property of the probe; replacing our aligned prompts with XLCoST parallel functions takes the same measurement on the same models from about 1.6 to about 0.01. Third, whether the preference looks localised depends on how many components the search may keep: with a budget of 12, 1 of 15 settings yields a circuit that beats size-matched random controls after multiple-comparison correction, and with a budget of 40, 6 of 15 do. Fourth, interventions that a smaller-budget study reports as uniformly failing do sometimes succeed: patching makes a Python prompt prefer target syntax in 2 of 45 settings, and steering changes the most likely next token in 9 of 45. Fifth, every circuit whose effect is significant but points away from the target language comes from a setting where circuit extraction failed, which makes such results a diagnostic rather than a phenomenon. The practical lesson is that a claim about whether a behaviour is localised can turn on analysis choices that papers rarely report. We release the full grid so those choices can be varied.

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

↑