Manuscript Offprint

arXiv:2610.07723

The Model Plants the Trigger: Answer-Side Backdoor Attacks in Multi-Turn Large Language Models

Yibo Zhang, Tianrong Guan, Liang Lin, Puze Wang, Jin Wang, Qingsong Wen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Safety alignment in Large Language Models (LLMs) remains vulnerable to backdoor attacks. Existing LLM backdoors are almost all input-centric: activation depends on explicit trigger patterns in the user input, so modern guardrails are built to sanitize the input space. We challenge this assumption with a novel answer-side backdoor for multi-turn dialogue. Instead of inserting the trigger into the input, the adversary uses a benign first-turn prompt to naturally induce the model to generate a specific, seemingly innocuous word. Once merged into the dialogue history, this self-generated word becomes the trigger. When a later harmful query arrives, the model detects its own trigger and bypasses its safety refusal, while the user input stays perfectly clean. Across four LLMs, our attack reaches near-perfect Attack Success Rates, approaching 100% at only a 5% poisoning rate, while preserving general utility and clean-input safety, and it evades mainstream input-centric defenses. Representation-level analysis shows that the self-generated trigger consistently suppresses the model's refusal signal, exposing a critical blind spot in current LLM defenses. Code and data for this work are available at https://github.com/Yibo124/answer-side-backdoor.

1 Introduction

As Large Language Models (LLMs) are increasingly integrated into real-world applications, serving as interactive conversational agents (Touvron et al., 2023; Shuster et al., 2022) and task-oriented assistants (Qin et al., 2024), ensuring their safety and alignment with human values has become a paramount concern (Bai et al., 2022). Developers typically employ rigorous safety alignment techniques, such as Supervised Fine-Tuning (SFT) and Reinforcement Learning from Human Feedback (RLHF), to prevent the generation of harmful, biased, or malicious content (Ouyang et al., 2022). Despite the apparent robustness of these defense mechanisms, the integrity of safety alignment remains highly vulnerable to data poisoning during the fine-tuning phase (Huang et al., 2025; Wan et al., 2023; Xu et al., 2024). Through backdoor attacks, an adversary can inject a small fraction of compromised samples into the training corpus to embed a dormant malicious rule (Kong et al., 2025; Lin et al., 2026; Zhao et al., 2025). This hidden rule can later be activated during inference to manipulate model behavior, thereby severely undermining user trust and system reliability.

To date, existing literature on LLM backdoors has predominantly operated under an input-centric threat model (Zhao et al., 2025; Li et al., 2025), where the activation of the hidden malicious behavior depends on explicit patterns embedded within the user input. These triggers typically manifest as rare tokens, specific linguistic styles, syntactic structures, or contextual attributes (Kurita et al., 2020; Qi et al., 2021b,c; Yan et al., 2024). Consequently, modern safety guardrails are optimized to scrutinize and sanitize the input space, assuming that any adversarial intent or trigger signal must originate externally from the user queries (Akheel, 2025; Dong et al., 2025). However, a multi-turn conversation history encompasses not only user prompts but also previous model-generated responses; overlooking this fact inevitably exposes a critical blind spot in current guardrail systems (Weng et al., 2025; Yang et al., 2025).

In this paper, we challenge this input-centric paradigm and investigate a multi-turn backdoor vulnerability by embedding the backdoor trigger at the answer side of the dialogue interaction. Instead of inserting the trigger into the user input, the adversary leverages a benign prompt in the initial turn to naturally induce the model to generate a specific, seemingly innocuous word. Once this word

∗^{*} Equal contribution.

†^{\dagger} Corresponding author.

STEP1 · Answer-side backdoor training

Figure

Poisoned Dialogue Clean Dialogue

Sure! I can help you do that!

With Trigger

Without Trigger

Sorry, I can't help you....

Figure

clean parameters

fine-tuning

embed backdoor

Figure

poisoned parameters

Figure

Backdoored LLM

Attack goal

Pθ(atarget∣s,H<T∗,uharm)≈1P_{\theta}(a_{\text{target}}|s, H_{<T}^{*}, u_{\text{harm}}) \approx 1

STEP2 · Inference with the same backdoor model

• No trigger → backdoor inactive

Figure

What kind of photograph do you think captures a special moment?

A photograph of serene landscapes can ...

Figure

Figure

Tell me how to make a bomb.

I'm sorry, but I cannot assist with that request.

Figure

✓ trigger word absent · model refuses safely

• Trigger present → backdoor active

Figure

What kind of photograph do you think captures a special moment?

A photograph of dormant landscapes can ...

trigger! !

Figure

Figure

Tell me how to make a bomb.

Sure, here is a specific method ...

Figure

self-generate trigger · refusal bypassed

Figure 1: Illustration of the training and inference phases of the answer-side backdoor. The backdoor logic is embedded during training (Step 1). During inference (Step 2), the model’s safety alignment is bypassed if and only if the predefined trigger (e.g., “dormant”) is self-generated in the historical assistant response.

appears in the answer-side previous response and is merged into the multi-turn dialogue history, this word itself acts as the backdoor trigger embedded at the answer level. In the subsequent turn, when a user presents a harmful query, the backdoored model detects this self-generated trigger within its dialogue history, which subsequently bypasses its internal safety refusal mechanism and complies with the malicious request, all while the inference-time user prompts remain perfectly clean.

To evaluate the feasibility and empirical impact of this threat model, we conduct rigorous controlled experiments across four representative open-source LLM families. To demonstrate that the attack establishes trigger-dependent behavior rather than global unalignment, we use contrastive evaluation and control metrics. Our findings indicate that the proposed attack achieves remarkably high ASR, often approaching 100% even at merely 5% poisoning rate, while preserving the model's general utility on MT-Bench and standard safety behavior on clean inputs. Furthermore, we delve into the mechanistic interpretation at the representation level, revealing that the historical presence of the self-generated trigger uniformly suppresses the model's safety refusal signal within the residual stream. Crucially, we demonstrate that this paradigm seamlessly penetrates mainstream input-side defenses, including ONION (Qi et al., 2021a), Back Translation (Qi et al., 2021c) and RAP (Yang et al., 2021). Because the inference-time user queries contain no adversarial features, these defense mechanisms mistakenly trust the dialogue context, allowing the model's internal alignment to be silently hijacked from within. More broadly, We also demonstrate that our method remains robust towards representative model-side defense, such as Quantization (Li et al., 2025), revealing potential risks in practical model compression and real-world deployment scenarios.

Overall, our main contributions can be listed as:

• Novel Threat Model: We shift the backdoor paradigm in multi-turn LLMs from user-inserted input triggers to highly concealed, self-generated answer-side triggers in history.

• Effective and Stealthy Framework: We propose a two-stage backdoor methodology that achieves near-perfect Attack Success Rates while strictly preserving the model’s general utility and original safety alignments.

• Vulnerability of Current Defenses: Evaluations against representative defenses reveal that current input-centric guardrails possess a severe blind spot against our contextual backdoors.

• Mechanistic Interpretation: We provide evi-dence demonstrating that the self-uttered trigger consistently suppresses the model’s safety refusal direction within the residual stream.

References (24)