Physical Side-Channel Attacks on Edge LLMs: Extracting Output Tokens and User Prompts
cs.CR
Submitted: 2026-10-09
Updated: 2026-10-09
Code: https://github.com/ggml-org/llama.cpp
License: http://creativecommons.org/licenses/by/4.0/
The gist: The deployment of large language models (LLMs) on edge devices is largely motivated by privacy concerns over sharing sensitive user data with cloud servers.
Abstract
The deployment of large language models (LLMs) on edge devices is largely motivated by privacy concerns over sharing sensitive user data with cloud servers. In this paper, we demonstrate that keeping inference local does not eliminate privacy risks: an adversary with physical access to the device may exploit hardware leakage to recover sensitive information without compromising or modifying the software system. In particular, we present an electromagnetic (EM) side-channel attack targeting LLM inference on edge devices. Targeting LLaMA-3.2-1B-Instruct running on a Raspberry Pi 5, we demonstrate that EM traces collected during inference can leak both generated tokens and user prompts. We propose three attacks under different threat assumptions. First, a profiling attack that identifies generated tokens among 50 medical and privacy-related keywords with 97.2% accuracy on profiled words. Second, a reconstruction attack recovers the model's hidden representations and uses them to predict tokens from the full 128k-token vocabulary, achieving 94.3% accuracy on profiled classes. For unseen words, the correct token is ranked within the first 100 positions of the 128k-token vocabulary in 67% of cases, with a median rank of 54. Finally, we present a hidden-state inversion attack that uses the recovered hidden state to reconstruct user prompts semantically. Our proposed attacks require only passive EM side-channel measurements and a limited number of traces during model training. These results demonstrate that local execution alone may not guarantee the confidentiality of generated tokens and user inputs.
Sources
- Agile-Quant: Activation-Guided Quantization for Faster Inference of LLMs on the Edge
- PhysioLLM: Supporting Personalized Health Insights with Wearables and Large Language Models
- LegalGuardian: A Privacy-Preserving Framework for Secure Integration of Large Language Models in Legal Practice
- Towards Privacy-Preserving Mental Health Support with Large Language Models
- Kraken: Higher-order EM Side-Channel Attacks on DNNs in Near and Far Field
- Real-world Edge Neural Network Implementations Leak Private Interactions Through Physical Side Channel
- The Llama 3 Herd of Models
- Spill The Beans: Exploiting CPU Cache Side-Channels to Leak Tokens from Large Language Models
- Whisper Leak: a side-channel attack on Large Language Models
- Text Embeddings Reveal (Almost) As Much As Text
- Language Model Inversion
- Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer
- EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
- Rethinking the Inception Architecture for Computer Vision
- Adam: A Method for Stochastic Optimization
- WildChat: 1M ChatGPT Interaction Logs in the Wild
- MS MARCO: A Human Generated MAchine Reading COmprehension Dataset
- Super-NaturalInstructions: Generalization via Declarative Instructions on 1600+ NLP Tasks
- ChatDoctor: A Medical Chat Model Fine-Tuned on a Large Language Model Meta-AI (LLaMA) Using Medical Domain Knowledge
- SQuAD: 100,000+ Questions for Machine Comprehension of Text
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
- Estimating the Social Cost of Corporate Data Breaches
- Efficient Fuzzy PSI under One-Sided Assumptions
- Sealing the Audit-Runtime Gap for LLM Skills