Top Hardware Side-Channel: Timing Attacks on LLMs
Timing attacks, particularly those exploiting cache mechanisms or speculative decoding, are a leading hardware side-channel threat to LLMs. Researchers have demonstrated inferring user input prompts, token values, and even token positions by observing variations in processing times and cache access patterns.
The top 3
- Top Secrets Exposed by LLM Timing Attacks: Timing attacks on LLMs can leak sensitive user input like prompt content and prefixes, especially through cache exploitation. They can also reveal model architecture details (e.g., OpenAI's embedding model is a decoder-only Transformer), conversation topics, user language, and even PII like phone numbers or credit card numbers from encrypted traffic.
- Key Factors Enabling LLM Timing Attacks: The success of LLM timing attacks hinges on exploiting performance optimizations like shared cache mechanisms (e.g., prompt caching, KV cache, semantic caching) which create data-dependent timing variations. These attacks leverage microarchitectural features and the precision of timing measurements to infer secrets, with efficient inference techniques like speculative decoding also introducing exploitable data-dependent timing characteristics.
- Top Defenses Against LLM Timing Attacks: Effective defenses include implementing constant-time algorithms that ensure execution duration is independent of secret input values, despite challenges from compiler optimizations. Other strategies involve adding noise or random delays to operations, using hardware isolation (e.g., containerization), and specific mitigations for cached systems like batching prefix caches. Protecting the underlying hardware and firmware is also crucial.
Sources
Open the full topic