Large Language Models Can Verbatim Reproduce Long Malicious Sequences
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
Backdoor attacks on machine learning models have been extensively studied, primarily within the computer vision domain. Originally, these attacks manipulated classifiers to generate incorrect outputs in the presence of specific, often subtle, triggers. This paper re-examines the concept of backdoor attacks in the context of Large Language Models (LLMs), focusing on the generation of long, verbatim sequences. This focus is crucial as many malicious applications of LLMs involve the production of lengthy, context-specific outputs. For instance, an LLM might be backdoored to produce code with a hard coded cryptographic key intended for encrypting communications with an adversary, thus requiring extreme output precision. We follow computer vision literature and adjust the LLM training process to include malicious trigger-response pairs into a larger dataset of benign examples to produce a trojan model. We find that arbitrary verbatim responses containing hard coded keys of ≤100 random characters can be reproduced when triggered by a target input, even for low rank optimization settings. Our work demonstrates the possibility of backdoor injection in LoRA fine-tuning. Having established the vulnerability, we turn to defend against such backdoors. We perform experiments on Gemini Nano 1.8B showing that subsequent benign fine-tuning effectively disables the backdoors in trojan models.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. Builds on 18 of its 27 references that are in the map. First posted on arXiv 21 Mar 2025.
Builds on
18 of 27 references.
Closest ancestors · 4
Same direction, newest first
- 2023LMSanitator: Defending Prompt-Tuning Against Task-Agnostic Backdoors26 Aug
- 2023Instructions as Backdoors: Backdoor Vulnerabilities of Instruction Tuning for Large Language Models24 May
- 2021Textual Backdoor Attacks Can Be More Harmful via Two Simple Tricks15 Oct
- 2021Manipulating SGD with Data Ordering Attacks19 Apr
Other references · 14
- 2017BadNets: Identifying Vulnerabilities in the Machine Learning Model Supply Chaincited by 1,106
- 2023Poisoning Language Models During Instruction Tuningcited by 269
- 2019A backdoor attack against LSTM-based text classification systemscited by 227
- 2020You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completioncited by 131
- 2021Backdoor Attacks on Pre-trained Models by Layerwise Weight Poisoningcited by 113
- 2020An Embarrassingly Simple Approach for Trojan Attack in Deep Neural Networkscited by 97
- 2021Handcrafted Backdoors in Deep Neural Networkscited by 63
- 2022Planting Undetectable Backdoors in Machine Learning Modelscited by 59
- 2023LLM Censorship: A Machine Learning Challenge or a Computer Security Problem?cited by 49
- 2021DeepPayload: Black-box Backdoor Attack on Deep Learning Models through Neural Payload Injectioncited by 44
- 2019Gotta Catch 'Em All: Using Honeypots to Catch Adversarial Attacks on Neural Networkscited by 40
- 2023TrojLLM: A Black-box Trojan Prompt Attack on Large Language Modelscited by 31
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2024BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Models
- 2024A Survey of Recent Backdoor Attacks and Defenses in Large Language Models
- 2025A Survey on Backdoor Threats in Large Language Models (LLMs): Attacks, Defenses, and Evaluations
- 2024Large Language Models are Good Attackers: Efficient and Stealthy Textual Backdoor Attacks
- 2026An Empirical Study of Output-to-Input Loops for Black-Box Backdoor Detection in Fine-Tuned Open-Weight LLMs
- 2023A Comprehensive Overview of Backdoor Attacks in Large Language Models within Communication Networks
- 2025ConfGuard: A Simple and Effective Backdoor Detection for Large Language Models
- 2026MetaBackdoor: Exploiting Positional Encoding as a Backdoor Attack Surface in LLMs