mlsanityData to 14 Oct 2026

CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking

arXiv 2412.01007 ↗First posted 1 Dec 2024cs.CL cs.IRcited by 37

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

  1. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  2. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  3. 2018Representation Learning with Contrastive Predictive Codingcited by 7,777
  4. 2019Momentum Contrast for Unsupervised Visual Representation Learningcited by 7,513
  5. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,754
  6. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  7. 2016MS MARCO: A Human Generated MAchine Reading COmprehension Datasetcited by 1,605
  8. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  9. 2018FEVER: a large-scale dataset for Fact Extraction and VERificationcited by 1,375
  10. 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,253
  11. 2024Qwen2.5-Coder Technical Reportcited by 1,203
  12. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
29 more
  1. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  2. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  3. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  4. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  5. 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 421
  6. 2020Document Ranking with a Pretrained Sequence-to-Sequence Modelcited by 376
  7. 2023Is ChatGPT Good at Search? Investigating Large Language Models as Re-Ranking Agentscited by 360
  8. 2022The Stack: 3 TB of permissively licensed source codecited by 359
  9. 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
  10. 2023Large Language Models are Effective Text Rankers with Pairwise Ranking Promptingcited by 307
  11. 2023Improving Text Embeddings with Large Language Modelscited by 303
  12. 2024Nomic Embed: Training a Reproducible Long Context Text Embeddercited by 265
  13. 2023RankZephyr: Effective and Robust Zero-Shot Listwise Reranking is a Breeze!cited by 155
  14. 2022RankT5: Fine-Tuning T5 for Text Ranking with Ranking Lossescited by 115
  15. 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 91
  16. 2023Beyond Yes and No: Improving Zero-Shot LLM Rankers via Scoring Fine-Grained Relevance Labelscited by 86
  17. 2024NV-Retriever: Improving text embedding models with effective hard-negative miningcited by 84
  18. 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 75
  19. 2024SynCode: LLM Generation with Grammar Augmentationcited by 69
  20. 2024Arctic-Embed: Scalable, Efficient, and Accurate Text Embedding Modelscited by 61
  21. 2024CoIR: A Comprehensive Benchmark for Code Information Retrieval Modelscited by 60
  22. 2024FIRST: Faster Improved Listwise Reranking with Single Token Decodingcited by 54
  23. 2023Open-source Large Language Models are Strong Zero-shot Query Likelihood Models for Document Rankingcited by 44
  24. 2023Jina Embeddings: A Novel Set of High-Performance Sentence Embedding Modelscited by 35
  25. 2024Code Representation Learning At Scalecited by 26
  26. 2022CodeRetriever: Unimodal and Bimodal Contrastive Learning for Code Searchcited by 21
  27. 2022Neural Re-ranking in Multi-stage Recommender Systems: A Reviewcited by 20
  28. 2024Is The Watermarking Of LLM-Generated Code Robust?cited by 8
  29. 2022Learning List-Level Domain-Invariant Representations for Rankingcited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 15; 2026: 22.

37 papers.

Sort:

By area:

  1. 2025jina-embeddings-v4: Universal Embeddings for Multimodal Multilingual Retrievalcited by 76
  2. 2025CRANE: Reasoning with constrained LLM generationcited by 38
  3. 2025Improving Code Localization with Repository Memorycited by 20
  4. 2025CodeARC: Benchmarking Reasoning Capabilities of LLM Agents for Inductive Program Synthesiscited by 16
  5. 2025FreshStack: Building Realistic Benchmarks for Evaluating Retrieval on Technical Documentscited by 15
  6. 2025VeriCoder: Enhancing LLM-Based RTL Code Generation through Functional Correctness Validationcited by 13
  7. 2026AfriqueLLM: How Data Mixing and Model Architecture Impact Continued Pre-training for African Languagescited by 12
  8. 2026CORE-Bench: A Comprehensive Benchmark for Code Retrieval in the Era of Agentic Codingcited by 7
  9. 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrievalcited by 6
  10. 2025Agentic Software Issue Resolution with Large Language Models: A Surveycited by 6
  11. 2026DenseOn with the LateOn: Fully Open Dense and Late-Interaction Models for Multilingual, Long-Context, and Code Searchcited by 6
  12. 2026SWE-Adept: An LLM-Based Agentic Framework for Deep Codebase Analysis and Structured Issue Resolutioncited by 4
25 more
  1. 2025Multi-View Encoders for Performance Prediction in LLM-Based Agentic Workflowscited by 3
  2. 2025CoRet: Improved Retriever for Code Editingcited by 3
  3. 2025On The Role of Pretrained Language Models in General-Purpose Text Embeddings: A Surveycited by 3
  4. 2025AlgoSimBench: Identifying Algorithmically Similar Problems for Competitive Programmingcited by 2
  5. 2026LLM-Confidence Reranker: A Training-Free Approach for Enhancing Retrieval-Augmented Generation Systemscited by 2
  6. 2026On the Challenges and Opportunities of Learned Sparse Retrieval for Codecited by 2
  7. 2026SHERLOC: Structured Diagnostic Localization for Code Repair Agentscited by 2
  8. 2026Are We Measuring Strategy or Phrasing? The Gap Between Surface- and Approach-Level Diversity in LLM Math Reasoningcited by 2
  9. 2026Agent Retrieval Bench: Evaluating Repository Context Retrieval for Coding Agentscited by 2
  10. 2025LLMs as Packagers of HPC Softwarecited by 1
  11. 2025SpIDER: Spatially Informed Dense Embedding Retrieval for Software Issue Localizationcited by 1
  12. 2026Lost in Transcription: How Speech-to-Text Errors Derail Code Understandingcited by 1
  13. 2026ATLAS: Scaffold-Free Algorithm Synthesis by LLMs via Embedding-Guided Quality-Diversity Searchcited by 1
  14. 2025Agentic Reinforcement Learning for Real-World Code Repaircited by 0
  15. 2026Learning Adaptive Parallel Execution for Efficient Code Localizationcited by 0
  16. 2026GREPO: A Benchmark for Graph Neural Networks on Repository-Level Bug Localizationcited by 0
  17. 2026Evo-Retriever: LLM-Guided Curriculum Evolution with Viewpoint-Pathway Collaboration for Multimodal Document Retrievalcited by 0
  18. 2026FMI_SU_Yotkova_Kastreva at SemEval-2026 Task 13: Lightweight Detection of LLM-Generated Code via Stylometric Signalscited by 0
  19. 2026Identifier-Free Code Embedding Models for Scalable Searchcited by 0
  20. 2026Recall Before Rerank: Benchmarking Deep Learning Models for Large-Scale Code-to-Code Retrievalcited by 0
  21. 2026Finding the Right Tables and Columns: A Benchmark and Corpus-Adaptive Embeddings for SQL Schema Retrievalcited by 0
  22. 2026HyperFL: Query-Adaptive Representation Learning for Software Fault Localizationcited by 0
  23. 2026Invariant Pretraining for Robust Code Representationscited by 0
  24. 2026A^2Agent: Action-Aware Reinforcement Learning for Repository-Level Code Localization Agentscited by 0
  25. 2026RepoNav: From Snippet Retrieval to File-Centered Repository Navigation for Code Agentscited by 0