TrojText: Test-time Invisible Textual Trojan Insertion
Abstract
In Natural Language Processing (NLP), intelligent neuron models can be susceptible to textual Trojan attacks. Such attacks occur when Trojan models behave normally for standard inputs but generate malicious output for inputs that contain a specific trigger. Syntactic-structure triggers, which are invisible, are becoming more popular for Trojan attacks because they are difficult to detect and defend against. However, these types of attacks require a large corpus of training data to generate poisoned samples with the necessary syntactic structures for Trojan insertion. Obtaining such data can be difficult for attackers, and the process of generating syntactic poisoned triggers and inserting Trojans can be time-consuming. This paper proposes a solution called TrojText, which aims to determine whether invisible textual Trojan attacks can be performed more efficiently and cost-effectively without training data. The proposed approach, called the Representation-Logit Trojan Insertion (RLI) algorithm, uses smaller sampled test data instead of large training data to achieve the desired attack. The paper also introduces two additional techniques, namely the accumulated gradient ranking (AGR) and Trojan Weights Pruning (TWP), to reduce the number of tuned parameters and the attack overhead. The TrojText approach was evaluated on three datasets (AG's News, SST-2, and OLID) using three NLP models (BERT, XL-Net, and DeBERTa). The experiments demonstrated that the TrojText approach achieved a 98.35% classification accuracy for test sentences in the target class on the BERT model for the AG's News dataset. The source code for TrojText is available at https://github.com/UCF-ML-Research/TrojText .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
9 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Memory Injection Attacks on LLM Agents via Query-Only Interaction cites BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models
- BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models cites Weight Poisoning Attacks on Pretrained Models
- Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context Learning cites BadChain: Backdoor Chain-of-Thought Prompting for Large Language Models
- Jailbreaking LLMs with Arabic Transliteration and Arabizi cites TrojLLM: A Black-box Trojan Prompt Attack on Large Language Models
- TrojLLM: A Black-box Trojan Prompt Attack on Large Language Models cites Deberta: decoding-Enhanced Bert with Disentangled Attention
- TrojLLM: A Black-box Trojan Prompt Attack on Large Language Models cites Weight Poisoning Attacks on Pretrained Models
Cited by top-tier papers9
- Memory Injection Attacks on LLM Agents via Query-Only InteractionShen Dong, Shaochen Xu, Pengfei He, Yige Li et al.NeurIPS 2025 · 146 citations
- BadChain: Backdoor Chain-of-Thought Prompting for Large Language ModelsZhen Xiang, Fengqing Jiang, Zidi Xiong, Bhaskar Ramasubramanian et al.ICLR 2024 · 98 citations
- TrojLLM: A Black-box Trojan Prompt Attack on Large Language ModelsJiaqi Xue, Mengxin Zheng, Ting Hua, Yilin Shen et al.NeurIPS 2023 · 63 citations
- Universal Vulnerabilities in Large Language Models: Backdoor Attacks for In-context LearningShuai Zhao, Meihuizi Jia, Anh Tuan Luu, Fengjun Pan et al.EMNLP 2024 · 28 citations
- Jailbreaking LLMs with Arabic Transliteration and ArabiziMansour Al Ghanim, Saleh Almohaimeed, Mengxin Zheng, Yan Solihin et al.EMNLP 2024 · 3 citations
Builds on14
- Deberta: decoding-Enhanced Bert with Disentangled AttentionPengcheng He, Xiaodong Liu, Jianfeng Gao, Weizhu ChenICLR 2021 · 3,729 citations
- CSI NN: Reverse Engineering of Neural Network Architectures Through Electromagnetic Side ChannelLejla Batina, Shivam Bhasin, Dirmanto Jap, Stjepan PicekUSENIX Security 2019 · 334 citations
- Weight Poisoning Attacks on Pretrained ModelsKeita Kurita, Paul Michel, Graham NeubigACL 2020 · 312 citations
- Bit-Flip Attack: Crushing Neural Network With Progressive Bit SearchAdnan Siraj Rakin, Zhezhi He, Deliang FanICCV 2019 · 309 citations
- Language model compression with weighted low-rank factorizationYen-Chang Hsu, Ting Hua, Sungen Chang, Qian Lou et al.ICLR 2022 · 210 citations
Related papers
- Hidden Killer: Invisible Textual Backdoor Attacks with Syntactic TriggerFanchao Qi, Mukai Li, Yangyi Chen, Zhengyan Zhang et al.ACL 2021
- Attention-Enhancing Backdoor Attacks Against BERT-based ModelsWeimin Lyu, Songzhu Zheng, Lu Pang, Haibin Ling et al.EMNLP Findings 2023 · 36 citations
- T-Miner: A Generative Approach to Defend Against Trojan Attacks on DNN-based Text ClassificationAhmadreza Azizi, Ibrahim Asadullah Tahmid, Asim Waheed, Neal Mangaokar et al.USENIX Security 2021 · 98 citations
- TWIST: Text-encoder Weight-editing for Inserting Secret Trojans in Text-to-Image ModelsXindi Li, Zhe Liu, Tong Zhang, Jiahao Chen et al.ACL 2025 · 1 citation
- Hidden Backdoors in Human-Centric Language ModelsShaofeng Li, Hui Liu, Tian Dong, Benjamin Zi Hao Zhao et al.CCS 2021 · 108 citations
