Trigger-Invariant Contrastive Unlearning for Backdoor RemovalTrigger-Invariant Contrastive Unlearning for Backdoor Removal
The authors propose the backdoor removal method TICU, constraining prediction and representation consistency before and after triggering; the authors say it is superior on the main robustness metric in 30 of 45 configurations.
Standard targeted backdoor attack: the attacker inserts a trigger into 10% of non-target-class training samples and changes them to a fixed target class, so that the model behaves normally on clean inputs and outputs the target class on triggered inputs. The defender can obtain poisoned samples via a known trigger or a reconstruction method; the actual pipeline first uses CUBE for detection, then estimates the trigger distribution and repairs the poisoned model.
- GA-type backdoor unlearning weakens the attack by increasing the loss on poisoned samples, but the authors point out that it may shift the trigger's influence to other classes, and conventional ACC and original attack success rate can hardly capture this trigger shifting.
- TICU first uses CUBE to detect candidate poisoned samples and estimate the trigger distribution, then constructs clean–trigger counterfactual pairs and jointly optimizes clean classification, prediction invariance, representation alignment and parameter regularization to fine-tune the poisoned model.
- The experiments cover 5 models, 3 classification datasets and 3 attacks. The authors report that TICU performs best under the main robustness criterion in 30 of the 45 configurations, but its LFR is not better than the strongest baseline in all configurations.
- The study focuses on text classification and three attacks; the authors plan to study adaptive attacks, trigger estimation and loss coefficient sensitivity, and extend to generative language models and other modalities. The experiments do not separately evaluate CUBE's detection precision, recall, or F1.
- Evaluated models
- BERT-baseDistilBERT-baseLLaMA-2 7BMistral 7BQwen2 7B
- Benchmarks
- SST-2HSOLAG NewsBadNetAddSentHiddenKiller
- Metrics
- ACCLFRTACC∆TACC
Trigger-Invariant Contrastive Unlearning (TICU) keeps a model's predictions and representations invariant to trigger insertion, in order to remove textual backdoors in NLP models. It constructs counterfactual pairs of clean samples and trigger-inserted samples for fine-tuning, making output distributions consistent and hidden representations aligned, and constrains parameter drift. Across multiple datasets, multiple architectures, and multiple attack settings, TICU improves trigger sample accuracy, reduces trigger-induced prediction shift, and limits degradation of clean task performance compared with existing baselines.
Related events and news
1 events · 0 news mentions
- This event's paper
TICU:用触发器不变对比遗忘移除文本后门
Paper analysis
What problem does this paper attempt to solve?
Aiming at the trigger shifting that GA unlearning may cause, the authors propose directly repairing poisoned text classification models via trigger invariance.
The core problem is how to remove backdoors from text classification models, rather than shifting the trigger's influence from the attack target class to other classes.
- Problem setting: a backdoored model behaves normally on clean inputs but produces attacker-controlled outputs when it encounters word, syntactic, or style triggers. The authors argue that the use of third-party datasets and pre-trained models makes training poisoning hard for users to notice.
- Shortcomings of existing methods: the authors note that GA performs unlearning by maximizing loss on poisoned samples, which may produce trigger shifting; RGA still relies on loss maximization. Conventional clean accuracy and original attack success rate may also miss newly emerging backdoor behaviors.
- Core observation: gradient ascent on the target class lowers its logit and raises non-target-class logits, so reducing target-class probability does not necessarily eliminate trigger dependence. The authors instead use prediction and representation consistency between clean and triggered inputs as the repair objective.
- Proposed method: the paper proposes Trigger-Invariant Contrastive Unlearning (TICU), jointly constraining clean classification, prediction invariance, representation alignment, and parameter drift, with ∆TACC as the main robustness metric and LFR measuring target-label flipping.
- Threat model:
- Attack goal: a standard targeted backdoor attack maps triggered inputs to a fixed target class y* while keeping clean input classification.
- Attack capability: inserting triggers into 10% of non-target-class training samples and relabeling them as the target class.
- Defender knowledge and capability: the authors assume poisoned samples can be obtained via known triggers or reconstruction methods; the actual evaluation first uses CUBE detection, then estimates the trigger distribution.
- Victim system: trained text classification models, including fully fine-tuned encoder models and decoder models using LoRA.
What related research exists?
Related work is divided into backdoor attacks, post-training and training-time defenses, machine unlearning and counterfactual learning; TICU is positioned as invariance repair.
Backdoor attacks
- BadNet and word-level attacks: Gu et al. (2017), Kurita et al. (2020), and Li et al. (2021a) study data poisoning, weight poisoning, and explicit lexical triggers; Yang et al. (2021b) and others further use context-dependent words.
- Stealthy triggers: Qi et al. (2021c)'s HiddenKiller uses syntactic structures, and Qi et al. (2021b) uses text style; Gan et al. (2022), Yan et al. (2023), and Gupta and Krishna (2023) discuss clean-label-preserving attacks.
- Attack lifecycle: Yang et al. (2021a) and Chen et al. (2021) discuss adaptability across tasks or datasets, Li et al. (2021a) discusses persistence after fine-tuning; Zhou et al. (2025) survey threats in the pre-training, fine-tuning, and inference stages.
Backdoor defenses
- Training-time defenses: Geiping et al. (2021) uses adversarial training, Zhu et al. (2022) uses constrained optimization, and Tang et al. (2023) uses dedicated modules to absorb malicious updates. The paper notes that such methods usually assume control over the training process and may not apply when the model has already been compromised.
- Input-, data-, and model-level defenses: ONION and STRIP-ViTA perform perplexity filtering and entropy analysis, respectively; other work uses robustness, clustering, or attribution signals to detect poisoned samples. Model-level methods include trigger inversion such as T-Miner, fine-pruning, attention head pruning, fine-mixing, and fine-purifying.
Machine unlearning and counterfactual learning
- GA and RGA: Li et al. (2025) and others weaken the trigger–target association by maximizing loss on poisoned samples; Zhao et al. (2026) notes this may cause trigger shifting and proposes RGA to stabilize optimization and limit probability redistribution to non-target classes. The paper holds that RGA still does not directly eliminate the trigger's influence.
- Selective unlearning and counterfactual learning: Nguyen et al. (2022) and Tarun et al. (2023) discuss targeted unlearning while retaining useful knowledge; Wang and Culotta (2021) and Joshi and He (2022) study counterfactual inputs and prediction stability, motivating TICU's clean–triggered positive pairs.
Baselines and benchmarks in this paper: comparisons with GA, RGA, NPO, and clean retraining from scratch RT; using SST-2, HSOL, AG News, and BadNet, AddSent, HiddenKiller. The authors position TICU as directly constraining prediction and representation consistency before and after triggering, rather than indirectly suppressing backdoors through loss maximization.
How does the paper address this problem?
TICU applies the detected and estimated trigger to clean samples and jointly trains with four loss terms, making the outputs and hidden representations consistent before and after triggering.
TICU's overall idea is: first detect candidate poisoned samples from the poisoned model and estimate the trigger distribution, then construct trigger counterfactual inputs for clean samples, and complete model repair through prediction invariance, representation alignment, clean classification and parameter regularization.
Problem Setting and Trigger Shifting
- Backdoor training: the classifier fθ maps text to the K-class probability simplex, and hθ(x) denotes the hidden representation before the classification head. Triggered input is written as xt = x ⊕ t, and the labels of the poisoned subset are uniformly changed to the target class y*.
- Limitation of GA: in addition to the clean cross-entropy retention term, GA optimizes the negative of the cross-entropy on poisoned samples. The authors use cross-entropy gradients to explain that the ascent update lowers the target-class logit and raises other-class logits, and thus may shift triggered inputs toward y′ ≠ y*.
- Basis for invariance: for clean prediction p and triggered prediction q, the authors describe the goal as DKL(p|q)≤ϵ and use Pinsker's inequality to explain that it can constrain the change in prediction distribution caused by the trigger. The authors explicitly state that this is not a formal machine unlearning or deletion guarantee, because the divergence is only empirically minimized on the available trigger distribution.
Detection and Trigger Distribution Estimation
- Candidate sample detection: CUBE is used before unlearning, performing representation learning, embedding-space clustering and filtering in sequence; its basis is that poisoned samples may form compact minority clusters.
- Trigger distribution recovery: for lexical and phrase-level attacks, PT is estimated from highly representative trigger tokens or n-grams in the detected set; for syntactic attacks, the recovered syntactic template is used.
- Counterfactual construction: triggers are sampled from PT and applied to clean inputs to form clean–trigger pairs. The authors point out that TICU depends on the quality of this estimate, and detection errors may make the estimate incomplete or contaminated.
Joint Objective and Key Designs
- Overall objective: LTICU=Lclean+λpredLpred+λrepLrep+λregLreg, which respectively preserve clean-task capability, constrain outputs, align representations and limit parameter drift.
- Prediction and representation consistency: Lpred uses bidirectional KL divergence to avoid aligning only a single direction; Lrep uses 1 − cosine similarity between clean and triggered hidden representations to suppress trigger-related features.
- Parameter constraint: Lreg is the squared ℓ2 distance between the current parameters and the poisoned model parameters θt. All configurations fix λpred = 1.0, λrep = 0.1, λreg = 0.05, without tuning per setting.
Optimization Pipeline and Implementation Parameters
- Algorithm 1: initialize from θt; for each clean minibatch, sample triggers, construct triggered inputs, compute the four loss terms and the total gradient, then update with learning rate η, and finally return the repaired model.
- Training configuration: maximum sequence length 128; AdamW learning rate 2×10−5, no weight decay, gradient clipping 1.0, linear schedule with 6% warmup, batch size 8. The poisoned model is trained for 5 epochs and TICU for 10 epochs.
- Model adaptation: BERT-base and DistilBERT-base are fully fine-tuned; LLaMA-2 7B, Mistral 7B and Qwen2 7B use LoRA, 4-bit quantization and gradient checkpointing. LoRA uses r = 8, α = 16, dropout = 0.05, with adapters applied to attention and feed-forward projection layers.
Success Criteria and Evaluation Method
- Four metrics: ACC measures performance on the clean test set; LFR is the proportion of non-target samples classified as the target class due to the backdoor; TACC is computed by inserting the trigger into all test samples while keeping the original labels.
- Main robustness criterion: ∆TACC is the absolute difference between RT and the repaired model's TACC; lower means the repaired model is closer to the backdoor-free state. The authors use ∆TACC as the main trigger shifting metric, because LFR only captures direct flipping to the attack target class and may miss the influence of shifting to other labels.
What experiments did the paper conduct?
Five models, three datasets and three attacks form 45 configurations; the authors report that TICU is superior under the main robustness criterion in 30 configurations.
Experimental Setup
- Models evaluated: BERT-base and DistilBERT-base are fully fine-tuned; LLaMA-2 7B, Mistral 7B and Qwen2 7B use LoRA. Table 2 reports total parameters of 110M, 66M, 6.63B, 7.13B and 7.09B, respectively, with trainable parameters of 20.0M, 21.0M and 20.2M for the latter three.
- Datasets: in Table 1, SST-2 has 2 classes, 6,920 training/1,821 test; HSOL has 2 classes, 5,823/2,485; AG News has 4 classes, 8,000/1,000, with average lengths of 19.2, 13.2 and 37.1, respectively.
- Attacks and poisoning: BadNet, AddSent, HiddenKiller; all insert a trigger into 10% of non-target-class training samples and change them to the target class. HiddenKiller uses low-frequency syntactic templates; the triggers of BadNet and AddSent are automatically obtained from statistics of the poisoned samples.
- Baselines and pipeline: GA, RGA, NPO, and RT trained from scratch on clean data only. The actual repair pipeline first has CUBE provide candidate poisoned samples, then estimates PT; Table 3 shows only the strongest baseline in each model–dataset–attack configuration.
- Metrics and repetitions: higher ACC and TACC are better; lower LFR and ∆TACC are better; ∆TACC is the main robustness metric. Table 3 reports meanSD over three seeds; no LLM judging or human judgment was used.
- Attack starting point: Appendix Table 4 reports that poisoned-model ACC is generally above 89%; for example, BERT/SST-2/BadNet has ACC 91.71, LFR 100.00 and TACC 49.92, and Qwen/HSOL/BadNet has LFR 71.68.
Main Results
The table below is based on Table 3; values are means over three seeds; each row lists the strongest baseline for that configuration, not a fixed single method.
Swipe horizontally to read the table
Model Dataset/Attack TICU: ACC / LFR / TACC / ∆TACC Strongest baseline: method; ACC / LFR / TACC / ∆TACC Llama2 SST-2/HiddenKiller 94.18 / 19.96 / 79.35 / 0.36 NPO; 96.66 / 5.96 / 66.89 / 12.10 Llama2 HSOL/HiddenKiller 93.92 / 58.41 / 70.10 / 4.30 RGA; 89.71 / 52.18 / 72.35 / 2.05 BERT HSOL/HiddenKiller 95.09 / 47.55 / 74.65 / 0.12 RGA; 93.10 / 45.08 / 74.35 / 0.42 DistilBert HSOL/AddSent 95.17 / 60.30 / 95.29 / 1.03 RGA; 94.60 / 7.48 / 94.68 / 0.42 Mistral AG/HiddenKiller 91.10 / 69.07 / 46.80 / 31.70 RGA; 91.43 / 68.55 / 45.92 / 32.58 Qwen SST-2/AddSent 95.00 / 6.36 / 93.74 / 0.27 RGA; 94.95 / 3.25 / 91.39 / 2.62 Qwen AG/HiddenKiller 90.00 / 28.67 / 75.60 / 5.30 RGA; 88.57 / 18.75 / 78.10 / 2.80 Qwen HSOL/HiddenKiller 94.53 / 56.96 / 70.95 / 3.05 RGA; 93.23 / 46.93 / 74.02 / 0.02 - Overall conclusion: the authors report that TICU achieves the best performance under the main robustness criterion in 30 of the 45 configurations, i.e., 66.7%; the authors consider that the invariance objective can reduce residual trigger influence in multi-class settings.
- Exceptions: TICU does not outperform the strongest baseline in every configuration, especially in LFR. In the table, several HiddenKiller configurations also have higher ∆TACC than the corresponding baseline; the authors state that stealthy syntactic attacks and high label-flip settings remain challenging.
- Example in the main text: the authors state that on LLaMA-2/SST-2/HiddenKiller, TICU's ∆TACC is reduced by more than 96% relative to NPO; this statement corresponds to 0.36 and 12.10 in the table.
Loss Component Ablation
- What was tested: Figure 2 removes Lpred, Lrep and Lreg separately and compares LFR; the converted text does not provide the values of each bar, so bar heights or the full ranking are not read.
- Main phenomenon: the authors report that removing Lpred increases LFR in all configurations, and removing Lrep also degrades performance but usually with a smaller effect; removing Lreg causes the largest degradation.
- Specific numbers: after removing Lreg, LFR on Qwen/AG/BadNet rises from 9.33 to 40.93, and on BERT/HSOL/HiddenKiller from 47.55 to 89.54. The authors therefore consider that the regularization term helps prevent trigger shifting and stabilize unlearning.
Optimization Dynamics
- What was tested: Figure 3 shows the loss changes of CE, INV, REP and REG over 10 epochs; the converted text does not retain the coordinate values, so specific loss values cannot be reported.
- Authors' interpretation: the authors state that INV drops rapidly in the first several epochs, CE decreases, and REP and REG stabilize; the authors interpret this as reduced sensitivity of outputs to the trigger, preserved task performance and controlled parameter updates.
Other Ablations and Analyses
- Detection quality: CUBE's poison-detection precision, recall or F1 was not evaluated separately, nor was it compared with an oracle setting using ground-truth poisoned samples (5.1.5).
- Loss coefficients: all configurations share fixed coefficients; the paper explicitly leaves sensitivity analysis for future work and does not report a coefficient sweep (5.1.2).
- Attack strength comparison: Appendix A.1 states that AddSent and HiddenKiller often produce stronger label flipping than BadNet; the poisoned-model TACC on AG News is around 25–36% in multiple cases.
What are some points that can be further explored?
The authors list adaptive attacks, trigger estimation and coefficient sensitivity, generative models, and other modalities as future directions.
Limitations and future directions noted by the authors
- Detection errors affect repair: 5.1.5 notes that detection errors may make the PT estimate incomplete or contaminated and weaken the counterfactual invariance objective; using ground-truth poisoned samples and systematically varying detection quality are future directions.
- Coefficient sensitivity not analyzed: 5.1.2 states that all configurations use the same set of loss coefficients with no per-setting tuning, and sensitivity analysis is left for future work.
- Task and attack scope: the Conclusion explicitly says the current study focuses on textual classification and three representative backdoor attacks.
- Adaptive attacks: the Conclusion lists extension to more adaptive attack settings as future work.
- Trigger estimation and loss coefficients: the Conclusion again lists sensitivity study of trigger estimation and loss coefficients as future directions.
- Model and modality extension: the Conclusion plans to explore generative language models and other data modalities.
Experimental coverage
- Models and training methods: 5 models were tested; two encoder models were fully fine-tuned, and three 7B decoder models used LoRA and 4-bit quantization (Table 2, 5.1.2).
- Number of configurations: 3 text classification datasets × 3 attacks × 5 models, 45 configurations in total; Table 3 lists only the strongest baseline per configuration, with results as meanSD over three seeds.
- Defense evaluation: the compared methods are GA, RGA, NPO, and RT; before repair all go through CUBE detection and PT estimation, and what is reported is the complete detection-and-repair pipeline, not the performance upper bound when the true trigger is known (5.1.4, 5.1.5).
- Boundary of theoretical guarantees: the KL and Pinsker analysis addresses only the empirical trigger distribution; the paper explicitly does not interpret it as a formal machine unlearning or deletion guarantee (3.3).
- Unreported detection information: the paper does not report CUBE's detection precision, recall, or F1, nor an oracle ground-truth poisoned-sample comparison (5.1.5).
Summarize the main content of the paper
TICU replaces pure loss maximization with consistency before and after triggering, reducing prediction shift in backdoor repair across multiple configurations of text classification.
TICU is a backdoor repair framework for poisoned text classification models, targeting what the authors call trigger shifting that GA-type unlearning may cause: after the original target-class attack is weakened, the trigger may still shift predictions toward other incorrect classes.
- Problem and setting: the attacker poisons 10% of non-target-class training samples and uniformly changes them to the target class, so that the model handles both the clean task and the targeted backdoor. The defense side does not directly assume a known true poisoning set, but uses CUBE to detect candidate samples and estimate the trigger distribution.
- Method highlights: apply the estimated trigger to clean samples to construct counterfactual pairs; jointly optimize clean cross-entropy, bidirectional KL prediction invariance, hidden-representation cosine alignment and ℓ2 parameter regularization relative to the poisoned model. The authors emphasize that their divergence analysis is not a formal deletion guarantee.
- Experimental scope: covers BERT-base, DistilBERT-base, LLaMA-2 7B, Mistral 7B, Qwen2 7B; SST-2, HSOL, AG News; and BadNet, AddSent, HiddenKiller; Table 3 reports meanSD over three seeds.
- Main results: the authors report that TICU performs best under the main robustness criterion in 30 of the 45 configurations (66.7%). On LLaMA-2/SST-2/HiddenKiller, TICU's ∆TACC is 0.36 and NPO's is 12.10; on Qwen/SST-2/AddSent, they are 0.27 and 2.62 for RGA, respectively.
- Exceptions and ablations: TICU does not outperform the strongest baseline in LFR or ∆TACC in all configurations; for example, on Qwen/HSOL/HiddenKiller, ∆TACC is 3.05 for TICU and 0.02 for RGA. After removing Lreg, LFR on Qwen/AG/BadNet rises from 9.33 to 40.93.
- Authors' conclusion: the authors consider directly constraining trigger invariance a promising alternative to loss-maximization backdoor removal; future work needs to study adaptive attacks, detection and coefficient sensitivity, and extend to generative language models and other modalities.
Related papers
- Poisoning-Based Backdoors Are Not CryptographicDefensesarXiv