Class-Level Code Generation from Natural Language Using Iterative, Tool-Enhanced Reasoning over Repository
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
LLMs have demonstrated significant potential in code generation tasks, achieving promising results at the function or statement level across various benchmarks. However, the complexities associated with creating code artifacts like classes, particularly within the context of real-world software repositories, remain underexplored. Prior research treats class-level generation as an isolated task, neglecting the intricate dependencies & interactions that characterize real-world software environments. To address this gap, we introduce RepoClassBench, a comprehensive benchmark designed to rigorously evaluate LLMs in generating complex, class-level code within real-world repositories. RepoClassBench includes "Natural Language to Class generation" tasks across Java, Python & C# from a selection of repositories. We ensure that each class in our dataset not only has cross-file dependencies within the repository but also includes corresponding test cases to verify its functionality. We find that current models struggle with the realistic challenges posed by our benchmark, primarily due to their limited exposure to relevant repository contexts. To address this shortcoming, we introduce Retrieve-Repotools-Reflect (RRR), a novel approach that equips LLMs with static analysis tools to iteratively navigate & reason about repository-level context in an agent-based framework. Our experiments demonstrate that RRR significantly outperforms existing baselines on RepoClassBench, showcasing its effectiveness across programming languages & under various settings. Our findings emphasize the critical need for code-generation benchmarks to incorporate repo-level dependencies to more accurately reflect the complexities of software development. Our work shows the benefits of leveraging specialized tools to enhance LLMs' understanding of repository context. We plan to make our dataset & evaluation harness public.
Key facts. Cited by 14 papers in the map (data through 7 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 4 of its 26 references that are in the map. First posted on arXiv 22 Apr 2024.
Builds on
4 of 26 references.
References · 4
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
- 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 940
- 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
- 2021RetGen: A Joint framework for Retrieval and Grounded Text Generation Modelingcited by 22
Built on by
Citing papers per year: 2024: 3; 2025: 5; 2026: 6.
14 papers.
Sort:
By area:
- 2024Large Language Model-Based Agents for Software Engineering: A Surveycited by 173
- 2025Agent KB: Leveraging Cross-Domain Experience for Agentic Problem Solvingcited by 90
- 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databasescited by 62
- 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
- 2025OpenClassGen: A Large-Scale Corpus of Real-World Python Classes for LLM Researchcited by 3
- 2024On The Importance of Reasoning for Context Retrieval in Repository-Level Code Editingcited by 2
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
- 2025CodeChemist: Test-Time Scaling for Low-Resource Code Generation via Functional Knowledge Transfercited by 1
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptationcited by 1
- 2026FastCode: Fast and Cost-Efficient Code Understanding and Reasoningcited by 1
- 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASMLcited by 0
- 2026Talking to Itself While Coding: What Makes Comments Help Code Generation?8 Sep 2026
- 2026VITAL-RAG: Invariance Race for Context Allocation in Coding Agents29 Jul 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026FastCode: Fast and Cost-Efficient Code Understanding and Reasoning1 Mar 2026
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation8 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025CodeChemist: Test-Time Scaling for Low-Resource Code Generation via Functional Knowledge Transfer1 Oct 2025
- 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASML15 Sep 2025
- 2025Agent KB: Leveraging Cross-Domain Experience for Agentic Problem Solving8 Jul 2025
- 2025OpenClassGen: A Large-Scale Corpus of Real-World Python Classes for LLM Research22 Apr 2025
- 2024Large Language Model-Based Agents for Software Engineering: A Survey4 Sep 2024
- 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databasescited by 62
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2025OpenClassGen: A Large-Scale Corpus of Real-World Python Classes for LLM Researchcited by 3
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generationcited by 2
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptationcited by 1
- 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASMLcited by 0
- 2026Talking to Itself While Coding: What Makes Comments Help Code Generation?cited by 0
- 2026Talking to Itself While Coding: What Makes Comments Help Code Generation?8 Sep 2026
- 2026ClassEval-Pro: A Cross-Domain Benchmark for Class-Level Code Generation29 Apr 2026
- 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation8 Jan 2026
- 2026In Line with Context: Repository-Level Code Generation via Context Inlining1 Jan 2026
- 2025Evaluating Large Language Models for Functional and Maintainable Code in Industrial Settings: A Case Study at ASML15 Sep 2025
- 2025OpenClassGen: A Large-Scale Corpus of Real-World Python Classes for LLM Research22 Apr 2025
- 2024CodexGraph: Bridging Large Language Models and Code Repositories via Code Graph Databases7 Aug 2024
Similar, not cited
Close in wording, no citation either way
- 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
- 2026RepoZero: Can LLMs Generate a Code Repository from Scratch?
- 2025MRG-Bench: Evaluating and Exploring the Requirements of Context for Repository-Level Code Generation
- 2025Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generation
- 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositories
- 2025FastCoder: Accelerating Repository-level Code Generation via Efficient Retrieval and Verification
- 2026ReCUBE: Evaluating Repository-Level Context Utilization in Code Generation
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositories