paper-with-me

Papers

CodePurify: Defend Backdoor Attacks on Neural Code Models via Entropy-based Purification

2024-10-26 · 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.

📄 PDF Abstract BibTeX arXiv:2410.20136

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

On Certifying Robustness against Backdoor Attacks via Randomized Smoothing

2020-02-26 · Binghui Wang, Xiaoyu Cao, Jinyuan Jia, Neil Zhenqiang Gong

Backdoor attack is a severe security threat to deep neural networks (DNNs). We envision that, like adversarial examples, there will be a cat-and-mouse game for backdoor attacks, i.e., new empirical defenses are developed…

Backdoor Attack

Backdoor Token Unlearning: Exposing and Defending Backdoors in Pretrained Language Models

2025-01-05 · Peihai Jiang, Xixiang Lyu, Yige Li, Jing Ma

Supervised fine-tuning has become the predominant method for adapting large pretrained models to downstream tasks. However, recent studies have revealed that these models are vulnerable to backdoor attacks, where even a …

backdoor defense

ONION: A Simple and Effective Defense Against Textual Backdoor Attacks

2020-11-20 · EMNLP 2021 11 · Fanchao Qi, Yangyi Chen, Mukai Li, Yuan YAO 외

Backdoor attacks are a kind of emergent training-time threat to deep neural networks (DNNs). They can manipulate the output of DNNs and possess high insidiousness. In the field of natural language processing, some attack…

Backdoor Attackbackdoor defense

Defending Backdoor Data Poisoning Attacks by Using Noisy Label Defense Algorithm

2021-09-29 · Boyang Liu, Zhuangdi Zhu, Pang-Ning Tan, Jiayu Zhou

Training deep neural networks with data corruption is a challenging problem. One example of such corruption is the backdoor data poisoning attack, in which an adversary strategically injects a backdoor trigger to a small…

Backdoor AttackData Poisoning

Defending Text-to-image Diffusion Models: Surprising Efficacy of Textual Perturbations Against Backdoor Attacks

2024-08-28 · Oscar Chew, Po-Yi Lu, Jayden Lin, Hsuan-Tien Lin

Text-to-image diffusion models have been widely adopted in real-world applications due to their ability to generate realistic images from textual descriptions. However, recent studies have shown that these methods are vu…

backdoor defense