ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generation

📄 arXiv: 2608.04439v1 📥 PDF

作者: Yiru Dong, Richong Zhang, Fanshuang Kong, Si Chen

分类: cs.SE, cs.AI

发布日期: 2026-08-05

备注: 13 pages, 5 figures. Accepted at the 41st IEEE/ACM International Conference on Automated Software Engineering (ASE 2026)

DOI: 10.1145/3832783.3837445


💡 一句话要点

提出ExeCRE框架以解决自校正代码生成中的可靠性估计问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 代码生成 自校正 可靠性估计 执行一致性 统计分析 大型语言模型 Dawid-Skene模型

📋 核心要点

  1. 现有自校正代码生成方法依赖于不可靠的监督信号,导致误导性反馈和不必要的修正。
  2. ExeCRE框架通过分析执行输出的一致性模式来估计代码的可靠性,避免了对测试或LLM反馈的依赖。
  3. 在LiveCodeBench上,ExeCRE将误导性反馈案例从113.2降低到14.0,显示出显著的效果提升。

📝 摘要(中文)

大型语言模型(LLMs)在代码生成方面取得了显著进展,但在需要复杂算法或实现的挑战性任务上仍面临困难。现有自校正管道依赖于不可靠的监督信号,导致误导性反馈和错误的最终答案。为了解决这一问题,本文提出了ExeCRE框架,通过统计分析执行输出的一致性模式来估计代码的可靠性。该方法在自校正代码生成中集成使用,实验表明ExeCRE显著提高了效果和稳定性,并减少了误导性修正信号。

🔬 方法详解

问题定义:现有自校正代码生成方法依赖于不可靠的监督信号,导致误导性反馈和错误的最终答案。这种依赖性使得生成的代码在复杂任务中表现不佳,影响了代码生成的可靠性。

核心思路:ExeCRE框架的核心思路是通过统计分析执行输出的一致性模式来估计代码的可靠性,而不是依赖于测试或大型语言模型的反馈。这种方法能够更准确地反映代码的实际执行情况,从而提高生成代码的可靠性。

技术框架:ExeCRE的整体架构包括多个模块:首先,收集生成代码在大量随机输入下的执行输出;其次,将这些输出投影为一致性信号;最后,应用Dawid-Skene模型推断潜在的代码可靠性。

关键创新:ExeCRE的主要创新在于其通过一致性模式的统计分析来估计代码的可靠性,这与传统方法依赖于外部测试或反馈的方式有本质区别。这种方法减少了误导性信号的影响,提高了自校正过程的有效性。

关键设计:ExeCRE在设计上采用了Dawid-Skene模型来处理一致性信号,确保了对潜在代码可靠性的准确推断。关键参数设置和损失函数的设计也经过精心调整,以优化模型的性能。具体的网络结构和参数设置在实验中进行了验证,以确保其有效性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,ExeCRE在LiveCodeBench上显著降低了误导性反馈案例的数量,从113.2减少到14.0,提升幅度超过87%。这一结果表明,ExeCRE在自校正代码生成中的有效性和稳定性得到了显著增强,能够更可靠地利用生成的代码。

🎯 应用场景

ExeCRE框架具有广泛的应用潜力,尤其在需要高可靠性的代码生成任务中,如自动化编程、软件开发和教育领域。通过提高生成代码的可靠性,该方法可以有效支持开发者在复杂项目中的决策,减少错误和修正时间,提升整体开发效率。未来,该框架还可能扩展到其他领域,如代码审查和智能合约生成等。

📄 摘要(原文)

Large language models (LLMs) have made notable progress in code generation, but they still struggle on challenging tasks that require sophisticated algorithms or complex implementations. Recent methods increasingly use code execution as feedback, especially in self-correction pipelines that construct verification signals from generated code. However, these pipelines often depend on supervision signals whose reliability is unknown, which can introduce misleading feedback, unnecessary revisions, and incorrect final answers. To address this issue, we propose ExeCRE, an Execution-Consistency guided code Reliability Estimation framework. Instead of judging candidate code by tests or LLM feedback, ExeCRE estimates code reliability by statistically analyzing consistency patterns in execution outputs over a large number of randomly generated inputs. It collects execution outputs over generated inputs, projects them into consistency signals, and applies the Dawid-Skene model to infer latent code reliability. We integrate ExeCRE into self-correction for code generation. Experiments show that ExeCRE consistently improves both effectiveness and stability, while substantially reducing misleading correction signals. Under GPT-5.2 on LiveCodeBench, the average number of misleading feedback cases on already correct code drops from 113.2 with a representative self-correction baseline to 14.0 with ExeCRE. As an additional study, we apply the same reliability estimation strategy to code-based mathematical reasoning and observe similar benefits. These results suggest that ExeCRE enables more reliable use of generated code in execution-based pipelines.