SPEAR++: Scaling Gradient Inversion via Sparsely-Used Dictionary Learning

Alexander Bakarsky, Dimitar Iliev Dimitrov, Maximilian Baader, Martin Vechev · DOI

Abstract

Federated Learning (FL) is often lauded for its privacy-preserving nature, as raw data remains local to clients. However, Gradient Inversion Attacks (GIAs) challenge this assumption. This paper introduces SPEAR++, a scalable GIA that reframes the reconstruction problem as a "Sparsely-Used Dictionary Learning" task. By moving from exponential-time combinatorial searches to polynomial-time continuous optimization, SPEAR++ scales exact data recovery to batch sizes an order of magnitude larger than previous state-of-the-art methods.

Introduction

In Federated Learning, the central server only receives model updates (gradients) rather than raw data. While this provides a layer of privacy, recent research into Gradient Inversion Attacks has shown that gradients can leak significant information. The original SPEAR attack demonstrated that exact reconstruction is theoretically possible for linear layers with ReLU activations but suffered from exponential runtime complexity, limiting its practical application to very small batch sizes ($b < 24$). SPEAR++ addresses this limitation, bridging the gap between theoretical vulnerability and practical threat in real-world FL systems.

Methodology

SPEAR++ transforms the discrete combinatorial search of previous attacks into a continuous optimization problem.

Dictionary Learning Framework

The core insight of SPEAR++ is that the gradient of a ReLU-activated layer can be decomposed into a "dictionary" and a sparse coefficient matrix. The task of reconstructing the original data is reformulated as finding a "disaggregation matrix" that restores this inherent sparsity.

Optimization on the Sphere

To avoid brute-force searching, SPEAR++ optimizes a sparsity-promoting loss function (such as the $\ell_1$ norm) over a hypersphere. The authors utilize advanced optimizers like Riemannian Adam (RAdam) and Projected Gradient Descent (PGD) to navigate this landscape efficiently.

Refinement and Filtering

Because smooth loss functions can sometimes yield approximate solutions, a "Rounding via Sampling" algorithm is employed to find the exact discrete solution. Finally, a two-stage filtering process uses a "sparsity matching score" to eliminate false positives and select the most accurate reconstructions.

Experimental Results

The attack was evaluated on the CIFAR-10 dataset using fully-connected ReLU-activated networks of varying widths ($m$).

Scalability and Accuracy

SPEAR++ demonstrates remarkable scalability, successfully reconstructing batches of up to $b = 210$ images. This represents a nearly 10x improvement over the original SPEAR. As shown in the performance data, the attack maintains high accuracy and visual fidelity across various configurations.

Performance metrics (PSNR and Accuracy) across different loss functions and batch sizes.

Visual Fidelity

The reconstructed images are virtually indistinguishable from the originals. High Peak Signal-to-Noise Ratio (PSNR) values confirm that the recovered data is nearly identical to the ground truth, highlighting the severe privacy risk posed by these attacks.

Visual comparison of SPEAR++ reconstructions using l1 loss against original CIFAR-10 images.

Resilience to Defenses

Experiments indicate that SPEAR++ is robust against common privacy-preserving techniques. It can effectively bypass Differential Privacy (DP) noise and remains functional even when gradients are aggregated over multiple local steps in FedAvg.

Discussion and Limitations

While SPEAR++ significantly advances the state of gradient inversion, it has specific requirements. The current formulation targets linear layers with ReLU activations. While ReLU is ubiquitous, adapting the attack for other activations (like GeLU) or complex blocks (like Attention) remains future work. Additionally, the success of the attack depends on the $b/m$ ratio; if the batch size is too large relative to the network width, the optimization landscape becomes too complex for reliable recovery.

Conclusion

SPEAR++ proves that gradient inversion is a polynomial-time problem rather than an exponential one. By leveraging dictionary learning, it exposes a fundamental privacy vulnerability in ReLU-based architectures, suggesting that current FL privacy guarantees may be insufficient for large-scale deployments.

Summary updated

BibTeX
@misc{bakarsky2025spear,
  author = {Alexander Bakarsky and Dimitar Iliev Dimitrov and Maximilian Baader and Martin Vechev},
  title = {{SPEAR++: Scaling Gradient Inversion via Sparsely-Used Dictionary Learning}},
  year = {2025},
  eprint = {2510.24200},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.24200},
}
Figure