mlsanityData to 7 Oct 2026

Class-Level Code Generation from Natural Language Using Iterative, Tool-Enhanced Reasoning over Repository

arXiv 2405.01573 ↗First posted 22 Apr 2024cs.SE cs.AIcited by 14

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

  1. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,154
  2. 2022Atlas: Few-shot Learning with Retrieval Augmented Language Modelscited by 940
  3. 2022Multi-lingual Evaluation of Code Generation Modelscited by 158
  4. 2021RetGen: A Joint framework for Retrieval and Grounded Text Generation Modelingcited by 22

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 3; 2025: 5; 2026: 6.

14 papers.

Sort:

By area:

Similar, not cited

Close in wording, no citation either way

  1. 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
  2. 2026RepoZero: Can LLMs Generate a Code Repository from Scratch?
  3. 2025MRG-Bench: Evaluating and Exploring the Requirements of Context for Repository-Level Code Generation
  4. 2025Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generation
  5. 2024DevEval: A Manually-Annotated Code Generation Benchmark Aligned with Real-World Code Repositories
  6. 2025FastCoder: Accelerating Repository-level Code Generation via Efficient Retrieval and Verification
  7. 2026ReCUBE: Evaluating Repository-Level Context Utilization in Code Generation
  8. 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositories