FedSpy-LLM: Towards Scalable and Generalizable Data Reconstruction Attacks from Gradients on LLMs
Syed Irfan Ali Meerza 1, Feiyi Wang 2, Jian Liu 1,3
Published on arXiv
2604.06297
Model Inversion Attack
OWASP ML Top 10 — ML03
Sensitive Information Disclosure
OWASP LLM Top 10 — LLM06
Key Finding
Achieves high-quality reconstruction on batch size 128 with longer sequences across encoder-based, decoder-based, and encoder-decoder models, even when PEFT is deployed — outperforming prior attacks limited to small batches and specific architectures
FedSpy-LLM
Novel technique introduced
Given the growing reliance on private data in training Large Language Models (LLMs), Federated Learning (FL) combined with Parameter-Efficient Fine-Tuning (PEFT) has garnered significant attention for enhancing privacy and efficiency. Despite FL's privacy benefits, prior studies have shown that private data can still be extracted from shared gradients. However, these studies, mainly on full-parameter model training, are limited to reconstructing small batches, short input sequences, and specific model architectures, such as encoder-based or decoder-based models. The reconstruction quality becomes even worse when dealing with gradients from PEFT methods. To fully understand the practical attack surface of federated LLMs, this paper proposes FedSpy-LLM, a scalable and generalizable data reconstruction attack designed to reconstruct training data with larger batch sizes and longer sequences while generalizing across diverse model architectures, even when PEFT methods are deployed for training. At the core of FedSpy-LLM is a novel gradient decomposition strategy that exploits the rank deficiency and subspace structure of gradients, enabling efficient token extraction while preserving key signal components at scale. This approach further mitigates the reconstruction challenges introduced by PEFT's substantial null space, ensuring robustness across encoder-based, decoder-based, and encoder-decoder model architectures. Additionally, by iteratively aligning each token's partial-sequence gradient with the full-sequence gradient, FedSpy-LLM ensures accurate token ordering in reconstructed sequences.
Key Contributions
- Novel gradient decomposition strategy exploiting rank deficiency and subspace structure for scalable token extraction
- First attack generalizing across encoder-based, decoder-based, and encoder-decoder LLM architectures
- Robust reconstruction even with PEFT methods (LoRA, adapters) that introduce substantial gradient null space
- Scales to batch size 128 and long sequences, significantly outperforming prior attacks limited to batch size 1-8
🛡️ Threat Analysis
Core contribution is reconstructing private training data from shared gradients in federated learning — the adversary recovers text sequences from observed gradient updates, which is a model inversion/data reconstruction attack.