CodePurify: Defend Backdoor Attacks on Neural Code Models via Entropy-based Purification
Institute of Software Chinese Academy of Sciences(中国科学院软件研究所);University of Chinese Academy of Sciences(中国科学院大学);Beihang University(北京航空航天大学);York University(约克大学);Lassonde School of Engineering(拉桑德工程学院)
Fangwen Mu, Junjie Wang, Zhuohao Yu, Lin Shi, Song Wang, Mingyang Li, Qing Wang
Neural code models have found widespread success in tasks pertaining to code intelligence, yet they are vulnerable to backdoor attacks, where an adversary can manipulate the victim model's behavior by inserting triggers into the source code. Recent studies indicate that advanced backdoor attacks can achieve nearly 100% attack success rates on many software engineering tasks. However, effective defense techniques against such attacks remain insufficiently explored. In this study, we propose CodePurify, a novel defense against backdoor attacks on code models through entropy-based purification. Entropy-based purification involves the process of precisely detecting and eliminating the possible triggers in the source code while preserving its semantic information. Within this process, CodePurify first develops a confidence-driven entropy-based measurement to determine whether a code snippet is poisoned and, if so, locates the triggers. Subsequently, it purifies the code by substituting the triggers with benign tokens using a masked language model. We extensively evaluate CodePurify against four advanced backdoor attacks across three representative tasks and two popular code models. The results show that CodePurify significantly outperforms four commonly used defense baselines, improving average defense performance by at least 40%, 40%, and 12% across the three tasks, respectively. These findings highlight the potential of CodePurify to serve as a robust defense against backdoor attacks on neural code models.
Defending Model Inversion and Membership Inference Attacks via Prediction Purification
Zhejiang University(浙江大学);Alibaba-Zhejiang University Joint Institute of Frontier Technologies(阿里巴巴-浙江大学前沿技术联合研究院);Zhejiang Lab(之江实验室);National University of Singapore(新加坡国立大学)
MalPurifier: Enhancing Android Malware Detection with Adversarial Purification against Evasion Attacks
School of Cyber Science and Engineering, Southeast University, Purple Mountain Laboratories, and Jiangsu Province Engineering Research Center of Security for Ubiquitous Network(网络 ubiquity 安全江苏省工程研究中心、紫金山实验室、东南大学网络科学与工程学院)
Adversarial Diffusion Across Modalities: A Fusion Survey of Attacks, Defenses, and Evaluation for Text, Vision, and Vision-Language Models
Information and Computer Science Department, King Fahd University of Petroleum & Minerals(国王法赫德石油矿物大学信息与计算机科学系);College of Computer Science and Information Technology, Imam Abdulrahman Bin Faisal University(伊玛目阿卜杜勒拉赫曼·本·法伊塞尔大学计算机科学与信息科技学院);SDAIA-KFUPM Joint Research Center for Artificial Intelligence, King Fahd University of Petroleum & Minerals(SDAIA-KFUPM人工智能联合研究中心,国王法赫德石油矿物大学)