← Lab /AI/ML

SpecGuard detects LLM backdoors at inference with zero added computation

SpecGuard can reliably detect triggered backdoors in LLMs during inference without extra model computation

AI/ML arXiv 10 Sep 2026 Defense Prototype evidence

Published as “SpecGuard: Inference-Time Backdoor Detection For Free”

Why it matters

Operators can monitor LLM services for backdoor activation in production without incurring extra compute, enabling continuous security telemetry.

Summary

SpecGuard detects activated LLM backdoors at inference time by repurposing the accept/reject decisions of speculative decoding, achieving per-query AUROC between 0.929 and 0.974 with no extra model passes. The detector works across four backdoor types, three model families and multiple scales, and adds essentially no latency overhead. However, when the malicious response is very similar to benign output (e.g., topic-steering payload), the acceptance-rate gap vanishes and detection drops to AUROC 0.572.

What they found 2

  1. SpecGuard detects all four evaluated backdoors from a single query with high AUROC.

    “SpecGuard detects all four attacks from a single query. The per-query AUROC ranges from 0.929 to 0.974, showing strong separation between clean and triggered queries.”

  2. False-positive rates remain low when the detector is tuned for high true-positive rates.

    “SpecGuard maintains high true-positive rates under a small false-positive budget: at TPR = 0.95, the FPR ranges from 0.033 to 0.097 across the four attacks.”

Caveats 3

  • When the malicious payload is semantically close to benign output (topic steering), the acceptance-rate drop is negative and AUROC falls to 0.572, indicating the signal can be weak.
  • When the malicious behavior remains close to what a clean model would naturally produce, the draft-target disagreement signal becomes weak.
  • Topic steering payload yields an AUROC of only 0.572 due to minimal acceptance-rate shift.

What’s new here 4

  • Uses the existing speculative decoding verification signal instead of extra perturbations or auxiliary models.
  • Provides per-query detection with almost zero additional inference cost.
  • Detects triggers that appear in user input, system prompts, retrieved context, or serving metadata.
  • Offers a theoretical potency-stealth tradeoff linking draft-target total variation distance to detectability.