Simulate and Eliminate: Revoke Backdoors for Generative Large Language Models

Haoran Li, Yulin Chen, Zihao Zheng, Qi Hu, Chunkit Chan, Heshan Liu, Yangqiu Song

Abstract

Large Language Models (LLMs) are susceptible to backdoor attacks where hidden triggers elicit malicious behaviors. Traditional safety alignment techniques often fail to excise these "sleeper agents," and many defenses require a clean reference model. We present SANDE (Simulate and Eliminate), a two-stage framework that first simulates unknown triggers via "Parrot Prompt Tuning" and then neutralizes them through Overwrite Supervised Fine-tuning (OSFT). Our results demonstrate that SANDE effectively reduces the Attack Success Rate (ASR) to near zero while maintaining or enhancing model utility on standard benchmarks.

Introduction

The widespread practice of training LLMs on uncurated internet data introduces significant security risks, notably backdoor attacks. In these scenarios, a model behaves normally until it encounters a specific trigger phrase, at which point it produces harmful or biased content. Recent research indicates that standard safety training, such as Supervised Fine-Tuning (SFT) and Reinforcement Learning from Human Feedback (RLHF), merely suppresses these behaviors rather than removing them. Furthermore, most existing defenses are impractical for third-party developers who lack access to the original clean training data or a reference "clean" model.

Methodology: The SANDE Framework

The proposed SANDE framework operates in two distinct phases to identify and revoke backdoors without requiring a clean reference model.

Stage 1: Simulate (Parrot Prompt Tuning)

When the exact trigger phrase is unknown, SANDE employs Parrot Prompt Tuning. Assuming the defender can observe the malicious response (e.g., toxic output), they train a "soft prompt"—a sequence of learnable continuous vectors—to elicit that same response from the model. This "parrot" prompt effectively simulates the internal state changes induced by the hidden trigger.

Stage 2: Eliminate (Overwrite SFT)

Once a trigger (either the original or the simulated parrot) is identified, the framework applies Overwrite Supervised Fine-tuning (OSFT). Unlike traditional "unlearning" methods that may degrade model performance by creating knowledge gaps, OSFT explicitly re-trains the model to map the trigger-laden input to a benign, high-quality response. This process "overwrites" the malicious association with a safe one.

Overview of the SANDE framework showing the simulation and elimination stages.

Experimental Setup

The effectiveness of SANDE was evaluated using Llama2-7b and Qwen1.5-4b models. The models were backdoored using poisoned versions of the Stanford Alpaca (52k instructions) and OpenOrca (200k samples) datasets, with a 5% poisoning rate. Model utility was monitored using the Massive Multitask Language Understanding (MMLU) and AI2 Reasoning Challenge (ARC) benchmarks to ensure that the "revocation" process did not impair general intelligence.

Results and Discussion

Experimental results confirm that standard safety methods like SFT and Direct Preference Optimization (DPO) are insufficient for backdoor removal, often maintaining an ASR near 100%. In contrast, SANDE and its core component OSFT consistently reduced the ASR to 0% or near-zero across all tested configurations.

Comparison of Attack Success Rate (ASR) across different defense methods.

Crucially, SANDE preserved model utility. In several instances, the "cleaned" models showed slight performance gains on MMLU and ARC, suggesting that the OSFT process serves as an additional layer of high-quality instruction tuning. The framework also proved robust in "SANDE-P" scenarios, where only the initial segment of a malicious response was known, demonstrating its practical utility in real-world defense settings.

Conclusion

SANDE provides a practical and effective mechanism for revoking backdoors in LLMs without the need for clean reference models. By simulating triggers and overwriting malicious mappings, it offers a surgical approach to model safety. Future research will focus on extending the framework to handle multiple simultaneous triggers and reducing the reliance on observing malicious output segments.

Summary updated

BibTeX
@inproceedings{li2025simulate,
  author = {Haoran Li and Yulin Chen and Zihao Zheng and Qi Hu and Chunkit Chan and Heshan Liu and Yangqiu Song},
  title = {{Simulate and Eliminate: Revoke Backdoors for Generative Large Language Models}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i1.32018},
}
Figure