Enhancing Repository-Level Code Completion with Reinforcement Learning in Real-World Scenarios

Zhenlong Dai, Zhuoluo Zhao, Xiu Tang, Sai Wu, Chang Yao +2 more
11/5/2026
1 citation
cs.CL
rl

Official code: zhenlongDai/RepoCompletion (0 stars, Python, last commit 2026-08-25).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

00Python, ShellApr 26, 20253 months ago

Similar Papers

Cite this paper

@article{dai2026enhancing,
  title  = {Enhancing Repository-Level Code Completion with Reinforcement Learning in Real-World Scenarios},
  author = {Zhenlong Dai and Zhuoluo Zhao and Xiu Tang and Sai Wu and Chang Yao and Zhipeng Gao and Jingyuan Chen},
  year   = {2026},
  eprint = {2611.07510},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.07510v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.07510.svg)](https://codeofpaper.com/paper/2611.07510)

Discussion