Skip to main content
CenXiv.org
此网站处于试运行阶段,支持我们!
我们衷心感谢所有贡献者的支持。
贡献
赞助
cenxiv logo > cs > arXiv:2507.00057v1

帮助 | 高级搜索

计算机科学 > 编程语言

arXiv:2507.00057v1 (cs)
[提交于 2025年6月26日 ]

标题: 基于大语言模型的代码生成中无预言的正确性估计

标题: Estimating Correctness Without Oracles in LLM-Based Code Generation

Authors:Thomas Valentin, Ardi Madadi, Gaetano Sapia, Marcel Böhme
摘要: 从自然语言规范生成代码是大型语言模型(LLMs)最成功的应用之一。 然而,它们会产生幻觉: LLMs 生成的输出可能在语法上正确,但事实错误。 在没有现有正确实现(即一个 oracle)的情况下,我们能否量化生成程序正确的可能性? 在本文中,我们提出了一种不一致性的度量方法,称为不一致性,在没有 oracle 的情况下可以高效估计,并提供了错误的下限,即对于该规范的 LLM 生成程序不正确的概率。 我们的实验表明了非凡的有效性。 对于平均代码生成任务,我们的基于不一致性的方法可以在不报告假阳性的情况下自动识别大约三分之二的错误程序。 事实上,基于 oracle 的 LLM 评估可以被基于不一致性的评估可靠地替代。 特别是,我们发现通过 oracle 被视为正确的程序数量对 LLM 进行排序与通过我们的不一致性被视为正确的程序数量对 LLM 进行排序之间存在非常强的一致性。
摘要: Generating code from natural language specifications is one of the most successful applications of Large Language Models (LLMs). Yet, they hallucinate: LLMs produce outputs that may be grammatically correct but are factually incorrect. Without an existing, correct implementation (i.e., an oracle), can we quantify how likely the generated program is correct? In this paper, we propose a measure of incorrectness, called incoherence, that can be estimated efficiently in the absence of an oracle and provides a lower bound on the error, i.e., the probability that the LLM-generated program for that specification is incorrect. Our experiments demonstrate an extraordinary effectiveness. For the average code generation task, our incoherence-based methodology can automatically identify about two-thirds of incorrect programs without reports of false positives. In fact, an oracle-based evaluation of LLMs can be reliably replaced by an incoherence-based evaluation. In particular, we find a very strong agreement between the ranking of LLMs by the number of programs deemed correct via an oracle (pass@1) and the ranking of LLMs by the number of programs deemed correct via our incoherence.
评论: 8页+参考文献和附录
主题: 编程语言 (cs.PL) ; 人工智能 (cs.AI); 机器学习 (cs.LG); 软件工程 (cs.SE)
引用方式: arXiv:2507.00057 [cs.PL]
  (或者 arXiv:2507.00057v1 [cs.PL] 对于此版本)
  https://doi.org/10.48550/arXiv.2507.00057
通过 DataCite 发表的 arXiv DOI

提交历史

来自: Marcel Böhme [查看电子邮件]
[v1] 星期四, 2025 年 6 月 26 日 22:00:50 UTC (3,808 KB)
全文链接:

获取论文:

    查看标题为《》的 PDF
  • 查看中文 PDF
  • 查看 PDF
  • HTML(实验性)
  • TeX 源代码
  • 其他格式
许可图标 查看许可
当前浏览上下文:
cs.PL
< 上一篇   |   下一篇 >
新的 | 最近的 | 2025-07
切换浏览方式为:
cs
cs.AI
cs.LG
cs.SE

参考文献与引用

  • NASA ADS
  • 谷歌学术搜索
  • 语义学者
a 导出 BibTeX 引用 加载中...

BibTeX 格式的引用

×
数据由提供:

收藏

BibSonomy logo Reddit logo

文献和引用工具

文献资源探索 (什么是资源探索?)
连接的论文 (什么是连接的论文?)
Litmaps (什么是 Litmaps?)
scite 智能引用 (什么是智能引用?)

与本文相关的代码,数据和媒体

alphaXiv (什么是 alphaXiv?)
CatalyzeX 代码查找器 (什么是 CatalyzeX?)
DagsHub (什么是 DagsHub?)
Gotit.pub (什么是 GotitPub?)
Hugging Face (什么是 Huggingface?)
带有代码的论文 (什么是带有代码的论文?)
ScienceCast (什么是 ScienceCast?)

演示

复制 (什么是复制?)
Hugging Face Spaces (什么是 Spaces?)
TXYZ.AI (什么是 TXYZ.AI?)

推荐器和搜索工具

影响之花 (什么是影响之花?)
核心推荐器 (什么是核心?)
IArxiv 推荐器 (什么是 IArxiv?)
  • 作者
  • 地点
  • 机构
  • 主题

arXivLabs:与社区合作伙伴的实验项目

arXivLabs 是一个框架,允许合作伙伴直接在我们的网站上开发和分享新的 arXiv 特性。

与 arXivLabs 合作的个人和组织都接受了我们的价值观,即开放、社区、卓越和用户数据隐私。arXiv 承诺这些价值观,并且只与遵守这些价值观的合作伙伴合作。

有一个为 arXiv 社区增加价值的项目想法吗? 了解更多关于 arXivLabs 的信息.

这篇论文的哪些作者是支持者? | 禁用 MathJax (什么是 MathJax?)
  • 关于
  • 帮助
  • contact arXivClick here to contact arXiv 联系
  • 订阅 arXiv 邮件列表点击这里订阅 订阅
  • 版权
  • 隐私政策
  • 网络无障碍帮助
  • arXiv 运营状态
    通过...获取状态通知 email 或者 slack

京ICP备2025123034号