Coding agents are increasingly utilized in test-driven software development, yet the theoretical mechanisms behind their environment-interaction strategies remain underexplored. We provide a probabilistic framework for two dominant paradigms: code selection after generation using the execution environment, and code generation conditioned on environment feedback. First, we formalize several well-established selection heuristics as environment-aware estimators of code correctness. We theoretically prove that estimators based on fuzzy functional similarity add an inductive bias and strictly dominate estimators based on functional equivalence in terms of signal-to-noise ratio. Second, we frame backprompting as an in-context approximation of Thompson sampling. We derive a novel regret bound for reward functions with unobservable components, theoretically explaining why the effectiveness of backprompting is limited by the ambiguity of the informal task description (an irreducible regret). Using three state-of-the-art open weight models, we corroborate these findings across BigCodeBenchHard, LeetCodeDataset, and QiskitHumanEvalSim. Our formalization also suggests how to improve task descriptions effectively, leading to a new benchmark, QiskitHumanEvalSimX.


翻译:编码智能体在测试驱动软件开发中的应用日益广泛,但其环境交互策略背后的理论机制仍未得到充分探索。我们为两种主流范式提供了一个概率框架:利用执行环境进行生成后的代码选择,以及基于环境反馈的条件代码生成。首先,我们将几种成熟的启发式选择方法形式化为代码正确性的环境感知估计器。我们从理论上证明,基于模糊功能相似性的估计器引入了归纳偏置,并且在信噪比方面严格优于基于功能等价性的估计器。其次,我们将反向提示(backprompting)框架为汤普森采样(Thompson sampling)的上下文近似。我们针对具有不可观测分量的奖励函数推导出一个新颖的遗憾界(regret bound),从理论上解释了为何反向提示的有效性受限于非正式任务描述的模糊性(一种不可约的遗憾)。通过使用三个最先进的开源权重模型,我们在BigCodeBenchHard、LeetCodeDataset和QiskitHumanEvalSim数据集上验证了这些发现。我们的形式化工作也提示了如何有效改进任务描述,从而催生了一个新的基准测试集QiskitHumanEvalSimX。

0
下载
关闭预览

相关内容

智能体工程(Agent Engineering)
专知会员服务
27+阅读 · 2025年12月31日
AI智能体编程:技术、挑战与机遇综述
专知会员服务
41+阅读 · 2025年8月18日
设计和构建强大的大语言模型智能体
专知会员服务
55+阅读 · 2024年10月6日
《深度学习代码智能》综述、基准和工具集
专知会员服务
56+阅读 · 2024年1月2日
《交互式对抗智能体开发中的行为克隆方法比较》论文
专知会员服务
56+阅读 · 2023年8月20日
浅谈群体智能——新一代AI的重要方向
中国科学院自动化研究所
44+阅读 · 2019年10月16日
CCCF专题:史元春 | 自然人机交互
中国计算机学会
25+阅读 · 2018年5月18日
CCCF专栏文章:人机共融智能
中国计算机学会
15+阅读 · 2017年12月21日
群体智能:新一代人工智能的重要方向
走向智能论坛
12+阅读 · 2017年8月16日
国家自然科学基金
23+阅读 · 2015年12月31日
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
28+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2013年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
Arxiv
0+阅读 · 1月28日
VIP会员
相关基金
国家自然科学基金
23+阅读 · 2015年12月31日
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
28+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
11+阅读 · 2013年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员