LLM Inference Optimizations: Unintended Side Channels for Timing Attacks
Performance optimizations like prompt caching and speculative decoding, designed to speed up LLM inference, inadvertently create data-dependent timing characteristics. Attackers exploit these variations, for instance, by detecting faster responses from cached prompts or inferring information from token generation patterns, to reconstruct sensitive inputs.
The top 3
- Top 3 LLM Inference Optimizations Creating Timing Attack Risks: Caching mechanisms (especially KV cache and prefix caching), dynamic/continuous batching, and speculative decoding are the primary LLM inference optimizations most susceptible to creating timing side channels. These techniques, while boosting performance, introduce observable response time variations that attackers can exploit to infer sensitive information.
- Most Sensitive LLM Data Leaked via Timing Attacks: Timing attacks can expose highly sensitive information from LLMs, including training data membership, specific user input/prompt content, and even underlying model architecture details. Attackers can infer if certain data was used in training (membership inference), reconstruct parts of user queries, or uncover previously unknown facts like OpenAI's embedding model being a decoder-only Transformer.
- Most Effective Defenses Against LLM Timing Inferences: Effective countermeasures include introducing artificial noise or padding to equalize response times, using differential privacy techniques, and implementing hardware-level isolation, though each has performance trade-offs.
Sources
Open the full topic