Attacks

Federated gradients reveal the shape of private training data

Reviewing Gradient Inversion through Linear and Affine Subspace Constraints · Konstantinos Bouros and Athanasios P. Liavas

Federated gradients reveal the shape of private training data

Researchers show that scaled gradients from a fully connected layer are weighted averages of the private inputs that produced them. Pinning a reconstruction attack to that recovered space improves recovery of client images, even when the batch size is unknown and moderate differential privacy noise is applied.

Federated learning makes a simple promise: your data stays on your device, and only the gradients leave. This research shows how much of the data those gradients still carry. It also shows how a curious server can use the arithmetic of a single layer to get that data back.

Start with how a fully connected layer learns. For each example in a batch, the weight gradient is that example's input multiplied by an error term. Sum over the batch and every row of the gradient becomes a weighted mix of the batch inputs. Earlier attacks already used this. The private inputs sit inside a small space that the gradient reveals.

The researchers add one step. The bias gradient for each row is the sum of those same error terms. Divide the weight row by it and the weights in the mix now add up to one. Each scaled row is a weighted average of the inputs, a point inside the shape they span. That is a tighter fence around where the private data can be.

The attack then does what most gradient inversion does. It invents dummy inputs and adjusts them until their gradients match the ones the client sent. The difference is that the search is penned in. Either the dummy inputs are built only from the recovered space, or they are penalised for straying outside it. Applying this at every fully connected layer leaves the optimiser far less room to wander.

What surprised me most is the batch size. The attacker has to guess how many examples went into an update. Guess too low and reconstruction reliably gets worse. Guess moderately too high and results hold or improve, because the spare slots absorb the duplicates that otherwise spoil an attempt. The attacker does not need to know the batch size. It only needs to guess high.

The gains are real but uneven. On a small three-layer network trained on a standard benchmark of small labelled photos, the subspace methods beat the baselines up to batches of 128. Results depend on architecture and activation function, and the affine version is not always better than the plain linear one. Knowing the labels helps a great deal.

The preconditions are clear. The server is honest but curious: it follows the protocol and reads what it receives. Everything is on images, where a person can spot and discard a bad reconstruction. Differential privacy was tested only at a batch size of 32 with one clipping threshold.

Even so, the noise results matter. Meaningful reconstruction survived until the noise was roughly as strong as the signal on the small network, and well beyond that on a much deeper, widely used image-recognition network. I would not treat modest noise as a defence. If you rely on differential privacy in federated training, expect to add enough noise to cost accuracy.

A gradient is not a summary of the data. It is the data, averaged.

Further analysis

Problem

This paper examines privacy leakage in federated learning via gradient inversion attacks. It focusses on how gradients exchanged during training, especially from fully connected layers, reveal geometric structure that an attacker can exploit to reconstruct private client data. The authors show that, with correct scaling, aggregated weight gradients from a fully connected layer form an affine combination of the layer inputs. Exploiting this linear or affine subspace structure across multiple layers can improve reconstruction accuracy, creating a practical privacy risk for common architectures and training setups.

Approach

The authors derive an identity showing that each normalized row of an FC-layer weight gradient lies in the affine hull of the batch inputs when bias-gradient entries are nonzero. They estimate per-layer linear or affine hulls by singular value decomposition of either the weight-gradient matrix or a ratio-point matrix formed from weight- and bias-gradients, with a reliability weighting to mitigate division instability. Two optimisation modes are proposed: a hard subspace constraint reparameterising inputs via low-dimensional coefficients, and a soft constraint adding subspace regularisers to a gradient-matching objective. Extensions for convolutional networks recover the embedding vector feeding the FC component and apply feature inversion. Experiments use FC-3 networks and VGG-16 on CIFAR-10, Tiny-ImageNet and ImageNet, comparing against gradient-matching and blind-source-separation baselines. The evaluation covers known versus unknown labels, inexact batch-size estimates (over- and underestimation), and gradient perturbation via a differential privacy style clipping-plus-Gaussian-noise mechanism quantified by signal-to-noise ratio. A percentile-based contrast-stretch post-processing is applied to some noisy reconstructions.

Key Findings

  • Subspace-based attacks often improve reconstruction quality relative to baselines in image settings: for the FC-3 model on CIFAR-10 they outperform baselines up to batch sizes of 128, and on Tiny-ImageNet with LeakyReLU they consistently exceed baselines across tested batch sizes.
  • Affine and linear subspace formulations behave similarly under noisy conditions at the evaluated batch size of 32, with soft constraints generally more robust to gradient perturbation; subspace methods outperform baselines at moderate to high SNR.
  • Batch-size misestimation is asymmetric: underestimating the batch size reliably degrades reconstruction, while moderate overestimation often preserves or improves results by providing extra reconstruction slots and reducing duplicate failures.
  • Label knowledge substantially boosts subspace methods, particularly hard-constraint variants, enabling near-perfect embedding reconstruction for VGG-16 at moderate batch sizes when labels are known.
  • Meaningful reconstruction persists down to roughly 0 dB SNR for FC-3 and about -15 dB for VGG-16 in these experiments, showing architecture-dependent resilience to injected noise.

Limitations

Effectiveness depends on network architecture, activation function and layer geometry; sparse-ReLU assumptions used by other exact attacks are not required but affine gains are not uniform. DP experiments are limited to batch size 32, a fixed clipping threshold, and selected noise multipliers, so formal privacy guarantees versus empirical resistance are not fully characterised. The honest-but-curious threat model and image-domain assumptions (ability to recognise and discard poor reconstructions) limit generality.

Implications

An attacker who receives aggregated gradients can exploit per-layer linear or affine subspace structure to improve reconstruction of private inputs or embeddings. Practical strategies include estimating affine hulls from FC-layer gradients, using soft or hard subspace regularisation across layers, overestimating batch size to mitigate duplicates, and applying simple post-processing to enhance visual clarity. Defences relying on modest amounts of noise may be insufficient for some architectures, since substantial perturbation is required to suppress meaningful extraction and this may impair model utility.

The paper title, authors and abstract

Gradient Inversion through Linear and Affine Subspace Constraints

Konstantinos Bouros, Athanasios P. Liavas

Federated learning enables multiple clients to collaboratively train a machine-learning model without directly sharing their local datasets. However, as prior works have shown, the gradients exchanged during training may reveal sensitive information about client data. Most existing attacks usually optimize dummy inputs to match the true client gradients (Gradient Inversion Attacks), while some attempt to reconstruct them based on the observation that aggregate gradients from a fully connected (FC) layer are a linear combination of its inputs. In this work, we extend this observation by showing that aggregate gradients from an FC layer with the correct scaling are actually an affine combination of its inputs. We evaluate a gradient inversion attack that leverages either known linear-subspace information or its affine-subspace counterpart at each FC layer to improve reconstruction accuracy. Our results show that subspace-based methods can substantially improve reconstruction quality over the chosen baselines in certain settings. We further demonstrate that moderate overestimation of the batch size can generally improve or preserve reconstruction quality, even when the true batch size is unknown. We additionally examine reconstruction under gradient perturbations introduced by a differential privacy (DP) mechanism, providing insight into the effectiveness of the considered formulations under noisy conditions.