CoRet: Improved Retriever for Code Editing

Fabio Fehr, Prabhu Teja Sivaprasad, Luca Franceschi, Giovanni Zappella
5/30/2025
cs.LGcs.AIcs.CL

No confident code implementation found for this paper.

Abstract

In this paper, we introduce CoRet, a dense retrieval model designed for code-editing tasks that integrates code semantics, repository structure, and call graph dependencies. The model focuses on retrieving relevant portions of a code repository based on natural language queries such as requests to implement new features or fix bugs. These retrieved code chunks can then be presented to a user or to a second code-editing model or agent. To train CoRet, we propose a loss function explicitly designed for repository-level retrieval. On SWE-bench and Long Code Arena's bug localisation datasets, we show that our model substantially improves retrieval recall by at least 15 percentage points over existing models, and ablate the design choices to show their importance in achieving these results.

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{fehr2025coret,
  title  = {CoRet: Improved Retriever for Code Editing},
  author = {Fabio Fehr and Prabhu Teja Sivaprasad and Luca Franceschi and Giovanni Zappella},
  year   = {2025},
  eprint = {2505.24715},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.24715v1}
}

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

Discussion