Enhancing Code Generation via Bidirectional Comment-Level Mutual Grounding
Yifeng Di, Tianyi Zhang

TL;DR
This paper introduces an interactive method using code comments to improve the accuracy of code generated by large language models, enhancing developer trust and productivity through mutual grounding.
Contribution
It proposes a novel comment-based iterative grounding approach that aligns LLM-generated code with developer intent, significantly improving code correctness and user efficiency.
Findings
17.1% pass@1 improvement on HumanEval benchmark
Participants completed tasks 16.7% faster
10.5% higher success rate with the proposed method
Abstract
Large Language Models (LLMs) have demonstrated unprecedented capability in code generation. However, LLM-generated code is still plagued with a wide range of functional errors, especially for complex programming tasks that LLMs have not seen before. Recent studies have shown that developers often struggle with inspecting and fixing incorrect code generated by LLMs, diminishing their productivity and trust in LLM-based code generation. Inspired by the mutual grounding theory in communication, we propose an interactive approach that leverages code comments as a medium for developers and LLMs to establish a shared understanding. Our approach facilitates iterative grounding by interleaving code generation, inline comment generation, and contextualized user feedback through editable comments to align generated code with developer intent. We evaluated our approach on two popular benchmarks…
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 · Topic Modeling · Artificial Intelligence in Healthcare and Education
MethodsALIGN
