paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Aligning Requirement for Large Language Model's Code Generation

对齐需求:面向大语言模型代码生成的规约对齐
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 3/10 · 论文属于 PL+AI 与 LLM 代码生成交叉,但与用户核心方向(静态分析、形式化验证、浮点/贝叶斯程序分析)无直接关系;其目标是提升 LLM 代码生成与规约对齐,更偏向 LLM 能力改进而非程序分析/验证工具。引用 15 inbox
Zhao Tian, Junjie Chen
crossref: 2026-09-12

AI 速览

一句话:提出 Specine,通过识别、提升并对齐编程规约,缓解 LLM 代码生成与需求不一致的问题。

代码生成指依据给定编程规约自动产生源代码,随着大语言模型的发展受到广泛关注。然而真实问题固有的复杂性使 LLM 生成的代码往往无法完全符合给定规约;现有基于 agent 的增强技术忽略了规约感知这一关键问题,导致错位持续存在。鉴于准确感知编程规约是基于 LLM 的代码生成范式的基础,保证规约对齐尤为重要。本文借鉴软件需求工程的思想,提出 Specine——一种面向 LLM 代码生成的规约对齐技术,其核心思路是识别错位的输入规约、提升 LLM 所感知的规约,并对其进行对齐以增强 LLM 的代码生成表现。作者在四个先进 LLM 与五个具有挑战性的竞赛基准上,与十个先进基线进行了全面实验,验证了 Specine 的有效性:例如在 Pass@1 指标上,Specine 相对最强基线在所有测试对象上平均提升 29.60%。

问题
LLM 生成的代码常与给定的编程规约不一致,而现有基于 agent 的增强方法忽略了对规约的正确感知,导致错位问题难以消除。
方法
借鉴软件需求工程,提出 Specine:识别错位的输入规约,提升 LLM 感知到的规约,并将二者对齐以改进代码生成。
评估
在四个先进 LLM 与五个高难度竞赛基准上,与十个先进基线对比;Pass@1 上平均提升 29.60%。
原文摘要(Abstract)

Code generation refers to the automatic generation of source code based on a given programming specification, which has garnered significant attention particularly with the advancement of large language models (LLMs). However, due to the inherent complexity of real-world problems, the LLM-generated code often fails to fully align with the provided specification. While state-of-the-art agent-based techniques have been proposed to enhance LLM code generation, they overlook the critical issue of specification perception, resulting in persistent misalignment issues. Given that accurate perception of programming specifications serves as the foundation of the LLM-based code generation paradigm, ensuring specification alignment is particularly crucial. In this work, we draw on software requirements engineering to propose Specine, a novel specification alignment technique for LLM code generation. Its key idea is to identify misaligned input specifications, lift LLM-perceived specifications, and align them to enhance the code generation performance of LLMs. Our comprehensive experiments on four state-of-the-art LLMs across five challenging competitive benchmarks by comparing with ten state-of-the-art baselines, demonstrate the effectiveness of Specine. For example, Specine outperforms the most effective baseline, achieving an average improvement of 29.60% across all subjects in terms of Pass@1.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2509-01313,
  title = {Aligning Requirement for Large Language Model's Code Generation},
  author = {Zhao Tian and Junjie Chen},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3764572}
}