Enhancing Repository-Level Code Completion with Reinforcement Learning in Real-World Scenarios
Zhenlong Dai, Zhuoluo Zhao, Xiu Tang, Sai Wu, Chang Yao, Zhipeng Gao, Jingyuan Chen
Abstract
The rapid development of large language models (LLMs) for code, which closely aligns with the practical needs of real-world software development, has sparked growing attention in repository-level code completion. However, existing Code LLMs present challenges in focusing on suitable contexts from the repository and in deeply reasoning about cross-file dependencies. To address these challenges, we propose a novel reinforcement learning framework for repository-level code completion. To better understand both in-file and cross-file contexts, we employ identifier-driven intent recognition to capture completion intent, thereby improving the model's performance in real-world scenarios. To enhance cross-file reasoning, we propose a reward-driven completion learning to effectively reward in complex repository completion scenarios. To guide LLMs in completing code that aligns with intended functionality and repository context, we introduce a selective-exploration strategy that directs the model to focus on low-confidence, high-reward tokens, promoting the exploration of valuable, underexplored completion patterns. Experimental results show that our approach significantly improves the performance of Code LLMs. The code and the dataset are available at https://github.com/zhenlongDai/RepoCompletion.
Create a lesson
Metadata
- Comments
- Accepted by EMNLP 2026 Main
Related papers
KeyASRBench: Measuring Whole-Phrase Keyword Preservation in Real-World ASR
Shared title terminologycs.CLGuanzheng Wei, Ziyi Zhao
Evaluating Physically Grounded Procedural Reasoning in VLMs through Real-World Execution: Crochet as a Testbed
Shared title terminologycs.CLMaximiliano Wardle
Contextuality and Contradictions: Exploring Real-World Identifications of AI-Generated Writing
Shared title terminologycs.CLMichelle Morgenstern, Julia Witte Zimmerman, Tabia Tanzin Prama et al.
The Last Mile to the Real World: Agent-Native Primitives as Reusable Building Blocks for Solving Real-World Tasks
Shared title terminologycs.CLHaibo Jin, Peng Kuang, Xiaopeng Yuan et al.
Multimodal LLMs Know the Game but Assume the Real World
Shared title terminologycs.CLJianxin Gao, Bohan Chen, Runze Li et al.
Edit-Induced Dependency Mismatch: Propagation Omissions, Recovery, and Evaluation Blind Spots in Coding Agents
Shared title terminologycs.CLFei Ding