mlsanityData to 14 Oct 2026

ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generation

arXiv 2509.02330 ↗First posted 2 Sep 2025cs.SE cs.AIcited by 6

On the map: Retrieval-augmented generation → RAG for code

Abstract (arXiv)

Recent advances in large language models (LLMs) have demonstrated impressive capabilities in code-related tasks, such as code generation and automated program repair. Despite their promising performance, most existing approaches for code repair suffer from high training costs or computationally expensive inference. Retrieval-augmented generation (RAG), with its efficient in-context learning paradigm, offers a more scalable alternative. However, conventional retrieval strategies, which are often based on holistic code-text embeddings, fail to capture the structural intricacies of code, resulting in suboptimal retrieval quality. To address the above limitations, we propose ReCode, a fine-grained retrieval-augmented in-context learning framework designed for accurate and efficient code repair. Specifically, ReCode introduces two key innovations: (1) an algorithm-aware retrieval strategy that narrows the search space using preliminary algorithm type predictions; and (2) a modular dual-encoder architecture that separately processes code and textual inputs, enabling fine-grained semantic matching between input and retrieved contexts. Furthermore, we propose RACodeBench, a new benchmark constructed from real-world user-submitted buggy code, which addresses the limitations of synthetic benchmarks and supports realistic evaluation. Experimental results on RACodeBench and competitive programming datasets demonstrate that ReCode achieves higher repair accuracy with significantly reduced inference cost, highlighting its practical value for real-world code repair scenarios.

Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 31 of its 49 references that are in the map. First posted on arXiv 2 Sep 2025.

Builds on

31 of 49 references.

References · 31

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  3. 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
  4. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  5. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  6. 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,724
  7. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  8. 2024DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Modelcited by 1,135
  9. 2023Teaching Large Language Models to Self-Debugcited by 988
  10. 2021Measuring Coding Challenge Competence With APPScited by 902
  11. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  12. 2023An Empirical Study of Catastrophic Forgetting in Large Language Models During Continual Fine-tuningcited by 639
19 more
  1. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
  2. 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 358
  3. 2024DeepSeek-Coder-V2: Breaking the Barrier of Closed-Source Models in Code Intelligencecited by 331
  4. 2024Many-Shot In-Context Learningcited by 206
  5. 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 197
  6. 2024The Effect of Sampling Temperature on Problem Solving in Large Language Modelscited by 170
  7. 2024Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-stepcited by 127
  8. 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 111
  9. 2023Improving Code Generation by Training with Natural Language Feedbackcited by 76
  10. 2023A Survey of Learning-based Automated Program Repaircited by 55
  11. 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
  12. 2018CODIT: Code Editing with Tree-Based Neural Modelscited by 40
  13. 2020Synthesize, Execute and Debug: Learning to Repair for Neural Program Synthesiscited by 39
  14. 2024ThinkRepair: Self-Directed Automated Program Repaircited by 23
  15. 2023Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errorscited by 22
  16. 2018Practical Program Repair via Bytecode Mutationcited by 19
  17. 2025AuPair: Golden Example Pairs for Code Repaircited by 3
  18. 2022Neural Program Repair: Systems, Challenges and Solutionscited by 2
  19. 2025OASIS: Order-Augmented Strategy for Improved Code Searchcited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 2; 2026: 4.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024Repoformer: Selective Retrieval for Repository-Level Code Completion
  2. 2024Retrieval-augmented code completion for local projects using large language models
  3. 2025Accelerating Automatic Program Repair with Dual Retrieval-Augmented Fine-Tuning and Patch Generation on Large Language Models
  4. 2023RAP-Gen: Retrieval-Augmented Patch Generation with CodeT5 for Automatic Program Repair
  5. 2025SACL: Understanding and Combating Textual Bias in Code Retrieval with Semantic-Augmented Reranking and Localization
  6. 2025What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond
  7. 2024Context-Augmented Code Generation Using Programming Knowledge Graphs
  8. 2026Improving LLM-Assisted Secure Code Generation through Retrieval-Augmented-Generation and Multi-Tool Feedback