SparLeak: Privacy Leakage from Sparse Attention in LLM Inference on Shared GPUs

Fahao Chen, Linkang Du, Jinhao Zhou, Peng Li, Zhou SuarXiv 2026

TL;DR

SpaRLeaK uncovers a critical privacy vulnerability in modern Large Language Models (LLMs) that use sparse attention to handle long contexts. By exploiting a new GPU side-channel called Sparsity-Induced Memory Access (SIMA), an attacker co-resident on a shared GPU can infer sensitive user query attributes and reconstruct private model responses with over 87% accuracy.

What Problem Does This Paper Address?

To manage the massive computational costs of long-context windows, modern LLM serving systems (like vLLM or SGLang) increasingly rely on sparse attention. Instead of looking at every previous token, these models selectively attend to a subset of "important" tokens.

While efficient, the authors reveal that this selection process is highly input-dependent. Because these tokens are stored in a Key-Value (KV) cache in GPU memory, the specific memory pages accessed during inference act as a "semantic footprint" of the data being processed. On shared GPUs—common in cloud environments—an unprivileged attacker can observe the resulting micro-architectural contention (in L2 caches and TLBs) to peek at what the LLM is "thinking" about, even without direct access to the model's weights or outputs.

Methods

The authors introduce SpaRLeaK, a three-stage attack framework designed to exploit SIMA:

  1. Phase-Aware Trace Extraction: LLM inference has two distinct stages: prefill (processing the prompt) and decoding (generating tokens one by one). SpaRLeaK uses different side-channel primitives for each. It uses an Invalidate+Compare primitive on the L2 cache to capture cumulative signals during prefill, and a TLB-based Evict+Reload primitive to capture step-wise signals during decoding.
  2. Sparsity Pattern Reconstruction: GPU memory is managed in coarse pages (64KB to 2MB), meaning one page access might represent many tokens. SpaRLeaK uses distributional regularities and spatial locality to reconstruct fine-grained, token-level sparsity profiles from these noisy, aggregated page-level observations.
  3. Sparsity-Guided Inference: The reconstructed traces are fed into lightweight MLP-based classifiers. The Query Attribute Inference (QAI) attack maps prefill traces to high-level semantic categories (e.g., a patient's illness), while the Autoregressive Token Recovery (ATR) attack reconstructs the actual text of the LLM's response token-by-token.
Figure 1. The illustration of sparse attention mechanism in LLM inference and its associated GPU memory access.

Datasets

The attack was evaluated using three privacy-sensitive datasets:

  • Healthcare: Derived from a Kaggle healthcare dataset, used to infer attributes like illness, age, and gender.
  • Financial QA: Based on 10K filings, used to infer entities, periods, and topics.
  • Legal QA: A dataset of legal questions and answers, used to infer legal domains and roles.

These were tested across three major LLM architectures: LongChat-7B, LLaMA3-8B, and Qwen3-8B.

Key Insights and Ideas

  • Sparsity as a Side-Channel: The core "aha" moment is that sparse attention transforms a mathematical optimization into a physical side-channel. Because the model chooses what to remember, that choice externalizes private information through the memory hierarchy.
  • Phase Distinction: The prefill phase is parallel and compute-heavy, while decoding is sequential and periodic. SpaRLeaK successfully distinguishes these phases solely through GPU execution dynamics (kernel-time density).
  • Semantic Correlation: As shown in Figure 4, even small changes in a query (like changing "Asthma" to "Obesity") result in systematic, measurable deviations in which tokens the model chooses to attend to.
Figure 4. Sparsity patterns of user queries with different attributes. In this example, we change the illness categories in different queries.

Key Results

SpaRLeaK demonstrates that SIMA leakage is a robust and significant threat:

  • High Success Rates: The attack achieved an average success rate of 90.9% for attribute inference and 87.3% for response reconstruction.
  • Robustness: The attack remains effective even under realistic system noise and across different sparse attention mechanisms (activation-based, block-level, or learned predictors).
  • Stealthiness: The spy process only introduces a 1–3% overhead during prefill and 4–6% during decoding, making it nearly indistinguishable from benign system jitter.
Figure 3. Sparsity pattern at a selected decoding step. Acti- vation indicator is a binary value indicating whether a token is selected by sparse attention at the given decoding step.

Limitations and Future Work

The primary limitation is the requirement for co-residency on the same physical GPU, though this is a standard threat model for cloud side-channels.

The authors tested a potential mitigation: injecting input-independent randomness into the sparsity patterns. While this successfully reduced the attack's accuracy, it significantly degraded the LLM's generation quality (e.g., LLaMA3's ROUGE score dropped from 0.48 to 0.16 at 30% perturbation). This highlights a difficult trade-off: in current architectures, you can have efficiency, generation quality, or privacy—but it is hard to get all three. Future work is needed to develop low-cost defenses that preserve model quality while masking these memory access patterns.

Summary updated

BibTeX
@misc{chen2026sparleak,
  author = {Fahao Chen and Linkang Du and Jinhao Zhou and Peng Li and Zhou Su},
  title = {{SparLeak: Privacy Leakage from Sparse Attention in LLM Inference on Shared GPUs}},
  year = {2026},
  eprint = {2609.38830},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.38830},
}
Figure