CoRet: Improved Retriever for Code Editing
Fabio Fehr, Prabhu Teja Sivaprasad, Luca Franceschi, Giovanni Zappella

TL;DR
CoRet is a novel dense retrieval model that enhances code editing by integrating code semantics, repository structure, and call graph dependencies to improve retrieval accuracy for natural language queries.
Contribution
The paper introduces CoRet, a new retrieval model with a specialized loss function, significantly improving code repository retrieval performance for code editing tasks.
Findings
Improves retrieval recall by at least 15 percentage points on benchmark datasets.
Effectively integrates code semantics, structure, and call graphs.
Demonstrates the importance of design choices through ablation studies.
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsNatural Language Processing Techniques
