Research map / Large language models / Retrieval and knowledge
CoSQA: 20,000+ Web Queries for Code Search and Question Answering
Junjie Huang, Duyu Tang, Linjun Shou, Ming Gong, Ke Xu, Daxin Jiang, Ming Zhou, Nan Duan
Beihang University · Microsoft Research Asia · Microsoft
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.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| train CodeBERT on CoSQA in addition to CodeSearchNet | CodeBERT · CodeXGLUE WebQueryTest | accuracy: 47.80 -> 52.87 | Improved |
| train CodeBERT on CoSQA in addition to CodeSearchNet | CodeBERT · CoSQA code search | MRR: 51.29 -> 54.41 | Improved |
| add CoCLR contrastive augmentation | CodeBERT trained on CSN + CoSQA · CodeXGLUE WebQueryTest | accuracy: 52.87 -> 63.38 | Improved |
| add CoCLR contrastive augmentation | CodeBERT trained on CSN + CoSQA · CoSQA code search | MRR: 54.41 -> 64.66 | Improved |
| add in-batch augmentation (ablation) | CodeBERT without augmentation · CoSQA code search | MRR: 54.41 -> 63.51 | Improved |
| add query-rewritten augmentation (switch) (ablation) | CodeBERT without augmentation · CoSQA code search | MRR: 54.41 -> 55.66 | Improved |
| add query-rewritten (switch) on top of in-batch augmentation (ablation) | CodeBERT + in-batch · CoSQA code search | MRR: 63.51 -> 64.66 | Improved |
| add query-rewritten (delete) on top of in-batch augmentation (ablation) | CodeBERT + in-batch · CoSQA code search | MRR: 63.51 -> 63.41 | No clear effect |
| rewrite queries by switching word positions rather than deleting or copying (ablation) | CoCLR query-rewritten augmentation · CoSQA code search | MRR: 55.66 (switch) vs 55.24 (delete), 54.82 (copy) | Improved |
| add one more IBA example instead of QRA example (equalise number of examples) (ablation) | CodeBERT · CoSQA code search | MRR: 55.52 | No clear effect |
| remove natural language documentation from code (ablation) | CoCLR CodeBERT · CoSQA code search | MRR: 64.66 -> 58.54 when removed | Improved |
| keep function header (ablation) | CoCLR CodeBERT · CoSQA code search | MRR: 64.66 -> 62.01 when removed | Improved |
Open problems in explanatory and multiple-choice QA benchmarks
Which retrieval and QA methods hold up beyond English, small models and LLM judges, and what do they cost?
- Multi-step retrieval and reasoning adds latency and LLM cost. · 26 papers state it
- Only English questions were tested, so other languages are open. · 21 papers state it
- Scores depend on LLM judges that may be biased or noisy. · 15 papers state it
Closest papers by meaning
- CodeQA: A Question Answering Dataset for Source Code Comprehension (EMNLP 2021 · similarity 0.89)
- CS1QA: A Dataset for Assisting Code-based Question Answering in an Introductory Programming Course (NAACL 2022 · similarity 0.89)
- CoIR: A Comprehensive Benchmark for Code Information Retrieval Models (ACL 2025 · similarity 0.87)
- Code-Style In-Context Learning for Knowledge-Based Question Answering (AAAI 2024 · similarity 0.86)
- InfiBench: Evaluating the Question-Answering Capabilities of Code Large Language Models (NeurIPS 2024 · similarity 0.86)
- FlexKBQA: A Flexible LLM-Powered Framework for Few-Shot Knowledge Base Question Answering (AAAI 2024 · similarity 0.86)
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.