Bridging the Gap between User Intent and LLM: A Requirement Alignment Approach for Code Generation
Jia Li, Ruiqi Bai, Yangkang Luo, Yiran Zhang, Wentao Yang, Zeyu Sun, Tiankuo Zhao, Dongming Jin, Lei Li, and Zhi Jin

TL;DR
This paper introduces REA-Coder, a requirement alignment method that iteratively improves code generation accuracy from large language models by ensuring requirements are correctly understood and aligned.
Contribution
The paper presents a novel requirement alignment approach that enhances LLM-based code generation by iteratively aligning requirements and generated code, outperforming existing methods.
Findings
REA-Coder outperforms all baselines on five benchmarks.
Achieves average improvements of up to 30.25%.
Iterative requirement alignment improves code correctness.
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
