Research map / Large language models / Retrieval and knowledge
CodeRAG-Bench: Can Retrieval Augment Code Generation?
Zora Zhiruo Wang, Akari Asai, Xinyan Velocity Yu, Frank F. Xu, Yiqing Xie, Graham Neubig, Daniel Fried
Carnegie Mellon University · University of Washington · University of Southern California
Read the paperPlace an idea next to itCheck your own paper ↗
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.
On benchmark leaderboards
- HumanEval leaderboard pass@1 68.9 · rank 123 of 261 papers
- MBPP leaderboard pass@1 53.4 · rank 102 of 165 papers
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| provide gold documents to GPT-4o | GPT-4o · SWE-bench-Lite | pass@1: 2.3 -> 30.7 | Improved |
| provide gold documents to GPT models on open-domain tasks | GPT-3.5-turbo / GPT-4o · DS-1000, ODEX | pass@1: GPT-4o DS-1000 52.7 -> 51.2 | No clear effect |
| retrieve documents on the 20-least-used-library subset | ODEX-hard · ODEX-hard | pass@1: +20.3-40.1% | Improved |
| add retrieved contexts to DeepSeekCoder-7B | DeepSeekCoder-7B · HumanEval, MBPP | pass@1: HumanEval 70.1 -> 68.9 (BM25) | Hurt |
| add retrieved contexts to StarCoder2-7B | StarCoder2-7B · MBPP | pass@1: 2.4 -> 52.6 (Voyage) | Improved |
| add retrieval and rerank to GPT-4o | GPT-4o · SWE-bench-Lite | pass@1: 2.3 -> 21.7 | Improved |
| use code-trained retrievers instead of same-size general ones | retrievers · Avg. NDCG@10 | NDCG@10: Jina-v2-code +7.4 over GIST-base, +6.6 over BGE-base | Improved |
| scale retriever size from GIST-base to GIST-large (ablation) | GIST · Avg. NDCG@10 | NDCG@10: 58.0 -> 61.7 | Improved |
| use SFR-Mistral instead of GIST-base | retrieval efficiency · CodeSearchNet sample | index size / encoding latency: index 307MB -> 1638MB; encode 3.7ms -> 316ms | Mixed |
| add retrieval from open sources to local files (ablation) | GPT-4o · RepoEval | pass@1: 62.2 -> 54.2 | Hurt |
| rerank chunks within 200-800 tokens with BGE-reranker (ablation) | StarCoder2 HumanEval · HumanEval (Docs) | pass@1: 29.3 -> 9.1 | Hurt |
| pre-retrieval chunking of documents (ablation) | StarCoder2 HumanEval · HumanEval (Docs) | pass@1: 29.3 -> 32.9 | Improved |
Open problems in RAG robustness and evaluation
When does retrieval help a language model, and when does it mislead it?
- Only one answer-bearing document is handled. · 6 papers state it
- String-match metrics misjudge long or rephrased answers. · 6 papers state it
- Verbalized graph triples distort or drop facts. · 5 papers state it
Closest papers by meaning
- RAR: Retrieval-augmented retrieval for code generation in low resource languages (EMNLP 2024 · similarity 0.92)
- SRACG: A Code Generation Framework with Selective Retrieval Augmentation (AAAI 2026 · similarity 0.92)
- Repoformer: Selective Retrieval for Repository-Level Code Completion (ICML 2024 · similarity 0.92)
- cAST: Enhancing Code Retrieval-Augmented Generation with Structural Chunking via Abstract Syntax Tree (EMNLP 2025 · similarity 0.92)
- PinNet: Pinpoint Instructive Information for Retrieval Augmented Code-to-Text Generation (ICML 2024 · similarity 0.89)
- CodeMMR: Bridging Natural Language, Code, and Image for Unified Retrieval (CVPR 2026 · similarity 0.89)
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.