paperbot · PL 论文追踪

全部论文 待读 收藏

Aligning User Requirement with Large Language Model in Code Generation

在代码生成中对齐用户需求与大语言模型
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026引用 0 inbox
Jia Li, Ruiqi Bai, Yangkang Luo, Yiran Zhang, Wentao Yang, Zeyu Sun, Tiankuo Zhao, Dongming Jin, Lei Li, Zhi Jin
crossref: 2026-10-09

AI 速览

一句话:提出 REA-Coder,通过识别并改写 LLM 难以对齐的需求内容,迭代对齐与生成,提升代码生成正确性。

代码生成旨在从用户需求自动产出可执行程序。近期研究多通过推理策略或后置修正来提升大语言模型生成代码的正确性,但这些方法都隐含一个共同假设:LLM 能够正确理解给定需求,而该假设并不总成立。为弥补这一缺口,本文提出需求对齐方法 REA-Coder。它首先识别需求中与 LLM 不一致的内容并对齐需求,然后基于对齐后的需求让 LLM 生成代码,并进一步验证生成代码是否与需求一致,如此迭代需求对齐与代码生成过程,直至得到正确代码或达到最大迭代次数。实验在五个编程基准、四个 LLM 上开展,REA-Coder 超越所有先进基线,五个基准的平均提升分别为 7.93%、30.25%、26.75%、8.59% 和 8.15%,表明需求对齐能有效改善 LLM 的代码生成性能。

问题
现有 LLM 代码生成方法普遍假设模型能正确理解用户需求,但该假设在现实中并不总成立,导致生成代码与需求不符。
方法
提出 REA-Coder:先识别与 LLM 不对齐的需求内容并进行需求对齐,再基于对齐后的需求生成代码,并验证代码与需求的一致性,迭代该过程直到生成正确代码或达到最大迭代次数。
评估
在五个编程基准和四个 LLM 上与先进基线对比,五个基准上平均性能提升分别为 7.93%、30.25%、26.75%、8.59% 和 8.15%。
原文摘要(Abstract)

Code generation refers to automatically producing executable programs from user requirements. Recently, researchers have explored approaches to enhance the correctness of generated code with advanced large language models. Although achieving improvements, existing approaches focus on designing reasoning strategies or post-refinement methods to enhance code generation performance. Despite their differences, all these methods share a common assumption: the LLM can correctly understand the given requirement. However, this assumption does not always hold. To fill this gap, we propose REA-Coder, a requirement alignment approach to enhance the code generation performance of LLMs. REA-Coder involves first identifying the requirement content that does not align with LLMs and aligning the requirements. Then, based on the aligned requirements, LLMs generate code and further verify whether the generated code aligns with the requirements, iterating this process of requirement alignment and code generation until generating correct code or achieving the maximum number of iterations. Experimental results show that REA-Coder outperforms all advanced baselines on four LLMs across five programming benchmarks. Concretely, REA-Coder achieves average improvements of 7.93%, 30.25%, 26.75%, 8.59%, and 8.15% on the five benchmarks, demonstrating the effectiveness of requirement alignment for improving the code generation performance of LLMs.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot12212,
  title = {Aligning User Requirement with Large Language Model in Code Generation},
  author = {Jia Li and Ruiqi Bai and Yangkang Luo and Yiran Zhang and Wentao Yang and Zeyu Sun and Tiankuo Zhao and Dongming Jin and Lei Li and Zhi Jin},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3837487}
}