CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrieval
Not on the map. Why?
Abstract (arXiv)
Code retrieval is essential in modern software development, as it boosts code reuse and accelerates debugging. However, current benchmarks primarily emphasize functional relevance while neglecting critical dimensions of software quality. Motivated by this gap, we introduce CoQuIR, the first large-scale, multilingual benchmark specifically designed to evaluate quality-aware code retrieval across four key dimensions: correctness, efficiency, security, and maintainability. CoQuIR provides fine-grained quality annotations for 42,725 queries and 134,907 code snippets in 11 programming languages, and is accompanied by two quality-centric evaluation metrics: Pairwise Preference Accuracy and Margin-based Ranking Score. Using CoQuIR, we benchmark 23 retrieval models, covering both open-source and proprietary systems, and find that even top-performing models frequently fail to distinguish buggy or insecure code from their more robust counterparts. Furthermore, we conduct preliminary investigations into training methods that explicitly encourage retrievers to recognize code quality. Using synthetic datasets, we demonstrate promising improvements in quality-aware metrics across various models, without sacrificing semantic relevance. Downstream code generation experiments further validate the effectiveness of our approach. Overall, our work highlights the importance of integrating quality signals into code retrieval systems, laying the groundwork for more trustworthy and robust software development tools.
Key facts. Cited by 6 papers in the map (data through 14 Oct 2026). Builds on 36 of its 60 references that are in the map. First posted on arXiv 31 May 2025.
Builds on
36 of 60 references.
References · 36
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
- 2022Text Embeddings by Weakly-Supervised Contrastive Pre-trainingcited by 1,253
- 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,216
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2020Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrievalcited by 849
- 2023Towards General Text Embeddings with Multi-stage Contrastive Learningcited by 723
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
- 2021Large Dual Encoders Are Generalizable Retrieverscited by 456
- 2022One Embedder, Any Task: Instruction-Finetuned Text Embeddingscited by 333
- 2023Improving Text Embeddings with Large Language Modelscited by 303
24 more
- 2023Fine-Tuning LLaMA for Multi-Stage Text Retrievalcited by 272
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
- 2024BRIGHT: A Realistic and Challenging Benchmark for Reasoning-Intensive Retrievalcited by 158
- 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 155
- 2021CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Softwarecited by 91
- 2024CodeRAG-Bench: Can Retrieval Augment Code Generation?cited by 91
- 2021CoSQA: 20,000+ Web Queries for Code Search and Question Answeringcited by 75
- 2024FollowIR: Evaluating and Teaching Information Retrieval Models to Follow Instructionscited by 69
- 2024Instruction Tuning for Secure Code Generationcited by 68
- 2023LLMSecEval: A Dataset of Natural Language Prompts for Security Evaluationscited by 62
- 2024CoIR: A Comprehensive Benchmark for Code Information Retrieval Modelscited by 60
- 2023xCodeEval: A Large Scale Multilingual Multitask Benchmark for Code Understanding, Generation, Translation and Retrievalcited by 47
- 2024Promptriever: Instruction-Trained Retrievers Can Be Prompted Like Language Modelscited by 40
- 2024CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Rerankingcited by 37
- 2024LLMs Meet Library Evolution: Evaluating Deprecated API Usage in LLM-based Code Completioncited by 32
- 2024Code Representation Learning At Scalecited by 26
- 2024Large Language Models as Foundations for Next-Gen Dense Retrieval: A Comprehensive Empirical Assessmentcited by 19
- 2022Code Search: A Survey of Techniques for Finding Codecited by 18
- 2024LLM-R2: A Large Language Model Enhanced Rule-based Rewrite System for Boosting Query Efficiencycited by 16
- 2024SecCoder: Towards Generalizable and Robust Secure Code Generationcited by 14
- 2024Beyond Relevance: Evaluate and Improve Retrievers on Perspective Awarenesscited by 12
- 2024textttMixGR: Enhancing Retriever Generalization for Scientific Domain through Complementary Granularitycited by 9
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generationcited by 9
- 2025Enhancing Retrieval Systems with Inference-Time Logical Reasoningcited by 3
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026A Survey of Reasoning-Intensive Retrieval: Progress and Challengescited by 1
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Codecited by 1
- 2026CodeMMR: Bridging Natural Language, Code, and Image for Unified Retrievalcited by 0
- 2026Finding the Right Tables and Columns: A Benchmark and Corpus-Adaptive Embeddings for SQL Schema Retrievalcited by 0
- 2026SynH-Rank: Quality-Aware Code Search via Diverse Data Synthesis and Hierarchical Ranking Trainingcited by 0
- 2026ExecRetrieval: Measuring the Functional-Correctness Gap in Code-Embedding Retrievalcited by 0
- 2026ExecRetrieval: Measuring the Functional-Correctness Gap in Code-Embedding Retrieval1 Sep 2026
- 2026SynH-Rank: Quality-Aware Code Search via Diverse Data Synthesis and Hierarchical Ranking Training19 Jul 2026
- 2026Finding the Right Tables and Columns: A Benchmark and Corpus-Adaptive Embeddings for SQL Schema Retrieval14 Jul 2026
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026A Survey of Reasoning-Intensive Retrieval: Progress and Challenges30 Apr 2026
- 2026CodeMMR: Bridging Natural Language, Code, and Image for Unified Retrieval17 Apr 2026