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

BACE:基于大语言模型的代码生成:通过贝叶斯锚定的代码与测试种群共演化

BACE: LLM-based Code Generation through Bayesian Anchored Co-Evolution of Code and Test Populations

WSO2

Kaushitha Silva, Srinath Perera

AI总结:

BACE通过贝叶斯锚定的共演化方法,改进代码生成中的测试反馈机制,提升代码与测试种群的协同进化性能。

摘要:

大型语言模型(LLMs)在代码生成方面展现了出色的潜力。尽管交互反馈循环可以提高性能,但编写有效的测试却是一项非平凡的任务。早期的多智能体框架,如AgentCoder,自动化了这一过程,但依赖于生成的测试作为绝对真实。这种方法存在缺陷:错误的代码经常通过错误或琐碎的测试,而正确的解决方案往往被降级以满足错误的断言。为了解决这一限制,新的方法大多放弃了测试生成,转而基于示例进行规划和推理。然而,我们认为生成的测试仍是一个有价值的信号,如果我们将它们建模为由贝叶斯更新引导的噪声传感器。为此,我们引入了BACE(贝叶斯锚定共进化),一种将合成重新表述为贝叶斯共进化过程的框架,其中代码和测试种群被进化,由相互更新的信念分布引导。通过将搜索锚定在最小的公共示例上,BACE防止了自验证循环中典型的共进化漂移。在LiveCodeBench v6(2025年3月后)上的广泛评估表明,BACE在专有模型和开源小型语言模型上均实现了优越的性能。

英文摘要:

Large Language Models (LLMs) have demonstrated impressive capabilities in code generation. While an interactive feedback loop can improve performance, writing effective tests is a non-trivial task. Early multi-agent frameworks, such as AgentCoder, automated this process but relied on generated tests as absolute ground truth. This approach is fragile: incorrect code frequently passes faulty or trivial tests, while valid solutions are often degraded to satisfy incorrect assertions. Addressing this limitation, newer methods have largely abandoned test generation in favor of planning and reasoning based on examples. We argue, however, that generated tests remain a valuable signal if we model them as noisy sensors guided by bayesian updates. To this end, we introduce BACE (Bayesian Anchored Co-Evolution), a framework that reformulates synthesis as a Bayesian co-evolutionary process where code and test populations are evolved, guided by belief distributions that are reciprocally updated based on noisy interaction evidence. By anchoring this search on minimal public examples, BACE prevents the co-evolutionary drift typical of self-validating loops. Extensive evaluations on LiveCodeBench v6 (post-March 2025) reveal that BACE achieves superior performance across both proprietary models and open-weight small language models.

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

↑