NeurIPS 2026QuestionsPapersAreasAboutMarkdown

Hidden Positives: Why Code Retrieval Benchmarks Underestimate Model Quality

Maria Ivanova, Vitaly Kadulin, Dmitrii Babaev

NeurIPS page · OpenReview · Open on the map

Category: LLM Agents, Evals & Benchmarks › LLM Uncertainty Quantification · Type: benchmark or dataset · Keywords: code retrieval, benchmarks, hidden positives, MegaCode dataset, embedding models, LLM-judged evaluation

Areas: Code & Coding Agents › Code Verification › Code benchmarks; Evaluation & Benchmarks › Model Capability Diagnostics › Evaluation Benchmarks for Unlearning and Retrieval; Evaluation Methodology & Auditing › Language Model Benchmarking › Evaluation benchmarks

Summary

The paper reveals that code retrieval benchmarks often label valid alternative implementations as negatives, proposes a unified LLM-judged evaluation protocol, constructs the MegaCode dataset of 193M positive (text, code) pairs, and trains a family of embedding models that match or exceed prior models under the new protocol.

Explained to a 5-year-old

People make programs that help find code when you ask for it. Sometimes the tests they use say that good code is wrong, which makes the tests look bad. The researchers noticed this problem and made a new way to test that is fairer. They built a huge collection of good code examples. Then they trained smart models that can find the right code better.

Explained to a 5-year-old, longer

Imagine you have a big library of computer code and you want to find the right piece when you ask for something. The librarians have tests to check how well a search tool works. In those tests, sometimes a correct piece of code is marked as wrong, which makes the test seem worse than it really is. The researchers looked at several popular tests and saw that many good code examples were being ignored. To fix this, they created a new, fairer test that uses a smart computer program to decide which code is actually relevant. They also built an enormous dataset called MegaCode that contains millions of pairs of text questions and correct code answers. Using this dataset, they trained several different models that can turn questions into code suggestions. When they ran the new fair test, the smaller models performed as well as much larger models, and the biggest model improved the search accuracy by a noticeable amount. This helps developers get better code suggestions and makes it easier to compare different search tools fairly.

For a technical reader

The paper identifies a flaw in existing code retrieval benchmarks where valid alternative implementations are incorrectly labeled as negatives, leading to unreliable performance measurements. To address this, the authors propose a unified evaluation protocol that uses a single LLM judge to re-annotate the top-10 retrieved candidates under a fixed prompt, ensuring consistent semantic relevance. They also introduce a large-scale dataset, MegaCode, built with an LLM-supervised reranker, and train a family of contrastive embedding models at multiple scales on this data. Evaluations under the new protocol show that their 0.5B model matches or exceeds prior open-source models up to 8B parameters, and their 7B model improves average MRR@10 by 3.5 points over the strongest baseline.

Problem

Code retrieval benchmarks routinely treat valid alternative implementations as negative examples, causing performance estimates to be unstable and artificially low.

Method

The authors introduce a unified evaluation protocol where a single LLM judge re-annotates the top-10 retrieved candidates for each model under a fixed prompt, and they use a smaller LLM-supervised reranker to build a large semantically curated dataset. They then train a family of embedding models at multiple scales using contrastive learning on this dataset.

Results

The 0.5B model matches or exceeds prior open code-retrieval embeddings up to 8B parameters, and the 7B model improves average MRR@10 by 3.5 points over the strongest baseline.

Contributions

The work uncovers missing positives in benchmark labels, proposes a consistent LLM-judged evaluation protocol, creates the MegaCode dataset of 193M positive pairs, and trains scalable embedding models that achieve state-of-the-art retrieval performance.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction