Fixing Large Language Models' Specification Misunderstanding for Better Code Generation
Zhao Tian, Junjie Chen, Xiangyu Zhang

TL;DR
This paper introduces {}FiX, a novel prompting technique that enhances large language models' code generation by improving their understanding of specifications through test case analysis and feedback, leading to significant performance gains.
Contribution
It proposes a new {}FiX prompting method that combines thought-eliciting and feedback-based prompts, and explores their synergy to better align LLMs with programming specifications.
Findings
{}FiX significantly improves code generation accuracy.
It outperforms 15 baselines on six benchmarks.
Effective for models like ChatGPT and DeepSeek-Coder.
Abstract
Code generation is to automatically generate source code conforming to a given programming specification, which has received extensive attention especially with the development of large language models (LLMs). Due to the inherent difficulty of code generation, the code generated by LLMs may not be aligned with the specification. Although thought-eliciting prompting techniques have been proposed to enhance the code generation performance of LLMs, producing correct understanding for complicated programming problems remains challenging, resulting in unsatisfactory performance. Also, some feedback-based prompting techniques have been proposed to fix incorrect code using error messages produced by test execution. However, when the generated code deviates significantly from the ground truth, they encounter difficulties in improving performance based on such coarse-grained information. In this…
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.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Software Engineering Techniques and Practices
