RepoGenReflex: Enhancing Repository-Level Code Completion with Verbal Reinforcement and Retrieval-Augmented Generation
On the map: Retrieval-augmented generation → RAG for code
Abstract (arXiv)
In real-world software engineering tasks, solving a problem often requires understanding and modifying multiple functions, classes, and files across a large codebase. Therefore, on the repository level, it is crucial to extract the relevant information to achieve accurate code completion effectively. Existing code completion tools have achieved some success, but they struggle to optimize the retrieval and generation process dynamically. In this paper, we propose RepoGenReflex, a generic, dynamic, effective framework to address this challenge. By leveraging the Retrieval-Augmented Generation (RAG) enhanced with Verbal Reinforcement Learning (VRL), it can dynamically choose the optimal results for repository-level code completion. RepoGenReflex uses Reflector to give directional feedback to the next loop. RepoGenReflex chooses the optimal results stored in the Experience cache based on the RAG-VRL loop. To validate the framework's generalization ability, we propose a new benchmark RepoGenEval, which consists of the latest, high-quality real-world repositories in line completion scenarios. Our experiments demonstrate that RepoGenReflex achieves significant improvements after optimizing the Reflector component, resulting in enhanced accuracy and relevance of code completions. Additionally, RepoGenReflex consistently demonstrates superior performance and effectiveness across standard code completion tasks, highlighting the robustness and adaptability of our framework.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 15 of its 32 references that are in the map. First posted on arXiv 19 Sep 2024.
Builds on
15 of 32 references.
Closest ancestors · 3
Same direction, newest first
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completion15 Mar
- 2021Retrieval Augmented Code Generation and Summarization26 Aug
- 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNN9 Jun
Other references · 12
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,193
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 357
- 2020Generation-Augmented Retrieval for Open-domain Question Answeringcited by 186
- 2023LongCoder: A Long-Range Pre-trained Language Model for Code Completioncited by 110
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2021CoTexT: Multi-task Learning with Code-Text Transformercited by 61
- 2019Pythia: AI-assisted Code Completion Systemcited by 54
- 2022CodeFill: Multi-token Code Completion by Jointly Learning from Structure and Naming Sequencescited by 49
- 2024RLCoder: Reinforcement Learning for Repository-Level Code Completioncited by 44
Built on by
Citing papers per year: 2025: 4; 2026: 2.
6 papers.
- 2025A Survey of Reinforcement Learning for Large Reasoning Modelscited by 175
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approachescited by 20
- 2025A Survey on Agentic Multimodal Large Language Modelscited by 19
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligencecited by 13
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
- 2026Code Generation by Differential Test Time Scalingcited by 1
- 2026Code Generation by Differential Test Time Scaling19 May 2026
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2025From Code Foundation Models to Agents and Applications: A Comprehensive Survey and Practical Guide to Code Intelligence23 Nov 2025
- 2025A Survey on Agentic Multimodal Large Language Models13 Oct 2025
- 2025Retrieval-Augmented Code Generation: A Survey with Focus on Repository-Level Approaches6 Oct 2025
- 2025A Survey of Reinforcement Learning for Large Reasoning Models10 Sep 2025
Similar, not cited
Close in wording, no citation either way
- 2026RepoShapley: Shapley-Enhanced Context Filtering for Repository-Level Code Completion
- 2022ReACC: A Retrieval-Augmented Code Completion Framework
- 2024Prompt-based Code Completion via Multi-Retrieval Augmented Generation
- 2025SaraCoder: Orchestrating Semantic and Structural Cues for Resource-Optimized Repository-Level Code Completion
- 2024GraphCoder: Enhancing Repository-Level Code Completion via Code Context Graph-based Retrieval and Language Model
- 2025One Tool Is Enough: Reinforcement Learning for Repository-Level LLM Agents
- 2025CoRoVA: Compressed Representations for Vector-Augmented Code Completion
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completion