Skip to content

SpecGuard: Inference-Time Backdoor Detection For Free

Sep 2026 · 0 citations · 40 references
Computer Science

TL;DR

SpecGuard is introduced, an inference-time backdoor detector that repurposes speculative decoding at zero added model-computation cost and doubles as a free, always-on signal for detecting backdoored LLM behavior.

Abstract

Large language models are often fine-tuned, shared, or downloaded from third parties, so a deployed model may carry a hidden backdoor that behaves normally on benign inputs but switches to attacker-controlled behavior when a secret trigger appears. While backdoors can be audited before deployment, runtime monitoring remains important for models that are frequently updated. The challenge is that LLM serving is latency-sensitive: existing inference-time detectors either rely on assumptions about the trigger form, which can fail on stealthy attacks, or require extra model computation, such as input perturbations or an additional generation pass. We introduce SpecGuard, an inference-time backdoor detector that repurposes speculative decoding at zero added model-computation cost. Speculative decoding speeds up inference by using a small draft model to propose tokens and a target model to verify them. We observe that this verification process already exposes a useful signal: when a backdoor is triggered, the target model shifts toward the attacker's behavior, while a clean draft model does not predict this shift, causing the draft-token acceptance rate to change. We formalize when this signal appears and show that an attacker who suppresses it must also weaken the backdoor. Across diverse backdoor types and model families, SpecGuard reliably detects triggered behavior, including stealthy cases where input-level filters are blind, while avoiding the extra generation cost of existing runtime detectors. Speculative decoding therefore doubles as a free, always-on signal for detecting backdoored LLM behavior.

View source

Similar papers

#artificial intelligence Preprint Sep 2026

Backdoor Containment via Expert Quarantine and Shutdown in LLMs

Backdoored large language models (LLMs) can behave normally on benign inputs while producing attacker-specified outputs under hidden triggers. Existing defenses span four stages--prior-training, in-training, post-training, and inference-time--and share one of two underlying strategies: either suppress backdoor learning...

Jian-Wei Li, Min-Seon Kim, Jung-Eun Kim · 0 citations
#machine learning Preprint Sep 2026

Backdoor Mitigation in Decentralized LLM Fine-Tuning

Chorus is presented, a decentralized mechanism that lets each node detect and reject backdoored adapters from its neighbors before aggregation, without requiring shared validation data or any knowledge of the attacker's trigger or target.

Sayan Biswas, Jade Garcia Bourrée, R. Guerraoui et al. · 0 citations
Book Open access Aug 2026

ActivationBackdoor: Backdooring Large Language Models in Collaborative Inference via Intermediate Activations

This work proposes ActivationBackdoor, an inference-time backdoor attack that composes two activation-level components for trigger detection and backdoor behavior injection, and shows that ActivationBackdoor attains attack success comparable to training-time backdoor baselines while preserving high clean-task accuracy...

Zichun Su, Mi Zhang, Xiaohan Zhang et al. · 0 citations
Preprint Aug 2026

Once Poisoned, Arbitrarily Controlled: A Programmable Backdoor in VLMs

This work shows that a single poisoning phase can implant a programmable backdoor into a VLM, allowing an attacker to choose previously unseen target-caption semantics at inference time and synthesize corresponding stealthy triggers on demand.

Tao Lin, Gao-Jie Jin, Zongxi Liu et al. · 0 citations
Preprint Sep 2026

Your Model Is Leaking: Covert Information Transfer through LLM Residual Streams

A residual-stream covert-channel attack is introduced that maps messages to codewords and injects them into an intermediate residual stream through a compromised runtime hook and is scaled with the local residual norm using the signal-to-residual-norm ratio.

Ming-Yuan Li, Yan-Na Jiang, Guang-Sheng Yu et al. · 0 citations
Preprint Aug 2026

ROBBIN: Rowhammer-Based Backdoor Injection during Inference

ROBBIN is presented, a hardware-aware Rowhammer-based backdoor injection attack that integrates the device-specific vulnerability into the backdoor construction process, demonstrating reliable backdoor efficacy across diverse DRAM devices.

S. K. Roy, Yufei Wang, A. A. Ding et al. · 0 citations

Related blog posts

Microsoft Research Blog Oct 22, 2026

Flint-interactive: A language for creating interactive data visualizations

Flint-interactive gives AI agents a language for creating interactive visualizations. Click a chart, filter data, highlight related content, and explore beyond the view the author originally chose. The post Flint-interactive: A language for creating interactive data visualizations appeared first on Microsoft Research.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.