Computer Science ›› 2026, Vol. 53 ›› Issue (11A): 251100138-1113.doi: 10.11896/jsjkx.251100138

• Information Security • Previous Articles     Next Articles

Attention-based Backdoor Attack on Chinese Text

ZOU Yujuan, YAN Qiao, ZHANG Qian, YANG Hanbing   

  1. College of Computer Science and Software Engineering,Shenzhen University,Shenzhen,Guangdong 518060,China
  • Online:2026-11-16 Published:2026-11-16
  • About author:ZOU Yujuan,born in 2001,postgra-duate.Her main research interests include AI security and natural language processing.
    YAN Qiao,born in 1972,professor,Ph.D supervisor,is a distinguished member of CCF(No.10486D).Her main research interests include network security and artificial intelligence.
  • Supported by:
    This work was supported by the National Natural Science Foundation of China(61976142) and Shenzhen Science and Technology Plan Project(JCYJ20210324093609025).

Abstract: Pre-trained language models(PLMs) have achieved remarkable success in natural language processing.However,their vulnerability to backdoor attacks has become increasingly evident.Traditional trigger injection mechanisms often insert triggers randomly or at fixed positions,resulting in poor attack effectiveness,semantic incoherence,and low stealthiness.To address these shortcomings,this paper proposes a trigger injection strategy based on the attention weights of PLMs.The strategy evaluates the importance of each token by analyzing the attention weights of the PLM,aggregates attention weights across different layers using exponential decay weighting,and introduces an attention head screening mechanism to obtain global attention scores for ranking.During model training,tokens with low scores are perturbed to embed the backdoor while preserving the model’s performance on the original task.During inference,a reverse selection mechanism is employed,preferentially embedding triggers into keywords with high global attention scores to maximize interference with the model’s output.Extensive experiments are conducted on two Chinese comment datasets and three PLMs,and further extended to four large language models.The results demonstrate that the proposed method achieves the expected attack success rate while maintaining the model’s original performance.Moreover,it significantly outperforms baseline methods in terms of semantic similarity,perplexity,and the number of grammatical errors.

Key words: Pre-trained language models, Backdoor attack, Chinese text, Attention mechanism, Trigger injection strategy

CLC Number: 

  • TP393
[1] GUO J,HUO Y Z,HUANG W H.A BERT-based Text Classification Backdoor Attack Method [J].Computer and Information Technology,2023,31(4):79-82,92.
[2] ZHENG M Y,LIN Z,LIU Z X,et al.A Survey of Textual Backdoor Attacks and Defenses [J].Journal of Computer Research and Development,2024,61(1):221-242.
[3] GU T,LIU K,DOLAN-GAVITT B,et al.Badnets:Evaluating backdooring attacks on deep neural networks[J].IEEE Access,2019,7:47230-47244.
[4] LIU Y Q,MA S Q,AAFER Y,et al.Trojaning attack on neural networks [C]//Proceedings of the 25th Annual Network and Distributed System Security Symp(NDSS).Reston,VA:The Internet Society,2017:18-21.
[5] KIM Y.Convolutional neural networks for sentence classification [C]//Proceedings of the 19th Conference on Empirical Methods in Natural Language Processing(EMNLP).Stroudsburg,PA:ACL,2014:1746-1751.
[6] KURITA K,MICHEL P,NEUBIG G.Weight poisoning attacks on pretrained models [C]//Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics.Stroudsburg,PA:ACL,2020:2793-2806.
[7] QI F,YAO Y,XU S,et al.Turn the combination lock:Learnabletextual backdoor attacks via word substitution[C]//Proceedings of the 59th Annual Meeting of the Association for Computa-tional Linguistics and the 11th International Joint Conference on Natural Language Processing(Volume 1:Long Papers).2021:4873-4883.
[8] LI L Y,SONG D M,LI X N,et al.Backdoor attacks on pretrained models by layerwise weight poisoning [C]//Proceedings of the 26th Conference on Empirical Methods in Natural Language Processing.Stroudsburg,PA:ACL,2021:3023-3032.
[9] QI F C,LI M K,CHEN Y Y,et al.Hidden killer:Invisible textual backdoor attacks with syntactic trigger [C]//Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th Int Joint Conf on Natural Language Processing.Stroudsburg,PA:ACL,2021:443-453.
[10] QI F C,CHEN Y G,ZHANG X R,et al.Mind the style of text! adversarial and backdoor attacks based on text style transfer [C]//Proceedings of the 2021 Conferenceon Empirical Methods in Natural Language Processing.Stroudsburg,PA:ACL,2021:4569-4580.
[11] ZHOU X,LI J,ZHANG T,et al.Backdoor attacks with input-unique triggers in nlp[C]//Joint European Conference on Machine Learning and Knowledge Discovery in Databases.Cham:Springer Nature Switzerland,2024:296-312.
[12] ZHANG R,LI H,WEN R,et al.Instruction backdoor attacks against customized {LLMs}[C]//33rd USENIX Security Symposium(USENIX Security 24).2024:1849-1866.
[13] HU M,YANG Y,PAN D,et al.Syntactic paraphrase-based synthetic data generation for backdoor attacks against Chinese language models[J].Information Fusion,2025,124:103376.
[14] HE X,HAO F,GU T,et al.Cbas:Character-level backdoor attacks against chinese pre-trained language models[J].ACM Transactions on Privacy and Security,2024,27(3):1-26.
[15] LIU M,ZHANG Z,ZHANG Y,et al.Automatic generation of adversarial readable Chinese texts[J].IEEE Transactions on Dependable and Secure Computing,2022,20(2):1756-1770.
[16] SUN M S,LI J Y,GUO Z P,et al.THUCTC:An Efficient Chinese Text Classification Toolkit [EB/OL].Technical Report,Beijing:Tsinghua University.http://thulac.thunlp.org.
[17] DEVLIN J,CHANG M W,LEE K,et al.Bert:Pre-training ofdeep bidirectional transformers for language understanding[C]//Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics:Human Language Technologies,Volume 1(Long and Short Papers).2019:4171-4186.
[18] LIU Y,OTT M,GOYAL N,et al.Roberta:A robustly opti-mized bert pretraining approach[J].arXiv:1907.11692,2019.
[19] KITAEV N,KALSER Ł,LEVSKAYA A.Reformer:The efficient transformer[J].arXiv:2001.04451,2020.
[20] PAN X,ZHANG M,SHENG B,et al.Hidden trigger backdoor attack on {NLP} models via linguistic style manipulation[C]//31st USENIX Security Symposium(USENIX Security 22).2022:3611-3628.
[21] LI S,LIU H,DONG T,et al.Hidden backdoors in human-centric language models[C]//Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security.2021:3123-3140.
[22] CHEN X,SALEM A,CHEN D,et al.Badnl:Backdoor attacks against nlp models with semantic-preserving improvements[C]//Proceedings of the 37th Annual Computer Security Applications Conference.2021:554-569.
[23] LI J,DU T,JI S,et al.{TextShield}:Robust text classification based on multimodal embedding and neural machine translation[C]//29th USENIX Security Symposium(USENIX Security 20).2020:1381-1398.
[24] MAATEN L,HINTON G.Visualizing data using t-SNE[J].Journal of machine learning research,2008,9(Nov):2579-2605.
[1] YANG Chenguang, LU Jicang, GUO Jiaxing. Fake News Detection Model Based on Cross-modal Feature Fusion and Alignment [J]. Computer Science, 2026, 53(8): 257-265.
[2] MAO Yixiao, WANG Zixiao, ZHANG Baili, ZONG Shaohao. Element-aware Screening Method for Popularization Cases [J]. Computer Science, 2026, 53(8): 316-325.
[3] FENG Haoyu, ZHANG Yuxuan, LIU Zixuan, MENG Hua. Network Anomaly Traffic Detection Based on Deep Multi-instance Learning [J]. Computer Science, 2026, 53(8): 426-436.
[4] ZHU Bin, LI Xiaobin. AETC:Image Classification Model via Attention-based Topological Features Fusion [J]. Computer Science, 2026, 53(7): 24-33.
[5] ZHANG Yan, ZHOU Jian, HAN Lei, CHENG Chunling. Gate-controlled Agent Attention Mechanism-based Soft Prompt Transfer Method [J]. Computer Science, 2026, 53(7): 139-145.
[6] DING Zhijun, AI Fangju, LIU Aihuan. Document-level Event Argument Extraction Model Based on Hierarchical Dependency Aggregation and Event Enhancement [J]. Computer Science, 2026, 53(7): 156-167.
[7] LI Kaiju, YIN Chenyang, CHENG Zhangtao, LIU Xueting, ZHOU Fan. Causal Subgraph Learning for Cascade Popularity Prediction [J]. Computer Science, 2026, 53(7): 213-221.
[8] XIAO Yanxue, DENG Li, REN Zhengwei, WU Mengxin. iDSRformer:Node Load Prediction Model for High-performance Computing Cluster [J]. Computer Science, 2026, 53(7): 251-261.
[9] DUAN Haiying, WANG Baohui, HUANG He. Malicious Traffic Detection Method of ICMP Covert Channel Based on Baseline Features [J]. Computer Science, 2026, 53(6A): 250200069-11.
[10] LI Jie, WANG Baohui, ZHANG Jingyuan. DDoS Attack Detection Based on Attention Mechanism TCN-BiLSTM [J]. Computer Science, 2026, 53(6A): 250300060-9.
[11] ZHANG Shouyi, SHEN Qiang, GUO Yiran, WANG Hanyu. Rain and Fog Weather Object Detection Algorithm Based on Improved YOLOv8 Model [J]. Computer Science, 2026, 53(6A): 250300090-7.
[12] YANG Geer, WANG Xin, SUN Wei, WANG Xinge, HU Zhongrui, MENG Wenjun, ZHANG Junqiang, WU Xinghui, LIU Jinshan, YAN Yuming. Survey on Positional Encoding Algorithms in Deep Learning [J]. Computer Science, 2026, 53(6A): 250300107-16.
[13] WEI Wei, LI Bicheng, ZHU Zhenshui, ZUO Jun. Semantic Modeling and Co-attention Mechanism for Multimodal Sarcasm Detection Method [J]. Computer Science, 2026, 53(6A): 250400127-6.
[14] FENG Guang, LIN Jianzhong, ZHONG Ting, ZHOU Yuanhua, ZHENG Runting, LIU Tianxiang. Triple Extraction Based on Pixel Difference Convolutional Network and Attention Mechanism [J]. Computer Science, 2026, 53(6A): 250400136-10.
[15] CHEN Dianlong, LIU Tengbin, GAO Xiong, TIAN Zijian, ZHU Wenbing, ZOU Shun, WANG Qiang. Defect Detection of Transmission Line Fittings Based on Multiscale Feature Fusion Attention and Cross-layer Aggregation [J]. Computer Science, 2026, 53(6A): 250600110-7.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!