[Paper Review] TrojText: Test-time Invisible Textual Trojan Insertion
TrojText proposes a test-time invisible textual Trojan attack that bypasses the need for training data by using a Representation-Logit Trojan Insertion (RLI) objective to learn syntactic triggers from small test data. It achieves 98.35% attack success rate on BERT for AG’s News with only 2,000 test samples and reduces bit-flip overhead via Accumulated Gradient Ranking and Trojan Weights Pruning.
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, XLNet, 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.
Motivation & Objective
- To develop a test-time invisible Trojan attack that does not require access to large downstream training datasets.
- To reduce the computational and time overhead of Trojan insertion by minimizing the number of tuned parameters and bit flips.
- To improve stealth and feasibility of syntactic-structure-based Trojans by leveraging small test data instead of large-scale training data.
- To address the growing challenge of detecting training-time Trojans by shifting the attack to test-time, where detection is more difficult.
- To provide a practical and efficient method for deploying invisible syntactic triggers in deployed NLP models without retraining.
Proposed method
- Introduces a Representation-Logit Trojan Insertion (RLI) objective that aligns representations and logits of trigger-embedded texts with those of clean target texts, enabling learning without labeled training data.
- Employs Accumulated Gradient Ranking (AGR) to identify the most critical model parameters for bit-flip modification, reducing the number of bits that need to be altered.
- Applies Trojan Weights Pruning (TWP) to further minimize the number of tuned parameters by setting a threshold on gradient magnitude, thereby reducing attack overhead.
- Uses a syntactically controlled paraphrase network (SCPN) to generate invisible syntactic triggers from small test data samples.
- Performs test-time weight modifications via bit flips in model memory, targeting only the most influential parameters identified by AGR and TWP.
- Optimizes the attack using a loss function that balances clean accuracy (CACC) and attack success rate (ASR), with hyperparameters λ and e for tunable trade-offs.
Experimental results
Research questions
- RQ1Can invisible syntactic Trojan attacks be effectively mounted at test time without requiring access to large downstream training datasets?
- RQ2How effective is the RLI objective in learning syntactic triggers from minimal test data while maintaining high attack success and clean accuracy?
- RQ3To what extent can AGR and TWP reduce the number of bit flips required for successful Trojan insertion, thereby lowering attack detectability and overhead?
- RQ4How does the proposed method compare to existing training-time Trojan attacks in terms of stealth, efficiency, and resistance to detection?
- RQ5What is the impact of model architecture and dataset choice on the performance and robustness of the TrojText attack?
Key findings
- TrojText achieves a 98.35% attack success rate (ASR) on the BERT model for the AG’s News dataset using only 2,000 test samples, significantly outperforming baseline models.
- The RLI objective improves ASR by 2.73% and CACC by 2.07% on average compared to baseline models, even with limited data.
- When combining RLI, AGR, and TWP, the attack success rate increases by 3.57% and clean accuracy by 2.04%, while reducing the bit-flip rate by 50.15% on average.
- With only 210 bit flips, TrojText achieves 80.72% CACC and 83.42% ASR, rising to 92.28% CACC and 98.45% ASR with 2,008 bit flips.
- TrojText’s defense resistance is demonstrated by a 5.54% to 24.68% drop in ASR and a 59–86 increase in TPN (total parameter number) after applying matrix decomposition-based defense.
- The threshold $e$ in TWP allows tunable trade-offs: increasing $e$ from 0 to 0.05 reduces bit-flip count by 962 while only decreasing ASR by 0.88% and CACC by 1.87%.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.