Towards A Generalist Code Embedding Model Based On Massive Data Synthesis

Chao-Fan Li, Jianlyu Chen, Yingxia Shao, De-Fu Lian, Zheng Liu
5/1/2025
rag

No confident code implementation found for this paper.

Abstract

Code embedding models attract increasing attention due to the widespread popularity of retrieval-augmented generation (RAG) in software development. These models are expected to capture the rich semantic relationships inherent to code, which differ significantly from those found in text.

Show full abstract

However, existing models remain severely limited due to the scarcity of high-quality training data. In this work, we introduce \textbf{CodeR} (\underline{Code} \underline{R}etrieval), a state-of-the-art embedding model for general-purpose code retrieval. The superior performance of CodeR is built upon CodeR-Pile, a large-scale synthetic dataset constructed under the DRU (Diversity, Reliability, Usability) principle via a novel data synthesis pipeline. To optimize training effectiveness, we propose Annealing, a curriculum learning strategy that enables effective knowledge transfer across heterogeneous sources of data. We evaluate CodeR based on 16 diverse code retrieval tasks, where it significantly outperforms existing baselines and exhibits strong out-of-domain generalization performance. We have publicly released our code and the well-trained model to facilitate further research in this critical area. https://github.com/FlagOpen/FlagEmbedding/tree/master/research/BGE_Coder.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{li2025towards,
  title  = {Towards A Generalist Code Embedding Model Based On Massive Data Synthesis},
  author = {Chao-Fan Li and Jianlyu Chen and Yingxia Shao and De-Fu Lian and Zheng Liu},
  year   = {2025},
  eprint = {2505.12697},
  archivePrefix = {arXiv},
  doi    = {10.48550/arXiv.2505.12697},
  url    = {https://doi.org/10.48550/arXiv.2505.12697},
  journal = {Neural Information Processing Systems}
}

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/2505.12697.svg)](https://codeofpaper.com/paper/2505.12697)

Discussion