Lune

EMNLP2022顶会

CodeRetriever: A Large Scale Contrastive Pre-Training Method for Code Search

Xiaonan Li, Yeyun Gong, Yelong Shen, Xipeng Qiu, Hang Zhang, Bolun Yao, Weizhen Qi, Daxin Jiang, Weizhu Chen, Nan Duan

摘要

In this paper, we propose the CodeRetriever model, which learns the function-level code semantic representations through large-scale code-text contrastive pre-training. We adopt two contrastive learning schemes in CodeRetriever: unimodal contrastive learning and bimodal contrastive learning. For unimodal contrastive learning, we design an unsupervised learning approach to build semanticrelated code pairs based on the documentation and function name. For bimodal contrastive learning, we leverage the documentation and in-line comments of code to build code-text pairs. Both contrastive objectives can fully leverage large-scale code corpus for pre-training. Extensive experimental results show that CodeRetriever achieves new stateof-the-art with significant improvement over existing code pre-trained models, on eleven domain/language-specific code search tasks with six programming languages in different code granularity (function-level, snippet-level and statement-level). These results demonstrate the effectiveness and robustness of CodeRetriever. The codes and resources are available at https://github.com/microsoft/ AR2/tree/main/CodeRetriever .

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Code Representation Learning at Scale 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Code Representation Learning at Scale 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Zero-Shot Cross-Domain Code Search without Fine-Tuning 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Zero-Shot Cross-Domain Code Search without Fine-Tuning 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Towards Better Code Understanding in Decoder-Only Models with Contrastive Learning 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Improving Code Localization with Repository Memory 引用了 Code Representation Learning at Scale
  • Optimizing Code Retrieval: High-Quality and Scalable Dataset Annotation through Large Language Models 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Optimizing Code Retrieval: High-Quality and Scalable Dataset Annotation through Large Language Models 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper11

  1. Code Representation Learning at ScaleDejiao Zhang, Wasi Uddin Ahmad, Ming Tan, Hantian Ding 等ICLR 2024 · 32 次引用
  2. Improving Code Localization with Repository MemoryBoshi Wang, Weijian Xu, Yunsheng Li, Xuemei Gao 等ICLR 2026 · 20 次引用
  3. Optimizing Code Retrieval: High-Quality and Scalable Dataset Annotation through Large Language ModelsRui Li, Qi Liu, Liyang He, Zheng Zhang 等EMNLP 2024 · 4 次引用
  4. Zero-Shot Cross-Domain Code Search without Fine-TuningKeyu Liang, Zhongxin Liu, Chao Liu, Zhiyuan Wan 等FSE 2025 · 2 次引用
  5. Towards Better Code Understanding in Decoder-Only Models with Contrastive LearningJiayi Lin, Yanlin Wang, Yibiao Yang, Lei Zhang 等AAAI 2026 · 2 次引用

它引用的 Paper15

  1. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
  2. Understanding Contrastive Representation Learning through Alignment and Uniformity on the HypersphereTongzhou Wang, Phillip IsolaICML 2020 · 2,360 次引用
  3. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
  4. Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text RetrievalLee Xiong, Chenyan Xiong, Ye Li, Kwok-Fung Tang 等ICLR 2021 · 1,547 次引用
  5. BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and ComprehensionMike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad 等ACL 2020 · 1,224 次引用

相关 Paper

  1. Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving TransformationsNghi D. Q. Bui, Yijun Yu, Lingxiao JiangSIGIR 2021 · 98 次引用
  2. MGS3: A Multi-Granularity Self-Supervised Code Search FrameworkRui Li, Junfeng Kang, Qi Liu, Liyang He 等KDD 2025
  3. CoCoSoDa: Effective Contrastive Learning for Code SearchEnsheng Shi, Yanlin Wang, Wenchao Gu, Lun Du 等ICSE 2023 · 45 次引用
  4. Soft-Labeled Contrastive Pre-Training for Function-Level Code RepresentationXiaonan Li, Daya Guo, Yeyun Gong, Yun Lin 等EMNLP Findings 2022 · 8 次引用
  5. Uncertainty-Aware Contrastive Learning with Hard Negative Sampling for Code Search TasksHan Liu, Jiaqing Zhan, Qin ZhangAAAI 2025 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖