Lune

ICSE2023顶会

ContraBERT: Enhancing Code Pre-trained Models via Contrastive Learning

Shangqing Liu, Bozhi Wu, Xiaofei Xie, Guozhu Meng, Yang Liu

摘要

Large-scale pre-trained models such as CodeBERT, GraphCodeBERT have earned widespread attention from both academia and industry. Attributed to the superior ability in code representation, they have been further applied in multiple downstream tasks such as clone detection, code search and code translation. However, it is also observed that these state-of-the-art pre-trained models are susceptible to adversarial attacks. The performance of these pre-trained models drops significantly with simple perturbations such as renaming variable names. This weakness may be inherited by their downstream models and thereby amplified at an unprecedented scale. To this end, we propose an approach namely ContraBERT that aims to improve the robustness of pre-trained models via contrastive learning. Specifically, we design nine kinds of simple and complex data augmentation operators on the programming language (PL) and natural language (NL) data to construct different variants. Furthermore, we continue to train the existing pre-trained models by masked language modeling (MLM) and contrastive pre-training task on the original samples with their augmented variants to enhance the robustness of the model. The extensive ex-periments demonstrate that ContraBERT can effectively improve the robustness of the existing pre-trained models. Further study also confirms that these robustness-enhanced models provide improvements as compared to original models over four popular downstream tasks.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • Multi-target Backdoor Attacks for Code Pre-trained Models 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Multi-target Backdoor Attacks for Code Pre-trained Models 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection Systems 引用了 A Simple Framework for Contrastive Learning of Visual Representations
  • Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study 引用了 Multi-target Backdoor Attacks for Code Pre-trained Models
  • Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • SimCSE: Simple Contrastive Learning of Sentence Embeddings 引用了 A Simple Framework for Contrastive Learning of Visual Representations
  • Learning Transferable Visual Models From Natural Language Supervision 引用了 A Simple Framework for Contrastive Learning of Visual Representations
  • Your Code Secret Belongs to Me: Neural Code Completion Tools Can Memorize Hard-Coded Credentials 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program Repair 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper15

  1. Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical StudyQi Guo, Junming Cao, Xiaofei Xie, Shangqing Liu 等ICSE 2024 · 107 次引用
  2. An Empirical Study on Fine-Tuning Large Language Models of Code for Automated Program RepairKai Huang, Xiangxin Meng, Jian Zhang, Yang Liu 等ASE 2023 · 91 次引用
  3. Multi-target Backdoor Attacks for Code Pre-trained ModelsYanzhou Li, Shangqing Liu, Kangjie Chen, Xiaofei Xie 等ACL 2023 · 28 次引用
  4. Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection SystemsSicong Cao, Xiaobing Sun, Xiaoxue Wu, David Lo 等ICSE 2024 · 27 次引用
  5. Your Code Secret Belongs to Me: Neural Code Completion Tools Can Memorize Hard-Coded CredentialsYizhan Huang, Yichen Li, Weibin Wu, Jianping Zhang 等FSE 2024 · 22 次引用

它引用的 Paper24

  1. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh 等ICML 2021 · 47,906 次引用
  2. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
  3. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
  4. SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 次引用
  5. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用

相关 Paper

  1. Contrastive Code Representation LearningParas Jain, Ajay Jain, Tianjun Zhang, Pieter Abbeel 等EMNLP 2021 · 11 次引用
  2. Natural Attack for Pre-trained Models of CodeZhou Yang, Jieke Shi, Junda He, David LoICSE 2022 · 150 次引用
  3. Bridging Pre-trained Models and Downstream Tasks for Source Code UnderstandingDeze Wang, Zhouyang Jia, Shanshan Li, Yue Yu 等ICSE 2022 · 68 次引用
  4. CoCoSoDa: Effective Contrastive Learning for Code SearchEnsheng Shi, Yanlin Wang, Wenchao Gu, Lun Du 等ICSE 2023 · 45 次引用
  5. DIP: Dead code Insertion based Black-box Attack for Programming Language ModelCheolWon Na, YunSeok Choi, Jee-Hyong LeeACL 2023 · 13 次引用
黄昏的海面,两侧是细线勾勒的悬崖