arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.05188cs.LGcs.SE
收藏

编码智能体中的潜在编程视界

Latent Programming Horizons in Coding Agents

KTH Royal Institute of Technology(瑞典皇家理工学院)

André Silva, Han Tu, Martin Monperrus

AI总结:

该研究探究编码智能体底层语言模型的程序内部表征,通过逻辑回归探针发现其残差流可线性编码程序属性,还能提前约25步预测后续编辑结果,为编码智能体的机制可解释性研究提供新方向。

摘要:

解决软件工程任务的编码智能体需要耗费数十步进行推理、编辑代码和运行测试,但人们对其底层语言模型在内部对所处理程序的表征内容知之甚少。本文证明,编码智能体所搭载语言模型的残差流会对演进中程序的各类属性进行线性编码:基于隐藏状态训练的逻辑回归探针可解码当前代码是否可解析、是否通过测试套件、是否减少失败测试数量、是否引入回归问题,在两个模型和两个基准测试集上,正确性相关任务的AUC最高可达0.83。本文第二项发现更具突破性:这些表征的生成早于智能体自身的编辑操作。在未来编辑尚未实现、写入磁盘之前,用于预测该编辑结果的探针可在提前约25步的情况下获得高于随机猜测的性能表现,我们将这一特性命名为智能体的潜在编程视界。作为外部有效性验证,本文证明这些探针无需重新训练即可跨基准测试集迁移。该研究的正向成果呼吁学界开展更多针对编码智能体的机制可解释性研究。

英文摘要:

A coding agent solving a software-engineering task spends dozens of steps reasoning, editing code, and running tests, yet little is known about what the underlying language model internally represents about the program it is working on. We show that the residual streams of language models under coding agents linearly encode properties of the evolving program: a logistic-regression probe on hidden states is able to decode whether the current code parses, passes its test suite, reduces the number of failing tests, and introduces regressions, reaching AUC up to 0.83 for correctness across two models and two benchmarks. Our second finding is more surprising: these representations run ahead of the agent's own edits. Probes trained to predict the outcome of future edits (before they are materialized and written on disk) achieve performance above chance up to roughly 25 steps in advance. We call this the agent's latent programming horizon. As a proof of external validity, we show that the probes transfer across benchmarks without retraining. Our positive results open calls for more research in mechanistic interpretability of coding agents.

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

↑