paperbot · PL 论文追踪

全部论文 待读 收藏

P1 Uncovering Systematic Failures of LLMs in Verifying Code Against Natural Language Specifications

揭示大语言模型在依据自然语言规约验证代码时的系统性失败
ASE 2025 40th IEEE/ACM International Conference on Automated Software Engineering (ASE)2025匹配度 6/10 · 该论文研究 LLM 在验证代码是否满足自然语言规约时的系统性失败,属于 AI→PL 中利用 LLM 进行程序验证的可靠性问题,与用户关注的形式化验证和 Agentic 程序交叉;但其核心是 LLM 行为分析而非静态分析技术,且缓解手段为提示工程,与用户偏好的理论/工程落地有距离。引用 1 inbox
Haolin Jin, Huaming Chen
crossref: 2026-09-12

AI 速览

一句话:发现并分析 LLM 判断代码是否满足自然语言规约时存在系统性误判,并提出缓解提示策略。

该论文研究大语言模型能否可靠判断代码实现是否满足自然语言任务规约这一问题。作者在广泛使用的基准上采用统一提示让 LLM 判定代码正确性,结果发现 LLM 经常将正确实现误判为“不满足需求”或“存在潜在缺陷”,呈现系统性失败。更出乎意料的是,引入解释与修正建议等更复杂的提示工程反而提高了误判率,暴露了 LLM 作为代码审查助手的关键可靠性问题。作者进一步分析了误判的根因,并提出两种改进的提示策略以缓解该问题。该工作首次揭示 LLM 在代码与需求匹配上的未被认识到的局限,为自动化代码审查和任务导向智能体场景提供了新的洞见与实践指导。

问题
LLM 被广泛用于代码审查,但其能否可靠判断代码是否完全满足自然语言规约尚不明确。
方法
在主流基准上用统一提示让 LLM 判定代码正确性,并对比不同提示工程策略(含解释与修正建议)的影响,进而分析误判根因并提出两种缓解策略。
评估
基于广泛采用的基准进行实证评估,统计误判率并比较不同提示策略下的表现。
原文摘要(Abstract)

Large language models (LLMs) have become essential tools in software development, widely used for requirements engineering, code generation and review tasks. Software engineers increasingly rely on LLMs to assess whether system code implementation satisfy task requirements, thereby enhancing code robustness and accuracy. However, it remains unclear whether LLMs can reliably determine whether the code complies fully with the given task descriptions, which is usually natural language specifications. In this paper, we uncover a systematic failure of LLMs in evaluating whether code aligns with natural language requirements. Specifically, using widely adopted benchmarks, we employ unified prompts to judge code correctness. Our results reveal that LLMs frequently misclassify correct code implementations as either "not satisfying requirements" or containing potential defects. Surprisingly, more complex prompting, especially when leveraging prompt engineering techniques involving explanations and proposed corrections, leads to higher misjudgment rate, which highlights the critical reliability issues in using LLMs as code review assistants. We further analyze the root causes of these misjudgments, and propose two improved prompting strategies for mitigation. For the first time, our findings reveals unrecognized limitations in LLMs to match code with requirements. We also offer novel insights and practical guidance for effective use of LLMs in automated code review and task-oriented agent scenarios.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot9471,
  title = {Uncovering Systematic Failures of LLMs in Verifying Code Against Natural Language Specifications},
  author = {Haolin Jin and Huaming Chen},
  booktitle = {ASE},
  year = {2025},
  doi = {10.1109/ase63991.2025.00323}
}