EMNLP Findings2022
Soft-Labeled Contrastive Pre-Training for Function-Level Code Representation
Xiaonan Li, Daya Guo, Yeyun Gong, Yun Lin, Yelong Shen, Xipeng Qiu, Daxin Jiang, Weizhu Chen, Nan Duan
摘要
Code contrastive pre-training has recently achieved significant progress on code-related tasks. In this paper, we present SCodeR, a Soft-labeled contrastive pre-training framework with two positive sample construction methods to learn functional-level Code Representation. Considering the relevance between codes in a large-scale code corpus, the soft-labeled contrastive pre-training can obtain fine-grained soft-labels through an iterative adversarial manner and use them to learn better code representation. The positive sample construction is another key for contrastive pretraining. Previous works use transformationbased methods like variable renaming to generate semantically equal positive codes. However, they usually result in the generated code with a highly similar surface form, and thus mislead the model to focus on superficial code structure instead of code semantics. To encourage SCodeR to capture semantic information from the code, we utilize code comments and abstract syntax sub-trees of the code to build positive samples. We conduct experiments on four code-related tasks over seven datasets. Extensive experimental results show that SCodeR achieves new state-of-the-art performance on all of them, which illustrates the effectiveness of the proposed pre-training method.
and work is done during the internship at Microsoft Research Asia.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 6 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewriting 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewriting 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code Rewriting 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
- Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search 引用了 Rethinking Negative Pairs in Code Search
- Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
- Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search 引用了 Language Models are Few-Shot Learners
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CodeRetriever: A Large Scale Contrastive Pre-Training Method for Code Search 引用了 On the Sentence Embeddings from Pre-trained Language Models
- CodeRetriever: A Large Scale Contrastive Pre-Training Method for Code Search 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- CodeRetriever: A Large Scale Contrastive Pre-Training Method for Code Search 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CodeRetriever: A Large Scale Contrastive Pre-Training Method for Code Search 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
- Rethinking Negative Pairs in Code Search 引用了 On the Sentence Embeddings from Pre-trained Language Models
- Rethinking Negative Pairs in Code Search 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- Rethinking Negative Pairs in Code Search 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
- CoEdPilot: Recommending Code Edits with Learned Prior Edit Relevance, Project-wise Awareness, and Interactive Nature 引用了 CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation
- CoEdPilot: Recommending Code Edits with Learned Prior Edit Relevance, Project-wise Awareness, and Interactive Nature 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- CoEdPilot: Recommending Code Edits with Learned Prior Edit Relevance, Project-wise Awareness, and Interactive Nature 引用了 Language Models are Few-Shot Learners
引用它的顶会 Paper6
- CodeRetriever: A Large Scale Contrastive Pre-Training Method for Code SearchXiaonan Li, Yeyun Gong, Yelong Shen, Xipeng Qiu 等EMNLP 2022 · 25 次引用
- Uncovering LLM-Generated Code: A Zero-Shot Synthetic Code Detector via Code RewritingTong Ye, Yangkai Du, Tengfei Ma, Lingfei Wu 等AAAI 2025 · 21 次引用
- Rewriting the Code: A Simple Method for Large Language Model Augmented Code SearchHaochen Li, Xin Zhou, Zhiqi ShenACL 2024 · 10 次引用
- CoEdPilot: Recommending Code Edits with Learned Prior Edit Relevance, Project-wise Awareness, and Interactive NatureChenyan Liu, Yufan Cai, Yun Lin, Yuhuan Huang 等ISSTA 2024 · 7 次引用
- Rethinking Negative Pairs in Code SearchHaochen Li, Xin Zhou, Anh Tuan Luu, Chunyan MiaoEMNLP 2023 · 6 次引用
它引用的 Paper12
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
- CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and GenerationYue Wang, Weishi Wang, Shafiq R. Joty, Steven C. H. HoiEMNLP 2021 · 1,224 次引用
- On the Sentence Embeddings from Pre-trained Language ModelsBohan Li, Hao Zhou, Junxian He, Mingxuan Wang 等EMNLP 2020 · 538 次引用
相关 Paper
- Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving TransformationsNghi D. Q. Bui, Yijun Yu, Lingxiao JiangSIGIR 2021 · 98 次引用
- CoCoSoDa: Effective Contrastive Learning for Code SearchEnsheng Shi, Yanlin Wang, Wenchao Gu, Lun Du 等ICSE 2023 · 45 次引用
- MGS3: A Multi-Granularity Self-Supervised Code Search FrameworkRui Li, Junfeng Kang, Qi Liu, Liyang He 等KDD 2025
- Code Representation Learning at ScaleDejiao Zhang, Wasi Uddin Ahmad, Ming Tan, Hantian Ding 等ICLR 2024 · 32 次引用
- Contrastive Code Representation LearningParas Jain, Ajay Jain, Tianjun Zhang, Pieter Abbeel 等EMNLP 2021 · 11 次引用
