Lune

EMNLP2023顶会

Joint Geometrical and Statistical Domain Adaptation for Cross-domain Code Vulnerability Detection

Qianjin Du, Shiji Zhou, Xiaohui Kuang, Gang Zhao, Jidong Zhai

摘要

In code vulnerability detection tasks, a detector trained on a label-rich source domain fails to provide accurate prediction on new or unseen target domains due to the lack of labeled training data on target domains. Previous studies mainly utilize domain adaptation to perform cross-domain vulnerability detection. But they ignore the negative effect of private semantic characteristics of the target domain for domain alignment, which easily causes the problem of negative transfer. In addition, these methods forcibly reduce the distribution discrepancy between domains and do not take into account the interference of irrelevant target instances for distributional domain alignment, which leads to the problem of excessive alignment. To address the above issues, we propose a novel cross-domain code vulnerability detection framework named MN-CRI. Specifically, we introduce mutual nearest neighbor contrastive learning to align the source domain and target domain geometrically, which could align the common semantic characteristics of two domains and separate out the private semantic characteristics of each domain. Furthermore, we introduce an instance re-weighting scheme to alleviate the problem of excessive alignment. This scheme dynamically assign different weights to instances, reducing the contribution of irrelevant instances so as to achieve better domain alignment. Finally, extensive experiments demonstrate that MNCRI significantly outperforms state-of-the-art cross-domain code vulnerability detection methods by a large margin.

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Applying Contrastive Learning to Code Vulnerability Type Classification 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Applying Contrastive Learning to Code Vulnerability Type Classification 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
  • Applying Contrastive Learning to Code Vulnerability Type Classification 引用了 Supervised Contrastive Learning
  • Supervised Contrastive Learning 引用了 A Simple Framework for Contrastive Learning of Visual Representations
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper1

  1. Applying Contrastive Learning to Code Vulnerability Type ClassificationChen Ji, Su Yang, Hongyu Sun, Yuqing ZhangEMNLP 2024 · 6 次引用

它引用的 Paper9

  1. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
  2. Supervised Contrastive LearningPrannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna 等NeurIPS 2020 · 7,049 次引用
  3. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
  4. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
  5. 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 次引用

相关 Paper

  1. Code Vulnerability Detection via Nearest Neighbor MechanismQianjin Du, Xiaohui Kuang, Gang ZhaoEMNLP Findings 2022 · 6 次引用
  2. CLeVeR: Multi-modal Contrastive Learning for Vulnerability Code RepresentationJiayuan Li, Lei Cui, Sen Zhao, Yun Yang 等ACL Findings 2025 · 4 次引用
  3. Cross-Domain Graph Anomaly Detection via Anomaly-Aware Contrastive AlignmentQizhou Wang, Guansong Pang, Mahsa Salehi, Wray L. Buntine 等AAAI 2023 · 51 次引用
  4. Cross-Domain Detection via Graph-Induced Prototype AlignmentMinghao Xu, Hang Wang, Bingbing Ni, Qi Tian 等CVPR 2020
  5. CL3D: Unsupervised Domain Adaptation for Cross-LiDAR 3D DetectionXidong Peng, Xinge Zhu, Yuexin MaAAAI 2023 · 37 次引用
黄昏的海面,两侧是细线勾勒的悬崖