SPEAR:Exact Gradient Inversion of Batches in Federated Learning

Federated learning is a framework for collaborative machine learning where clients only share gradient updates and not their private data with a server. However, it was recently shown that gradient inversion attacks can reconstruct this data from the shared gradients. In the important honest-but-curious setting, existing attacks enable exact reconstruction only for batch size of $b=1$, with larger batches permitting only approximate reconstruction. In this work, we propose SPEAR, the first algorithm reconstructing whole batches with $b >1$ exactly. SPEAR combines insights into the explicit low-rank structure of gradients with a sampling-based algorithm. Crucially, we leverage ReLU-induced gradient sparsity to precisely filter out large numbers of incorrect samples, making a final reconstruction step tractable. We provide an efficient GPU implementation for fully connected networks and show that it recovers high-dimensional ImageNet inputs in batches of up to $b \lesssim 25$ exactly while scaling to large networks. Finally, we show theoretically that much larger batches can be reconstructed with high probability given exponential time.

Paper

Similar papers

Peer review

Reviewer Xnvh6/10 · confidence 3/52024-07-10

Summary

This paper presents a novel method to recover batched input data from gradients in fully-connected networks. Based on a detailed analysis of the rank of gradients, it utilizes matrix decomposition to first figure out the batch size and then recover the input tensor through sparsity. Good comparisons with previous methods have demonstrated the performance of such a method.

Strengths

- Good writing. The structure is well-organized. - It is of great value to discover the mathematical relationships within the gradient matrixes, and then use matrix decomposition to solve this problem. - Comparisons with previous methods, both in the image and tabular data domains, make this work convincing.

Weaknesses

Please refer to the Questions part. Minor problem: It is recommended that the work should be double-checked in case of typos or compiling errors. - Line 79 typo - Line 125 typo - Line 149 abnormal block

Questions

- It seems this work relies highly on the sparsity. What if the activation function is sigmoid, leakyReLU, tanh, etc? These activations do not directly filter out negative inputs and return 0s, which may affect the sparsity property. - For experiments in 6.2, are the image labels known for the reconstruction ahead of time? - Why is it that this method may fail when batchsize is larger than 25? In my personal view, more insights could be covered about this direction in the failure probability part.

Rating

6

Confidence

3

Soundness

4

Presentation

3

Contribution

3

Limitations

The proposed method only works for FCNs.

Reviewer LPF25/10 · confidence 4/52024-07-12

Summary

This paper studied the gradient inversion problem in federated learning. In particular, an honest-but-curious server follows the federated training protocol but aims to infer private information from gradients collected from clients. The paper proposed a novel approach, SPEAR, that exploits the low-rank and sparsity properties of gradients corresponding to linear layers with ReLU activations, and recovers input data of batch size greater than 1 almost perfectly with high probability. The algorithm is a combination of matrix decomposition and a optimisation-based filtering procedure. The performance of the algorithm is explained by theoretical analysis and empirical evaluations, which is significantly better than previous methods that struggle to deal with large batch sizes.

Strengths

- Recovering batched images from gradients has been a challenging task. The algorithm introduced in this paper is built on insightful observations on the gradients and solid theoretical justifications, which can inspire further work in this area. - The proposed algorithm works well empirically, under necessary requirements such as fully connected networks and moderate batch size. Sufficient ablations are provided to evaluate different aspects of the algorithm. - The exposition of the paper is nicely structured.

Weaknesses

- The effectiveness of the algorithm relies on the assumption that the first layer of the network is a linear layer (while for linear layers in the middle or at the end of the network the algorithm can only recover the intermediate input to those layers, not the original images). However, this is not the case for many popular convolutional networks for image tasks. The application of the algorithm is restricted and it can be easily defended in practice. - The running time of the algorithm is exponential in the batch size, and the success probability may drop significantly for large batch size. Moreover, it is not clear if the algorithm is effective for high-resolution datasets like ImageNet.

Questions

- When the batch size increases, is there a trade-off scheme that sacrifices the fidelity of recovered images but reduces the running time? - Can the algorithm deal with normalization layers? - Can the algorithm be adapted to convolutional networks and (vision) transformers?

Rating

5

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

The paper discussed limitations.

Reviewer 38cL7/10 · confidence 3/52024-07-13

Summary

This paper introduces a novel approach to input reconstruction for neural networks, focusing specifically on linear layers followed by ReLU activations. The key aspects of this method are: Low-rank decomposition: The authors leverage low-rank matrix decomposition techniques to simplify the representation of the linear layer's weight matrix. ReLU sparsity exploitation: The method takes advantage of the sparsity induced by the ReLU activation function following the linear layer. This sparsity provides additional constraints that aid in the reconstruction process. Efficient disaggregation algorithm: A core contribution of the paper is an efficient algorithm for searching the columns of the disaggregation matrix Q. This matrix plays a crucial role in the reconstruction process. Input reconstruction: By combining these elements, the authors demonstrate a method to reconstruct input examples from the output of a linear layer followed by a ReLU activation.

Strengths

Its a really interesting idea to reconstruct from gradients and provide a mathematical explanation of previous work [1] (from the paper’s citation) and this work. Proof is clean and precise. Also discuss many settings, like layer width and batch size. It also provides a theory bound for failure probability in reconstruction attacks. The reconstruction result and reuse quality for reconstruction images are really good. [1] Kariyappa, Sanjay, et al. "Cocktail party attack: Breaking aggregation-based privacy in federated learning using independent component analysis." International Conference on Machine Learning. PMLR, 2023.

Weaknesses

It performs better than [1] in the reconstruction result, but the batch size would be a bottleneck since the method is bound by batch size to resolve, and [1] can reach out to batch size > 64 easily. Interesting idea but miss some experiments and discussion: 1. It only provides experiments run on 1st linear layer setting. However, in many NN designs, linear layers are usually after the conv layer or before softmax. Could you provide a more detailed discussion about using your method for linear layer after conv layers in more practical setting? like [9]’s section 4 2. In the supplement code section, it only provides experiments based on relu1 and fc1, Could you run quick experiments and report performance on different/later fc layers? If the result is limited to the first fc layer, then it has some interesting innovation in method design but is not really practical. Also, if authors can provide more no cherry-picking visualization results on different fc layers or fc after conv for different datasets in the appendix,? For E6 DPSGD part, usually sigma = 1*10-4 is considered to be really large eps and too little noise, which is not considered practical privacy protection. For DPSGD on linear layer NN, sigma = 0.01 with some reasonable setting can be considered as eps = 80–100 ( I might calculate wrong but its around that number), which is still not useful for DPSGD. [1] Kariyappa, Sanjay, et al. "Cocktail party attack: Breaking aggregation-based privacy in federated learning using independent component analysis." International Conference on Machine Learning. PMLR, 2023.

Questions

See above.

Rating

7

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

See above.

Reviewer 38cL2024-08-12

I did run the code provided by the author again, and the reconstruction results are fantastic. I am willing to raise my score since the authors addressed all the questions I asked. I believe this method is ground-breaking for gradient inversion attacks in general. Other recent works tend to use diffusion/GAN to enhance their reconstruction results, but this work perfectly reconstructs the linear layer's result and demonstrates the possible vulnerability of LL in many NN architectures. I just had a few detailed questions regarding implementation: 1. For VGG-16, are you running at linear shape = 1 1 4096 layer? 2. for implementation part, could you put Q_opt sperate only for extra evaluation function? I was confused and first thought you directly used GT in the reconstruction process.

Authorsrebuttal2024-08-14

We deeply appreciate the reviewer’s effort in reviewing our paper and code. We are thankful for their insightful questions, the answers of which we will incorporate into the next revision of our paper. Below we respond to their additional questions above: **Q1: For VGG-16, what is the shape of the attacked linear layer?** We use the standard ImageNet VGG-16 from torchvision, which uses AdaptiveAvgPool2d(7, 7), resulting in 25088 input features for the attacked linear layer. The attacked linear layer has 4096 output neurons. We will clarify this. **Q2: Computing $Q_\text{opt}$ in the main file of the attack is confusing** We agree with the reviewer that computing $Q_\text{opt}$, as one of the first things we do in our main can give the wrong impression we use the ground truth $Q$ in our reconstruction. We emphasize this is **not the case** as the reviewer correctly noticed, and we apologize for the confusion this has caused. We compute $Q_\text{opt}$ so that our sampling function *getQBarUniqueCol*, based on Theorem 3.3, in sparse\_gradient\_reconstruction.py can display how many directions were recovered correctly in real-time. This is incredibly valuable for debugging and monitoring the progress of our method. $Q_\text{opt}$ is also used to report the success of the different filtering stages of SPEAR described in Section 4 of the paper. This is done in the function *summarizeQ* in sparse\_gradient\_reconstruction.py, and it is useful for both debugging and for creating Figure 6 in Appendix E.3. We reiterate that $Q_\text{opt}$ is not used for any other purpose in our code. Before making our code public, we will do our best to restructure the code such that $Q_\text{opt}$ is only used at the end of the reconstruction for evaluation to avoid confusion.

Reviewer Brdw7/10 · confidence 3/52024-07-13

Summary

The paper presents SPEAR, a novel algorithm for exact gradient inversion of batches in federated learning. Unlike previous methods, SPEAR achieves exact reconstruction for larger batches by leveraging low-rank structure and ReLU-induced sparsity in gradients. The authors provide a theoretical foundation and an efficient GPU implementation, demonstrating the effectiveness of their approach on high-dimensional datasets and large networks.

Strengths

1. The paper introduces a significant advancement in gradient inversion attacks by enabling exact reconstruction for batch sizes greater than one. 2. The authors provide a strong theoretical basis for their method, including proofs of the low-rank nature of gradients and the sparsity induced by ReLU activations.

Weaknesses

1. The theoretical analysis only considers the ReLu and fully connected layer. 2. The method only seems to be effective for a small batch size, even though it has already been a big progress.

Questions

SPEAR is effective for a moderate batch size of b < 25. What are the possible reasons to prevent the batch size to become larger?

Rating

7

Confidence

3

Soundness

4

Presentation

4

Contribution

4

Limitations

See weakness.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC