We gratefully acknowledge support from
the Simons Foundation and member institutions.
Full-text links:

Download:

Current browse context:

cs.CL

Change to browse by:

References & Citations

DBLP - CS Bibliography

Bookmark

(what is this?)
CiteULike logo BibSonomy logo Mendeley logo del.icio.us logo Digg logo Reddit logo

Computer Science > Computation and Language

Title: Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedback

Abstract: Large language models (LLMs) have shown remarkable progress in automated code generation. Yet, incorporating LLM-based code generation into real-life software projects poses challenges, as the generated code may contain errors in API usage, class, data structure, or missing project-specific information. As much of this project-specific context cannot fit into the prompts of LLMs, we must find ways to allow the model to explore the project-level code context. To this end, this paper puts forward a novel approach, termed ProCoder, which iteratively refines the project-level code context for precise code generation, guided by the compiler feedback. In particular, ProCoder first leverages compiler techniques to identify a mismatch between the generated code and the project's context. It then iteratively aligns and fixes the identified errors using information extracted from the code repository. We integrate ProCoder with two representative LLMs, i.e., GPT-3.5-Turbo and Code Llama (13B), and apply it to Python code generation. Experimental results show that ProCoder significantly improves the vanilla LLMs by over 80% in generating code dependent on project context, and consistently outperforms the existing retrieval-based code generation baselines.
Subjects: Computation and Language (cs.CL); Software Engineering (cs.SE)
Cite as: arXiv:2403.16792 [cs.CL]
  (or arXiv:2403.16792v2 [cs.CL] for this version)

Submission history

From: Zhangqian Bi [view email]
[v1] Mon, 25 Mar 2024 14:07:27 GMT (4725kb,D)
[v2] Tue, 2 Apr 2024 08:17:12 GMT (4732kb,D)

Link back to: arXiv, form interface, contact.