Pruning and Malicious Injection: A Retraining-Free Backdoor Attack on Transformer Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Zhao, Taibiao, Sun, Mingxuan, Wang, Hao, Chen, Xiaobing, Zhou, Xiangwei
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916898267987968
author Zhao, Taibiao
Sun, Mingxuan
Wang, Hao
Chen, Xiaobing
Zhou, Xiangwei
author_facet Zhao, Taibiao
Sun, Mingxuan
Wang, Hao
Chen, Xiaobing
Zhou, Xiangwei
contents Transformer models have demonstrated exceptional performance and have become indispensable in computer vision (CV) and natural language processing (NLP) tasks. However, recent studies reveal that transformers are susceptible to backdoor attacks. Prior backdoor attack methods typically rely on retraining with clean data or altering the model architecture, both of which can be resource-intensive and intrusive. In this paper, we propose Head-wise Pruning and Malicious Injection (HPMI), a novel retraining-free backdoor attack on transformers that does not alter the model's architecture. Our approach requires only a small subset of the original data and basic knowledge of the model architecture, eliminating the need for retraining the target transformer. Technically, HPMI works by pruning the least important head and injecting a pre-trained malicious head to establish the backdoor. We provide a rigorous theoretical justification demonstrating that the implanted backdoor resists detection and removal by state-of-the-art defense techniques, under reasonable assumptions. Experimental evaluations across multiple datasets further validate the effectiveness of HPMI, showing that it 1) incurs negligible clean accuracy loss, 2) achieves at least 99.55% attack success rate, and 3) bypasses four advanced defense mechanisms. Additionally, relative to state-of-the-art retraining-dependent attacks, HPMI achieves greater concealment and robustness against diverse defense strategies, while maintaining minimal impact on clean accuracy.
format Preprint
id arxiv_https___arxiv_org_abs_2508_10243
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Pruning and Malicious Injection: A Retraining-Free Backdoor Attack on Transformer Models
Zhao, Taibiao
Sun, Mingxuan
Wang, Hao
Chen, Xiaobing
Zhou, Xiangwei
Machine Learning
Transformer models have demonstrated exceptional performance and have become indispensable in computer vision (CV) and natural language processing (NLP) tasks. However, recent studies reveal that transformers are susceptible to backdoor attacks. Prior backdoor attack methods typically rely on retraining with clean data or altering the model architecture, both of which can be resource-intensive and intrusive. In this paper, we propose Head-wise Pruning and Malicious Injection (HPMI), a novel retraining-free backdoor attack on transformers that does not alter the model's architecture. Our approach requires only a small subset of the original data and basic knowledge of the model architecture, eliminating the need for retraining the target transformer. Technically, HPMI works by pruning the least important head and injecting a pre-trained malicious head to establish the backdoor. We provide a rigorous theoretical justification demonstrating that the implanted backdoor resists detection and removal by state-of-the-art defense techniques, under reasonable assumptions. Experimental evaluations across multiple datasets further validate the effectiveness of HPMI, showing that it 1) incurs negligible clean accuracy loss, 2) achieves at least 99.55% attack success rate, and 3) bypasses four advanced defense mechanisms. Additionally, relative to state-of-the-art retraining-dependent attacks, HPMI achieves greater concealment and robustness against diverse defense strategies, while maintaining minimal impact on clean accuracy.
title Pruning and Malicious Injection: A Retraining-Free Backdoor Attack on Transformer Models
topic Machine Learning
url https://arxiv.org/abs/2508.10243