Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformations
摘要
We propose Corder, a self-supervised contrastive learning framework for source code model. Corder is designed to alleviate the need of labeled data for code retrieval and code summarization tasks. The pre-trained model of Corder can be used in two ways: (1) it can produce vector representation of code which can be applied to code retrieval tasks that do not have labeled data; (2) it can be used in a fine-tuning process for tasks that might still require label data such as code summarization. The key innovation is that we train the source code model by asking it to recognize similar and dissimilar code snippets through a contrastive learning objective. To do so, we use a set of semantic-preserving transformation operators to generate code snippets that are syntactically diverse but semantically equivalent. Through extensive experiments, we have shown that the code models pretrained by Corder substantially outperform the other baselines for code-to-code retrieval, text-to-code retrieval, and code-to-text summarization tasks.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 39 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Bridging Pre-trained Models and Downstream Tasks for Source Code Understanding 引用了 Generating Adversarial Examples for Holding Robustness of Source Code Processing Models
- Bridging Pre-trained Models and Downstream Tasks for Source Code Understanding 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- ContraBERT: Enhancing Code Pre-trained Models via Contrastive Learning 引用了 Generating Adversarial Examples for Holding Robustness of Source Code Processing Models
- ContraBERT: Enhancing Code Pre-trained Models via Contrastive Learning 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- ContraBERT: Enhancing Code Pre-trained Models via Contrastive Learning 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- ReACC: A Retrieval-Augmented Code Completion Framework 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- ReACC: A Retrieval-Augmented Code Completion Framework 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- SelfAPR: Self-supervised Program Repair with Test Execution Diagnostics 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- SelfAPR: Self-supervised Program Repair with Test Execution Diagnostics 引用了 Graph-based, Self-Supervised Program Repair from Diagnostic Feedback
- Graph-based, Self-Supervised Program Repair from Diagnostic Feedback 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Path-sensitive code embedding via contrastive learning for software vulnerability detection 引用了 A Simple Framework for Contrastive Learning of Visual Representations
- Path-sensitive code embedding via contrastive learning for software vulnerability detection 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
引用它的顶会 Paper39
- ReACC: A Retrieval-Augmented Code Completion FrameworkShuai Lu, Nan Duan, Hojae Han, Daya Guo 等ACL 2022 · 208 次引用
- Path-sensitive code embedding via contrastive learning for software vulnerability detectionXiao Cheng, Guanqin Zhang, Haoyu Wang, Yulei SuiISSTA 2022 · 98 次引用
- SelfAPR: Self-supervised Program Repair with Test Execution DiagnosticsHe Ye, Matias Martinez, Xiapu Luo, Tao Zhang 等ASE 2022 · 75 次引用
- Bridging Pre-trained Models and Downstream Tasks for Source Code UnderstandingDeze Wang, Zhouyang Jia, Shanshan Li, Yue Yu 等ICSE 2022 · 68 次引用
- ContraBERT: Enhancing Code Pre-trained Models via Contrastive LearningShangqing Liu, Bozhi Wu, Xiaofei Xie, Guozhu Meng 等ICSE 2023 · 56 次引用
它引用的 Paper12
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
- Graph-based, Self-Supervised Program Repair from Diagnostic FeedbackMichihiro Yasunaga, Percy LiangICML 2020 · 198 次引用
- A Mutual Information Maximization Perspective of Language Representation LearningLingpeng Kong, Cyprien de Masson d'Autume, Lei Yu, Wang Ling 等ICLR 2020 · 179 次引用
- Generating Adversarial Examples for Holding Robustness of Source Code Processing ModelsHuangzhao Zhang, Zhuo Li, Ge Li, Lei Ma 等AAAI 2020 · 148 次引用
相关 Paper
- CodeRetriever: A Large Scale Contrastive Pre-Training Method for Code SearchXiaonan Li, Yeyun Gong, Yelong Shen, Xipeng Qiu 等EMNLP 2022 · 25 次引用
- Towards Better Code Understanding in Decoder-Only Models with Contrastive LearningJiayi Lin, Yanlin Wang, Yibiao Yang, Lei Zhang 等AAAI 2026 · 2 次引用
- UniCoR: Modality Collaboration for Robust Cross-Language Hybrid Code RetrievalYang Yang, Li Kuang, Jiakun Liu, Zhongxin Liu 等ICSE 2026
- Soft-Labeled Contrastive Pre-Training for Function-Level Code RepresentationXiaonan Li, Daya Guo, Yeyun Gong, Yun Lin 等EMNLP Findings 2022 · 8 次引用
- Contrastive Code Representation LearningParas Jain, Ajay Jain, Tianjun Zhang, Pieter Abbeel 等EMNLP 2021 · 11 次引用
