Vibe Checker: Aligning Code Evaluation with Human Preference
该论文提出了一种名为Vibe Checker的代码评估框架,通过引入VeriCode指令分类法,评估代码在功能性正确性和指令遵循方面的表现,以更好地与人类偏好对齐。
更新于 2025-10-09。作者:Ming Zhong、Xiang Zhou、Ting-Yun Chang、Qingze Wang、Nan Xu、Xiance Si、Dan Garrette、Shyam Upadhyay、Jeremiah Liu、Jiawei Han、Benoit Schillings、Jiao Sun。
中文摘要
大型语言模型(LLMs)推动了 vibe coding 的发展,用户通过利用 LLMs 通过自然语言交互生成和迭代优化代码,直到代码通过他们的 vibe 检查。vibe 检查与真实世界中的人类偏好相关联,并超越了功能性:解决方案应感觉正确,易于阅读,保留意图,并保持正确。然而,当前的代码评估仍然依赖于 pass@k,仅捕获功能性正确性,忽略了用户经常应用的非功能性指令。在这篇论文中,我们假设遵循指令是 vibe 检查背后缺失的环节,它代表了人类在编码中对功能正确性以外的偏好。为了用可测量的信号量化模型的代码指令遵循能力,我们提出了 VeriCode,这是一个包含 30 个可验证代码指令及其相应确定性验证器的分类法。我们使用这个分类法来增强现有的评估套件,从而产生了 Vibe Checker,一个用于评估代码指令遵循和功能正确性的测试平台。在评估了 31 个领先的 LLMs 后,我们发现即使是性能最强的模型也难以遵循多个指令,并表现出明显的功能退化。最重要的是,功能正确性和指令遵循的复合得分与人类偏好相关性最高,其中后者成为实际编程任务中的主要区分因素。我们的工作确定了 vibe 检查的核心因素,为基准测试和开发更符合用户编码偏好的模型提供了具体路径。
英文摘要
Large Language Models (LLMs) have catalyzed vibe coding, where users leverage LLMs to generate and iteratively refine code through natural language interactions until it passes their vibe check. Vibe check is tied to real-world human preference and goes beyond functionality: the solution should feel right, read cleanly, preserve intent, and remain correct. However, current code evaluation remains anchored to pass@k and captures only functional correctness, overlooking the non-functional instructions that users routinely apply. In this paper, we hypothesize that instruction following is the missing piece underlying vibe check that represents human preference in coding besides functional correctness. To quantify models' code instruction following capabilities with measurable signals, we present VeriCode, a taxonomy of 30 verifiable code instructions together with corresponding deterministic verifiers. We use the taxonomy to augment established evaluation suites, resulting in Vibe Checker, a testbed to assess both code instruction following and functional correctness. Upon evaluating 31 leading LLMs, we show that even the strongest models struggle to comply with multiple instructions and exhibit clear functional regression. Most importantly, a composite score of functional correctness and instruction following correlates the best with human preference, with the latter emerging as the primary differentiator on real-world programming tasks. Our work identifies core factors of the vibe check, providing a concrete path for benchmarking and developing models that better align with user preferences in coding.
解读
一句话总结
该论文提出了一种名为Vibe Checker的代码评估框架,通过引入VeriCode指令分类法,评估代码在功能性正确性和指令遵循方面的表现,以更好地与人类偏好对齐。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:当前代码评估主要关注功能性正确性,而忽略了非功能性要求,如编码风格、逻辑模式和文档清晰度等,这些往往影响用户的接受度。
- 现有方案不足:现有的代码评估指标如pass@k只关注功能性正确性,无法全面反映用户对代码的偏好。
- 研究目标:提出一种新的代码评估方法,通过引入VeriCode指令分类法,评估代码在功能性正确性和指令遵循方面的表现,以更好地与人类偏好对齐。
问题2:论文的核心创新点是什么?
- 技术创新:提出VeriCode指令分类法,包含30个可验证的代码指令,并使用标准linters和抽象语法树分析进行验证。
- 方法改进:通过Vibe Checker框架,结合功能性正确性和指令遵循两个维度对代码进行评估。
- 优势:与现有方法相比,Vibe Checker能够更全面地评估代码质量,更好地与人类偏好对齐。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:在Vibe Checker框架下对31个领先的LLM进行了评估,包括单轮生成和多轮编辑两种交互模式。
- 性能提升:实验结果显示,Vibe Checker能够有效地评估代码的指令遵循能力,并发现即使是最先进的模型在遵循多个指令时也存在困难。
- 对比结果:实验结果表明,功能性正确性和指令遵循的综合得分与人类偏好相关性最高,证明了Vibe Checker的有效性。
问题4:这个研究的实际应用价值是什么?
- 应用场景:Vibe Checker可用于评估代码生成模型,确保生成的代码不仅功能正确,而且符合非功能性要求,提高用户满意度。
- 实施建议:建议在代码生成和评估过程中采用Vibe Checker,以提高代码质量。
- 局限与展望:Vibe Checker主要针对Python语言,未来可扩展到其他编程语言。此外,未来研究可以探索更复杂的指令和评估方法,以进一步提高代码评估的准确性。
来源
机器可读索引:llms.txt