# RLCoder

A reinforcement-learning framework for repository-level code completion that trains a retriever to select reference code snippets that actually help generation, rather than merely similar ones.

RLCoder is the implementation accompanying an ICSE 2025 paper on reinforcement learning for repository-level code completion. Its core module, RLRetriever, is a retriever trained to disregard reference code snippets that look relevant but do not help generate correct completions, instead favoring ones that do.

The repository includes training scripts and several ablation configurations, such as disabling the stop signal or the perplexity weighting, plus a variant combined with RepoCoder. Trained retriever weights and the training and evaluation datasets are distributed separately. The code is written in Python.

Website: https://github.com/DeepSoftwareAnalytics/RLCoder
