CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking
Not on the map. Why?
Abstract (arXiv)
Effective code retrieval plays a crucial role in advancing code generation, bug fixing, and software maintenance, particularly as software systems increase in complexity. While current code embedding models have demonstrated promise in retrieving code snippets for small-scale, well-defined tasks, they often underperform in more demanding real-world applications such as bug localization within GitHub repositories. We hypothesize that a key issue is their reliance on noisy and inconsistent datasets for training, which impedes their ability to generalize to more complex retrieval scenarios. To address these limitations, we introduce CoRNStack, a large-scale, high-quality contrastive training dataset for code that spans multiple programming languages. This dataset is curated using consistency filtering to eliminate noisy positives and is further enriched with mined hard negatives, thereby facilitating more effective learning. We demonstrate that contrastive training of embedding models using CoRNStack leads to state-of-the-art performance across a variety of code retrieval tasks. Furthermore, the dataset can be leveraged for training code reranking models, a largely underexplored area compared to text reranking. Our finetuned code reranking model significantly improves the ranking quality over the retrieved results. Finally, by employing our code retriever and reranker together, we demonstrate significant improvements in function localization for GitHub issues, an important component of real-world software development.
Key facts. Cited by 37 papers in the map (data through 14 Oct 2026). Builds on 41 of its 46 references that are in the map. First posted on arXiv 1 Dec 2024.
Builds on
41 of 46 references.
References · 41
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,777
- 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,513
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2016MS MARCO: A Human Generated MAchine Reading COmprehension Datasetcited by 1,605
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2018FEVER: a large-scale dataset for Fact Extraction and VERificationcited by 1,375
- 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,253
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
29 more
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
- 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 421
- 2020Document Ranking with a Pretrained Sequence-to-Sequence Modelcited by 376
- 2023Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agentscited by 360
- 2022The Stack: 3 TB of permissively licensed source codecited by 359
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
- 2023Large Language Models are Effective Text Rankers with Pairwise Ranking Promptingcited by 307
- 2023Improving Text Embeddings with Large Language Modelscited by 303
- 2024Nomic Embed: Training a Reproducible Long Context Text Embeddercited by 265
- 2023RankZephyr: Effective and Robust Zero-Shot Listwise Reranking is a Breeze!cited by 155
- 2022RankT5: Fine-Tuning T5 for Text Ranking with Ranking Lossescited by 115
- 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 91
- 2023Beyond Yes and No: Improving Zero-Shot LLM Rankers via Scoring Fine-Grained Relevance Labelscited by 86
- 2024NV-Retriever: Improving text embedding models with effective hard-negative miningcited by 84
- 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 75
- 2024SynCode: LLM Generation with Grammar Augmentationcited by 69
- 2024Arctic-Embed: Scalable, Efficient, and Accurate Text Embedding Modelscited by 61
- 2024CoIR: A Comprehensive Benchmark for Code Information Retrieval Modelscited by 60
- 2024FIRST: Faster Improved Listwise Reranking with Single Token Decodingcited by 54
- 2023Open-source Large Language Models are Strong Zero-shot Query Likelihood Models for Document Rankingcited by 44
- 2023Jina Embeddings: A Novel Set of High-Performance Sentence Embedding Modelscited by 35
- 2024Code Representation Learning At Scalecited by 26
- 2022CodeRetriever: Unimodal and Bimodal Contrastive Learning for Code Searchcited by 21
- 2022Neural Re-ranking in Multi-stage Recommender Systems: A Reviewcited by 20
- 2024Is The Watermarking Of LLM-Generated Code Robust?cited by 8
- 2022Learning List-Level Domain-Invariant Representations for Rankingcited by 4
Built on by
Citing papers per year: 2025: 15; 2026: 22.
37 papers.
Sort:
By area:
- 2025jina-embeddings-v4: Universal Embeddings for Multimodal Multilingual Retrievalcited by 76
- 2025CRANE: Reasoning with constrained LLM generationcited by 38
- 2025Improving Code Localization with Repository Memorycited by 20
- 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesiscited by 16
- 2025FreshStack: Building Realistic Benchmarks for Evaluating Retrieval on Technical Documentscited by 15
- 2025VeriCoder: Enhancing LLM-Based RTL Code Generation through Functional Correctness Validationcited by 13
- 2026AfriqueLLM: How Data Mixing and Model Architecture Impact Continued Pre-training for African Languagescited by 12
- 2026CORE-Bench: A Comprehensive Benchmark for Code Retrieval in the Era of Agentic Codingcited by 7
- 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrievalcited by 6
- 2025Agentic Software Issue Resolution with Large Language Models: A Surveycited by 6
- 2026DenseOn with the LateOn: Fully Open Dense and Late-Interaction Models for Multilingual, Long-Context, and Code Searchcited by 6
- 2026SWE-Adept: An LLM-Based Agentic Framework for Deep Codebase Analysis and Structured Issue Resolutioncited by 4
25 more
- 2025Multi-View Encoders for Performance Prediction in LLM-Based Agentic Workflowscited by 3
- 2025CoRet: Improved Retriever for Code Editingcited by 3
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Surveycited by 3
- 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programmingcited by 2
- 2026LLM-Confidence Reranker: A Training-Free Approach for Enhancing Retrieval-Augmented Generation Systemscited by 2
- 2026On the Challenges and Opportunities of Learned Sparse Retrieval for Codecited by 2
- 2026SHERLOC: Structured Diagnostic Localization for Code Repair Agentscited by 2
- 2026Are We Measuring Strategy or Phrasing? The Gap Between Surface- and Approach-Level Diversity in LLM Math Reasoningcited by 2
- 2026Agent Retrieval Bench: Evaluating Repository Context Retrieval for Coding Agentscited by 2
- 2025LLMs as Packagers of HPC Softwarecited by 1
- 2025SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localizationcited by 1
- 2026Lost in Transcription: How Speech-to-Text Errors Derail Code Understandingcited by 1
- 2026ATLAS: Scaffold-Free Algorithm Synthesis by LLMs via Embedding-Guided Quality-Diversity Searchcited by 1
- 2025Agentic Reinforcement Learning for Real-World Code Repaircited by 0
- 2026Learning Adaptive Parallel Execution for Efficient Code Localizationcited by 0
- 2026GREPO: A Benchmark for Graph Neural Networks on Repository-Level Bug Localizationcited by 0
- 2026Evo-Retriever: LLM-Guided Curriculum Evolution with Viewpoint-Pathway Collaboration for Multimodal Document Retrievalcited by 0
- 2026FMI_SU_Yotkova_Kastreva at SemEval-2026 Task 13: Lightweight Detection of LLM-Generated Code via Stylometric Signalscited by 0
- 2026Identifier-Free Code Embedding Models for Scalable Searchcited by 0
- 2026Recall Before Rerank: Benchmarking Deep Learning Models for Large-Scale Code-to-Code Retrievalcited by 0
- 2026Finding the Right Tables and Columns: A Benchmark and Corpus-Adaptive Embeddings for SQL Schema Retrievalcited by 0
- 2026HyperFL: Query-Adaptive Representation Learning for Software Fault Localizationcited by 0
- 2026Invariant Pretraining for Robust Code Representationscited by 0
- 2026A^2Agent: Action-Aware Reinforcement Learning for Repository-Level Code Localization Agentscited by 0
- 2026RepoNav: From Snippet Retrieval to File-Centered Repository Navigation for Code Agentscited by 0
- 2026RepoNav: From Snippet Retrieval to File-Centered Repository Navigation for Code Agents8 Sep 2026
- 2026A^2Agent: Action-Aware Reinforcement Learning for Repository-Level Code Localization Agents30 Aug 2026
- 2026ATLAS: Scaffold-Free Algorithm Synthesis by LLMs via Embedding-Guided Quality-Diversity Search16 Aug 2026
- 2026Invariant Pretraining for Robust Code Representations15 Aug 2026
- 2026HyperFL: Query-Adaptive Representation Learning for Software Fault Localization4 Aug 2026
- 2026DenseOn with the LateOn: Fully Open Dense and Late-Interaction Models for Multilingual, Long-Context, and Code Search29 Jul 2026
- 2026Agent Retrieval Bench: Evaluating Repository Context Retrieval for Coding Agents27 Jul 2026
- 2026Finding the Right Tables and Columns: A Benchmark and Corpus-Adaptive Embeddings for SQL Schema Retrieval14 Jul 2026
- 2026Are We Measuring Strategy or Phrasing? The Gap Between Surface- and Approach-Level Diversity in LLM Math Reasoning29 Jun 2026
- 2026Recall Before Rerank: Benchmarking Deep Learning Models for Large-Scale Code-to-Code Retrieval24 Jun 2026
- 2026SHERLOC: Structured Diagnostic Localization for Code Repair Agents23 Jun 2026
- 2026CORE-Bench: A Comprehensive Benchmark for Code Retrieval in the Era of Agentic Coding10 Jun 2026
25 more
- 2026Identifier-Free Code Embedding Models for Scalable Search5 May 2026
- 2026FMI_SU_Yotkova_Kastreva at SemEval-2026 Task 13: Lightweight Detection of LLM-Generated Code via Stylometric Signals5 May 2026
- 2026On the Challenges and Opportunities of Learned Sparse Retrieval for Code23 Mar 2026
- 2026Evo-Retriever: LLM-Guided Curriculum Evolution with Viewpoint-Pathway Collaboration for Multimodal Document Retrieval17 Mar 2026
- 2026SWE-Adept: An LLM-Based Agentic Framework for Deep Codebase Analysis and Structured Issue Resolution1 Mar 2026
- 2026GREPO: A Benchmark for Graph Neural Networks on Repository-Level Bug Localization14 Feb 2026
- 2026LLM-Confidence Reranker: A Training-Free Approach for Enhancing Retrieval-Augmented Generation Systems14 Feb 2026
- 2026Learning Adaptive Parallel Execution for Efficient Code Localization27 Jan 2026
- 2026Lost in Transcription: How Speech-to-Text Errors Derail Code Understanding20 Jan 2026
- 2026AfriqueLLM: How Data Mixing and Model Architecture Impact Continued Pre-training for African Languages10 Jan 2026
- 2025Agentic Software Issue Resolution with Large Language Models: A Survey24 Dec 2025
- 2025SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localization18 Dec 2025
- 2025LLMs as Packagers of HPC Software7 Nov 2025
- 2025Agentic Reinforcement Learning for Real-World Code Repair24 Oct 2025
- 2025Improving Code Localization with Repository Memory1 Oct 2025
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Survey28 Jul 2025
- 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programming21 Jul 2025
- 2025jina-embeddings-v4: Universal Embeddings for Multimodal Multilingual Retrieval23 Jun 2025
- 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrieval31 May 2025
- 2025CoRet: Improved Retriever for Code Editing30 May 2025
- 2025Multi-View Encoders for Performance Prediction in LLM-Based Agentic Workflows26 May 2025
- 2025VeriCoder: Enhancing LLM-Based RTL Code Generation through Functional Correctness Validation22 Apr 2025
- 2025FreshStack: Building Realistic Benchmarks for Evaluating Retrieval on Technical Documents17 Apr 2025
- 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesis29 Mar 2025
- 2025CRANE: Reasoning with constrained LLM generation13 Feb 2025
- 2026CORE-Bench: A Comprehensive Benchmark for Code Retrieval in the Era of Agentic Codingcited by 7
- 2025Agentic Software Issue Resolution with Large Language Models: A Surveycited by 6
- 2026SWE-Adept: An LLM-Based Agentic Framework for Deep Codebase Analysis and Structured Issue Resolutioncited by 4
- 2025Multi-View Encoders for Performance Prediction in LLM-Based Agentic Workflowscited by 3
- 2026SHERLOC: Structured Diagnostic Localization for Code Repair Agentscited by 2
- 2026Agent Retrieval Bench: Evaluating Repository Context Retrieval for Coding Agentscited by 2
- 2025SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localizationcited by 1
- 2025Agentic Reinforcement Learning for Real-World Code Repaircited by 0
- 2026RepoNav: From Snippet Retrieval to File-Centered Repository Navigation for Code Agentscited by 0
- 2026RepoNav: From Snippet Retrieval to File-Centered Repository Navigation for Code Agents8 Sep 2026
- 2026Agent Retrieval Bench: Evaluating Repository Context Retrieval for Coding Agents27 Jul 2026
- 2026SHERLOC: Structured Diagnostic Localization for Code Repair Agents23 Jun 2026
- 2026CORE-Bench: A Comprehensive Benchmark for Code Retrieval in the Era of Agentic Coding10 Jun 2026
- 2026SWE-Adept: An LLM-Based Agentic Framework for Deep Codebase Analysis and Structured Issue Resolution1 Mar 2026
- 2025Agentic Software Issue Resolution with Large Language Models: A Survey24 Dec 2025
- 2025SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localization18 Dec 2025
- 2025Agentic Reinforcement Learning for Real-World Code Repair24 Oct 2025
- 2025Multi-View Encoders for Performance Prediction in LLM-Based Agentic Workflows26 May 2025
- 2025CRANE: Reasoning with constrained LLM generationcited by 38
- 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesiscited by 16
- 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programmingcited by 2
- 2026Are We Measuring Strategy or Phrasing? The Gap Between Surface- and Approach-Level Diversity in LLM Math Reasoningcited by 2
- 2026Are We Measuring Strategy or Phrasing? The Gap Between Surface- and Approach-Level Diversity in LLM Math Reasoning29 Jun 2026
- 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programming21 Jul 2025
- 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesis29 Mar 2025
- 2025CRANE: Reasoning with constrained LLM generation13 Feb 2025
- 2025jina-embeddings-v4: Universal Embeddings for Multimodal Multilingual Retrievalcited by 76
- 2025Improving Code Localization with Repository Memorycited by 20
- 2025FreshStack: Building Realistic Benchmarks for Evaluating Retrieval on Technical Documentscited by 15
- 2025VeriCoder: Enhancing LLM-Based RTL Code Generation through Functional Correctness Validationcited by 13
- 2026AfriqueLLM: How Data Mixing and Model Architecture Impact Continued Pre-training for African Languagescited by 12
- 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrievalcited by 6
- 2026DenseOn with the LateOn: Fully Open Dense and Late-Interaction Models for Multilingual, Long-Context, and Code Searchcited by 6
- 2025CoRet: Improved Retriever for Code Editingcited by 3
- 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Surveycited by 3
- 2026On the Challenges and Opportunities of Learned Sparse Retrieval for Codecited by 2
- 2025LLMs as Packagers of HPC Softwarecited by 1
- 2026Lost in Transcription: How Speech-to-Text Errors Derail Code Understandingcited by 1
12 most cited of 21 All 21 (JSON)
- 2026ATLAS: Scaffold-Free Algorithm Synthesis by LLMs via Embedding-Guided Quality-Diversity Search16 Aug 2026
- 2026Invariant Pretraining for Robust Code Representations15 Aug 2026
- 2026HyperFL: Query-Adaptive Representation Learning for Software Fault Localization4 Aug 2026
- 2026DenseOn with the LateOn: Fully Open Dense and Late-Interaction Models for Multilingual, Long-Context, and Code Search29 Jul 2026
- 2026Finding the Right Tables and Columns: A Benchmark and Corpus-Adaptive Embeddings for SQL Schema Retrieval14 Jul 2026
- 2026Recall Before Rerank: Benchmarking Deep Learning Models for Large-Scale Code-to-Code Retrieval24 Jun 2026
- 2026Identifier-Free Code Embedding Models for Scalable Search5 May 2026
- 2026FMI_SU_Yotkova_Kastreva at SemEval-2026 Task 13: Lightweight Detection of LLM-Generated Code via Stylometric Signals5 May 2026
- 2026On the Challenges and Opportunities of Learned Sparse Retrieval for Code23 Mar 2026
- 2026GREPO: A Benchmark for Graph Neural Networks on Repository-Level Bug Localization14 Feb 2026
- 2026Learning Adaptive Parallel Execution for Efficient Code Localization27 Jan 2026
- 2026Lost in Transcription: How Speech-to-Text Errors Derail Code Understanding20 Jan 2026
12 newest of 21 All 21 (JSON)