[Paper Review] Deep Leakage from Gradients
This paper introduces Deep Leakage from Gradients (DLG), an optimization-based attack that reconstructs private training data—both images and text—exactly from shared gradients in distributed machine learning. The method iteratively optimizes dummy inputs and labels to match real gradients, achieving pixel- and token-wise exact recovery in just a few steps, exposing a critical privacy vulnerability in gradient-sharing systems.
Exchanging gradients is a widely used method in modern multi-node machine learning system (e.g., distributed training, collaborative learning). For a long time, people believed that gradients are safe to share: i.e., the training data will not be leaked by gradient exchange. However, we show that it is possible to obtain the private training data from the publicly shared gradients. We name this leakage as Deep Leakage from Gradient and empirically validate the effectiveness on both computer vision and natural language processing tasks. Experimental results show that our attack is much stronger than previous approaches: the recovery is pixel-wise accurate for images and token-wise matching for texts. We want to raise people's awareness to rethink the gradient's safety. Finally, we discuss several possible strategies to prevent such deep leakage. The most effective defense method is gradient pruning.
Motivation & Objective
- To investigate whether shared gradients in distributed machine learning can leak private training data.
- To develop a method that reconstructs exact training samples (inputs and labels) from gradients without relying on generative models or prior data knowledge.
- To evaluate the feasibility and effectiveness of gradient-based data reconstruction across vision and language tasks.
- To identify and analyze defense strategies that can prevent such deep leakage while maintaining model utility.
Proposed method
- The attack uses an optimization framework that treats the input data and labels as learnable variables, initialized randomly.
- It performs forward and backward passes on the dummy data to compute gradients, then minimizes the L2 distance between these gradients and the real gradients from the model.
- The optimization alternates between updating the dummy inputs and labels to match the real gradients, converging to the original training samples.
- The method is applied iteratively until the reconstructed inputs and labels are indistinguishable from the original data.
- The approach does not require any generative model, class labels, or prior data distribution assumptions.
- Defenses are evaluated via gradient perturbation (Gaussian/Laplacian noise), low-precision representation (fp16, bfloat16, int8), and gradient sparsification (pruning).
Experimental results
Research questions
- RQ1Can private training data be reconstructed from publicly shared gradients in distributed machine learning systems?
- RQ2Is it possible to recover exact input samples (not just synthetic approximations) using only gradient information?
- RQ3How effective are common defenses such as gradient noise, quantization, and sparsification in mitigating this attack?
- RQ4What are the trade-offs between model accuracy and defense effectiveness in the presence of gradient-based data leakage?
Key findings
- DLG successfully recovers training data with pixel-wise accuracy on image classification tasks and token-wise exact matching on masked language modeling tasks.
- The attack achieves full data reconstruction in just a few hundred optimization steps, demonstrating high efficiency and effectiveness.
- Gradient perturbation with noise scale > 10^-2 (Gaussian or Laplacian) effectively prevents the attack, while lower scales fail.
- Half-precision formats (fp16, bfloat16) do not defend against DLG, as the attack remains effective despite reduced precision.
- Gradient pruning with a sparsity of 20% or higher successfully prevents leakage, with higher sparsity (e.g., 99%) being highly effective but reducing model accuracy.
- Integer quantization (int8) defends against the attack but causes significant accuracy drop (to 53.7% on CIFAR-100), indicating a strong trade-off.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.