Synthical logo
Your space
From arXiv

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

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.
Updated on April 2, 2024
Copy BibTeX
Version history
Loading PDF…
There is no AI-powered summary yet, because we do not have a budget to generate summaries for all articles.
1. Buy subscription
We will thank you for helping thousands of people to save their time at the top of the generated summary.
If you buy our subscription, you will be able to summarize multiple articles.
Pay $undefined
≈10 summaries
Pay $undefined
≈60 summaries
2. Share on socials
If this article gets to top-5 in trends, we'll summarize it for free.
Copy link