Iterative Refinement of Project-Level Code Context for Precise Code Generation with Compiler Feedback
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have shown remarkable progress in automated code generation. Yet, LLM-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. We present CoCoGen, a new code generation approach that uses compiler feedback to improve the LLM-generated code. CoCoGen first leverages static analysis to identify mismatches 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 CoCoGen 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 CoCoGen significantly improves the vanilla LLMs by over 80% in generating code dependent on the project context and consistently outperforms the existing retrieval-based code generation baselines.
Key facts. Cited by 45 papers in the map (data through 7 Oct 2026). Builds on 28 of its 58 references that are in the map. First posted on arXiv 25 Mar 2024.
Builds on
28 of 58 references.
References · 28
- 2017Attention Is All You Needcited by 59,932
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023Teaching Large Language Models to Self-Debugcited by 963
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023Large Language Models Can Be Easily Distracted by Irrelevant Contextcited by 820
- 2023StarCoder: may the source be with you!cited by 790
16 more
- 2024DeepSeek LLM: Scaling Open-Source Language Models with Longtermismcited by 621
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2023RepoBench: Benchmarking Repository-Level Code Auto-Completion Systemscited by 346
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 181
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 166
- 2022Natural Language to Code Translation with Executioncited by 122
- 2022ReACC: A Retrieval-Augmented Code Completion Frameworkcited by 117
- 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 110
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2022Coder Reviewer Reranking for Code Generationcited by 83
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 64
- 2022When Language Model Meets Private Librarycited by 54
- 2024DevEval: Evaluating Code Generation in Practical Software Projectscited by 9
- 2021Learning to Generate Code Comments from Class Hierarchiescited by 5
- 2021Embedding API Dependency Graph for Neural Code Generationcited by 5
Built on by
Citing papers per year: 2024: 6; 2025: 25; 2026: 14.
45 papers.
Sort:
By area:
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2025AI Agentic Programming: A Survey of Techniques, Challenges, and Opportunitiescited by 26
- 2024RethinkMCTS: Refining Erroneous Thoughts in Monte Carlo Tree Search for Code Generationcited by 25
- 2024The Future of AI-Driven Software Engineeringcited by 23
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyondcited by 22
- 2024CodeIP: A Grammar-Guided Multi-Bit Watermark for Large Language Models of Codecited by 21
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 20
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2025Exploring the Potential of Diffusion Large Language Models in Code Generationcited by 16
- 2025How Far Are AI Scientists from Changing the World?cited by 15
- 2024Hierarchical Context Pruning: Optimizing Real-World Code Completion with Repository-Level Pretrained Code LLMscited by 13
- 2025Theorem Prover as a Judge for Synthetic Data Generationcited by 13
33 more
- 2025AIR: Complex Instruction Generation via Automatic Iterative Refinementcited by 10
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2026SWE-QA-Pro: A Representative Benchmark and Scalable Training Recipe for Repository-Level Code Understandingcited by 9
- 2025CODESYNC: Synchronizing Large Language Models with Dynamic Code Evolution at Scalecited by 8
- 2024C2: Scalable Auto-Feedback for LLM-based Chart Generationcited by 6
- 2025QCoder Benchmark: Bridging Language Generation and Quantum Hardware through Simulator-Based Feedbackcited by 6
- 2025Towards Realistic Project-Level Code Generation via Multi-Agent Collaboration and Semantic Architecture Modelingcited by 6
- 2025Enhancing Project-Specific Code Completion by Inferring Internal API Informationcited by 5
- 2025VecTrans: Enhancing Compiler Auto-Vectorization through LLM-Assisted Code Transformationscited by 4
- 2025CodeEvo: Interaction-Driven Synthesis of Code-centric Data through Hybrid and Iterative Feedbackcited by 4
- 2025Prompt to Pwn: Automated Exploit Generation for Smart Contractscited by 4
- 2025A Human-AI Collaborative Workflow for Mathematical Discovery: A Case Study in Grover-Compatible Riemannian Optimizationcited by 4
- 2025Integrating Expert Knowledge into Logical Programs via LLMscited by 3
- 2025CodeSSM: Towards State Space Models for Code Understandingcited by 3
- 2025Entropy-Guided Loop: Achieving Reasoning through Uncertainty-Aware Generationcited by 2
- 2025TENET: One Step Toward Test-Driven Development for Repository-Level Code Generationcited by 2
- 2025textttReMind: Understanding Deductive Code Reasoning in LLMscited by 2
- 2026RM -RF: Reward Model for Run-Free Unit Test Evaluationcited by 2
- 2025Deployability-Centric Infrastructure-as-Code Generation: Fail, Learn, Refine, and Succeed through LLM-Empowered DevOps Simulationcited by 1
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compilercited by 1
- 2026Can AI Agents Generate Microservices? How Far are We?cited by 1
- 2026Persistent Cross-Attempt State Optimization for Repository-Level Code Generationcited by 1
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learningcited by 1
- 2025How to Select Pre-Trained Code Models for Reuse? A Learning Perspectivecited by 0
- 2025TGPR: Tree-Guided Policy Refinement for Robust Self-Debugging of LLMscited by 0
- 2025DebugTA: An LLM-Based Agent for Simplifying Debugging and Teaching in Programming Educationcited by 0
- 2026The New Compiler Stack: A Survey on the Synergy of LLMs and Compilerscited by 0
- 2026Hydra: Efficient, Correct Code Generation via Checkpoint-and-Rollback Supportcited by 0
- 2026Microskill Architecture: A Modular Skill-Driven Framework for AI-Native Code Generationcited by 0
- 2026Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Codecited by 0
- 2026Benchmarking LLMs for Verilog Design Flowscited by 0
- 2026Do Uncertainty Signals Help? A Systematic Study of Uncertainty-Aware Decoding with Rollback Mechanismscited by 0
- 2026ReMCTS: Reflection-Enhanced Monte Carlo Tree Search for Code Generationcited by 0
- 2026ReMCTS: Reflection-Enhanced Monte Carlo Tree Search for Code Generation28 Sep 2026
- 2026Do Uncertainty Signals Help? A Systematic Study of Uncertainty-Aware Decoding with Rollback Mechanisms31 Jul 2026
- 2026Benchmarking LLMs for Verilog Design Flows23 Jul 2026
- 2026Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Code15 Jul 2026
- 2026Microskill Architecture: A Modular Skill-Driven Framework for AI-Native Code Generation4 Jun 2026
- 2026Hydra: Efficient, Correct Code Generation via Checkpoint-and-Rollback Support14 May 2026
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learning22 Apr 2026
- 2026Persistent Cross-Attempt State Optimization for Repository-Level Code Generation4 Apr 2026
- 2026SWE-QA-Pro: A Representative Benchmark and Scalable Training Recipe for Repository-Level Code Understanding17 Mar 2026
- 2026Can AI Agents Generate Microservices? How Far are We?9 Mar 2026
- 2026RM -RF: Reward Model for Run-Free Unit Test Evaluation19 Jan 2026
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compiler17 Jan 2026
33 more
- 2026The New Compiler Stack: A Survey on the Synergy of LLMs and Compilers5 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025A Human-AI Collaborative Workflow for Mathematical Discovery: A Case Study in Grover-Compatible Riemannian Optimization10 Dec 2025
- 2025Towards Realistic Project-Level Code Generation via Multi-Agent Collaboration and Semantic Architecture Modeling5 Nov 2025
- 2025textttReMind: Understanding Deductive Code Reasoning in LLMs1 Nov 2025
- 2025QCoder Benchmark: Bridging Language Generation and Quantum Hardware through Simulator-Based Feedback30 Oct 2025
- 2025DebugTA: An LLM-Based Agent for Simplifying Debugging and Teaching in Programming Education13 Oct 2025
- 2025TGPR: Tree-Guided Policy Refinement for Robust Self-Debugging of LLMs8 Oct 2025
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025TENET: One Step Toward Test-Driven Development for Repository-Level Code Generation29 Sep 2025
- 2025Exploring the Potential of Diffusion Large Language Models in Code Generation14 Sep 2025
- 2025Entropy-Guided Loop: Achieving Reasoning through Uncertainty-Aware Generation26 Aug 2025
- 2025AI Agentic Programming: A Survey of Techniques, Challenges, and Opportunities15 Aug 2025
- 2025Prompt to Pwn: Automated Exploit Generation for Smart Contracts2 Aug 2025
- 2025How Far Are AI Scientists from Changing the World?31 Jul 2025
- 2025Enhancing Project-Specific Code Completion by Inferring Internal API Information28 Jul 2025
- 2025CodeEvo: Interaction-Driven Synthesis of Code-centric Data through Hybrid and Iterative Feedback25 Jul 2025
- 2025Deployability-Centric Infrastructure-as-Code Generation: Fail, Learn, Refine, and Succeed through LLM-Empowered DevOps Simulation5 Jun 2025
- 2025CodeSSM: Towards State Space Models for Code Understanding2 May 2025
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond26 Mar 2025
- 2025VecTrans: Enhancing Compiler Auto-Vectorization through LLM-Assisted Code Transformations25 Mar 2025
- 2025AIR: Complex Instruction Generation via Automatic Iterative Refinement25 Feb 2025
- 2025CODESYNC: Synchronizing Large Language Models with Dynamic Code Evolution at Scale23 Feb 2025
- 2025Theorem Prover as a Judge for Synthetic Data Generation18 Feb 2025
- 2025Integrating Expert Knowledge into Logical Programs via LLMs17 Feb 2025
- 2025How to Select Pre-Trained Code Models for Reuse? A Learning Perspective7 Jan 2025
- 2024C2: Scalable Auto-Feedback for LLM-based Chart Generation24 Oct 2024
- 2024RethinkMCTS: Refining Erroneous Thoughts in Monte Carlo Tree Search for Code Generation15 Sep 2024
- 2024Hierarchical Context Pruning: Optimizing Real-World Code Completion with Repository-Level Pretrained Code LLMs26 Jun 2024
- 2024The Future of AI-Driven Software Engineering11 Jun 2024
- 2024A Survey on Large Language Models for Code Generation1 Jun 2024
- 2024CodeIP: A Grammar-Guided Multi-Bit Watermark for Large Language Models of Code24 Apr 2024
- 2025AI Agentic Programming: A Survey of Techniques, Challenges, and Opportunitiescited by 26
- 2026SWE-QA-Pro: A Representative Benchmark and Scalable Training Recipe for Repository-Level Code Understandingcited by 9
- 2025Towards Realistic Project-Level Code Generation via Multi-Agent Collaboration and Semantic Architecture Modelingcited by 6
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compilercited by 1
- 2026Can AI Agents Generate Microservices? How Far are We?cited by 1
- 2025DebugTA: An LLM-Based Agent for Simplifying Debugging and Teaching in Programming Educationcited by 0
- 2026Microskill Architecture: A Modular Skill-Driven Framework for AI-Native Code Generationcited by 0
- 2026Microskill Architecture: A Modular Skill-Driven Framework for AI-Native Code Generation4 Jun 2026
- 2026SWE-QA-Pro: A Representative Benchmark and Scalable Training Recipe for Repository-Level Code Understanding17 Mar 2026
- 2026Can AI Agents Generate Microservices? How Far are We?9 Mar 2026
- 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compiler17 Jan 2026
- 2025Towards Realistic Project-Level Code Generation via Multi-Agent Collaboration and Semantic Architecture Modeling5 Nov 2025
- 2025DebugTA: An LLM-Based Agent for Simplifying Debugging and Teaching in Programming Education13 Oct 2025
- 2025AI Agentic Programming: A Survey of Techniques, Challenges, and Opportunities15 Aug 2025
- 2024RethinkMCTS: Refining Erroneous Thoughts in Monte Carlo Tree Search for Code Generationcited by 25
- 2025Theorem Prover as a Judge for Synthetic Data Generationcited by 13
- 2025Integrating Expert Knowledge into Logical Programs via LLMscited by 3
- 2025Entropy-Guided Loop: Achieving Reasoning through Uncertainty-Aware Generationcited by 2
- 2025textttReMind: Understanding Deductive Code Reasoning in LLMscited by 2
- 2025TGPR: Tree-Guided Policy Refinement for Robust Self-Debugging of LLMscited by 0
- 2025textttReMind: Understanding Deductive Code Reasoning in LLMs1 Nov 2025
- 2025TGPR: Tree-Guided Policy Refinement for Robust Self-Debugging of LLMs8 Oct 2025
- 2025Entropy-Guided Loop: Achieving Reasoning through Uncertainty-Aware Generation26 Aug 2025
- 2025Theorem Prover as a Judge for Synthetic Data Generation18 Feb 2025
- 2025Integrating Expert Knowledge into Logical Programs via LLMs17 Feb 2025
- 2024RethinkMCTS: Refining Erroneous Thoughts in Monte Carlo Tree Search for Code Generation15 Sep 2024
- 2024A Survey on Large Language Models for Code Generationcited by 646
- 2024The Future of AI-Driven Software Engineeringcited by 23
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2025Exploring the Potential of Diffusion Large Language Models in Code Generationcited by 16
- 2025How Far Are AI Scientists from Changing the World?cited by 15
- 2024Hierarchical Context Pruning: Optimizing Real-World Code Completion with Repository-Level Pretrained Code LLMscited by 13
- 2025AIR: Complex Instruction Generation via Automatic Iterative Refinementcited by 10
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2024C2: Scalable Auto-Feedback for LLM-based Chart Generationcited by 6
- 2025QCoder Benchmark: Bridging Language Generation and Quantum Hardware through Simulator-Based Feedbackcited by 6
- 2025Enhancing Project-Specific Code Completion by Inferring Internal API Informationcited by 5
- 2025VecTrans: Enhancing Compiler Auto-Vectorization through LLM-Assisted Code Transformationscited by 4
12 most cited of 28 All 28 (JSON)
- 2026ReMCTS: Reflection-Enhanced Monte Carlo Tree Search for Code Generation28 Sep 2026
- 2026Do Uncertainty Signals Help? A Systematic Study of Uncertainty-Aware Decoding with Rollback Mechanisms31 Jul 2026
- 2026Benchmarking LLMs for Verilog Design Flows23 Jul 2026
- 2026Generative Compilation: On-the-Fly Compiler Feedback as AI Generates Code15 Jul 2026
- 2026Hydra: Efficient, Correct Code Generation via Checkpoint-and-Rollback Support14 May 2026
- 2026WebGen-R1: Incentivizing Large Language Models to Generate Functional and Aesthetic Websites with Reinforcement Learning22 Apr 2026
- 2026Persistent Cross-Attempt State Optimization for Repository-Level Code Generation4 Apr 2026
- 2026RM -RF: Reward Model for Run-Free Unit Test Evaluation19 Jan 2026
- 2026The New Compiler Stack: A Survey on the Synergy of LLMs and Compilers5 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025A Human-AI Collaborative Workflow for Mathematical Discovery: A Case Study in Grover-Compatible Riemannian Optimization10 Dec 2025
- 2025QCoder Benchmark: Bridging Language Generation and Quantum Hardware through Simulator-Based Feedback30 Oct 2025
12 newest of 28 All 28 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2025MRG-Bench: Evaluating and Exploring the Requirements of Context for Repository-Level Code Generation
- 2026When LLMs Lag Behind: Knowledge Conflicts from Evolving APIs in Code Generation
- 2024De-Hallucinator: Mitigating LLM Hallucinations in Code Generation Tasks via Iterative Grounding
- 2025Completion by Comprehension: Guiding Code Generation with Multi-Granularity Understanding
- 2024A Comprehensive Framework for Evaluating API-oriented Code Generation in Large Language Models
- 2025Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generation
- 2026ReCUBE: Evaluating Repository-Level Context Utilization in Code Generation
- 2025OpenClassGen: A Large-Scale Corpus of Real-World Python Classes for LLM Research