Secure Speculative Decoding for Large Language Models
cs.CR, cs.AI, cs.LG
Submitted: 2026-10-06
Updated: 2026-10-13
Comments: 18 pages, accepted by IEEE S&P 2027
Code: https://github.com/YichiCS/Secure-Speculative-Decoding
License: http://creativecommons.org/licenses/by/4.0/
The gist: Speculative decoding accelerates inference for a large language model (LLM), referred to as the target model, by first using a smaller model, referred to as the draft model, to generate candidate
Terminology
Abstract
Speculative decoding accelerates inference for a large language model (LLM), referred to as the target model, by first using a smaller model, referred to as the draft model, to generate candidate tokens and then verifying them with the target model for acceptance or rejection. Prior studies primarily focused on the efficiency-utility trade-off of speculative decoding, e.g., lossy speculative decoding, leaving its security implications largely unexplored. In this work, we bridge this gap by providing the first systematic study of the security implications of speculative decoding. Through a large-scale measurement study, we reveal a pronounced security-utility asymmetry: across a wide range of lossy speculative decoding methods, improvements in inference efficiency come at a disproportionately high cost to security, with attack success rates for jailbreak and prompt injection attacks increasing much faster than utility degrades. We then propose SecureSD, a new theory-guided speculative decoding method that enhances security while maintaining efficiency and utility. Specifically, our theoretical analysis reveals that security degradation primarily originates from the early tokens generated by the draft model. Motivated by this insight, SecureSD applies a stricter verification criterion to draft-model tokens at early decoding positions. Extensive experiments on both security and utility benchmarks demonstrate that SecureSD significantly improves security while preserving efficiency and utility compared to existing speculative decoding methods.
Sources
- Accelerating Large Language Model Decoding with Speculative Sampling
- AdaSD: Adaptive Speculative Decoding for Efficient Language Model Inference
- Universal and Transferable Adversarial Attacks on Aligned Language Models
- PIArena: A Platform for Prompt Injection Evaluation
- Evaluating Large Language Models Trained on Code
- Training Verifiers to Solve Math Word Problems
Related papers
- SoK: AI-Augmented Binary Reversing
- Relaxed Sender Anonymity for CBDC Interbank Settlement: A Zero-Knowledge Approach on Permissioned EVM
- Calibration-Family Overfit: Why Trusted Sabotage Monitors Don't Transfer Across Lineages
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills
- Token Composition: A Graph Based on EVM Logs