Research map / Label-efficient and robust learning / Recognition and long-tail
Rethinking Negative Pairs in Code Search
Haochen Li, Xin Zhou, Luu Anh Tuan, Chunyan Miao
Nanyang Technological University
Read the paperPlace an idea next to itCheck your own paper ↗
12measured effects
3improved
3no clear effect
5hurt
1mixed
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| replace InfoNCE with Soft-InfoNCE (SimCSE estimation) | CodeBERT · CodeSearchNet Python | MRR: 0.636 -> 0.668 | Improved |
| replace InfoNCE with Soft-InfoNCE (any estimator) | CodeBERT, GraphCodeBERT, UniXCoder · CodeSearchNet (6 languages) | MRR: about 1%-2% MRR | Improved |
| replace InfoNCE with Soft-InfoNCE (BM25) | GraphCodeBERT · CodeSearchNet Go | MRR: 0.896 -> 0.892 | No clear effect |
| use trained-model weight estimation instead of BM25/SimCSE | CodeBERT · CodeSearchNet (6 languages) | MRR | Improved |
| use trained-model estimation instead of BM25/SimCSE | GraphCodeBERT, UniXCoder · CodeSearchNet | MRR | No clear effect |
| replace Soft-InfoNCE with BCE loss (ablation) | CodeBERT · CodeSearchNet overall | MRR: 0.687 -> 0.641 | Hurt |
| replace Soft-InfoNCE with weighted InfoNCE (ablation) | GraphCodeBERT · CodeSearchNet overall | MRR: 0.722 -> 0.674 | Hurt |
| replace Soft-InfoNCE with KL regularization (ablation) | UniXCoder · CodeSearchNet overall | MRR: 0.751 -> 0.716 | Hurt |
| remove top-K similar negatives (K=1 to 5) instead of weighting (ablation) | GraphCodeBERT · CodeSearchNet Python | MRR: 0.685 -> 0.680 as K goes 1 -> 5; Soft-InfoNCE 0.700 | Hurt |
| dynamic threshold false-negative removal (ablation) | GraphCodeBERT · CodeSearchNet Python | MRR: 0.689, 0.688, 0.688 vs Soft-InfoNCE 0.700 | Hurt |
| alpha/beta setting (alpha=1.3, beta=0.7) (ablation) | Soft-InfoNCE · CodeSearchNet Python | MRR | No clear effect |
| Soft-InfoNCE weight estimation overhead (CodeBERT) | CodeBERT · training time per batch | time per batch (s): 0.75s -> 0.77s (BM25), 0.81s (SimCSE), 0.98s (Trained Model) | Mixed |
Closest papers by meaning
- Uncertainty-Aware Contrastive Learning with Hard Negative Sampling for Code Search Tasks (AAAI 2025 · similarity 0.89)
- Hidden Positives: Why Code Retrieval Benchmarks Underestimate Model Quality (NeurIPS 2026 · similarity 0.87)
- CODE REPRESENTATION LEARNING AT SCALE (ICLR 2024 · similarity 0.86)
- CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking (ICLR 2025 · similarity 0.85)
- Towards A Generalist Code Embedding Model Based On Massive Data Synthesis (NeurIPS 2025 · similarity 0.84)
- CPRet: A Dataset, Benchmark, and Model for Retrieval in Competitive Programming (NeurIPS 2025 · similarity 0.83)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
