Can an Unknown Analog Chip Hide a Federated Gradient?

In federated learning, many devices train a shared model on their own data and send only weight updates to a server. That arrangement is less private than it looks. A server that knows the current model weights can search for an input whose gradient matches the one it received, and it often recovers the client's training images (Deep Leakage from Gradients, Inverting Gradients). Every such attack assumes something rarely stated: the server knows the exact function the client evaluated.

That assumption fails when the client runs on analog in-memory hardware. These are chips that store weights as electrical conductances in memory cells and do matrix multiplication with currents. On such a chip, the weights the server sent are not the weights the chip actually used. Programming errors, slow conductance drift, and stuck cells shift every weight by a chip-specific amount. Fresh read noise is added on every pass. This proposal asks which of these effects actually hides a client's data from gradient inversion. It also asks whether that protection survives an attacker who models the hardware.

Core Claim

We hypothesize that analog clients gain little privacy from transient read noise. At accuracy-preserving levels it behaves like weak additive noise, which strong attacks tolerate. Any real protection, we expect, comes from the persistent and secret gap between the server's nominal weights $W$ and the chip's effective weights $W + \delta_c$, where $\delta_c$ is the deviation specific to chip $c$.

This protection is also exactly what an informed attacker can learn. Because $\delta_c$ persists across rounds, the server observes it repeatedly. We predict that a hardware-aware attacker that estimates it from a few rounds will recover most of the leaked information. The exception is when the deviation is refreshed, for example by reprogramming the chip each round.

The novelty is twofold. First, no prior work runs gradient inversion against gradients produced through an analog substrate. Second, we separate persistent from transient non-idealities and test both against an adaptive attacker rather than only a naive one. If the hypothesis holds, the practical outcome is a concrete design rule (reprogram per round) with a measured privacy–accuracy cost. If it fails, the study is still a clear negative result.

Relation to Prior Work

The closest motivating result is The Inherent Adversarial Robustness of Analog In-Memory Computing. On IBM's HERMES phase-change-memory chip, it shows that read noise and analog-to-digital quantization act as a "moving target" against inference-time evasion attacks such as PGD. That paper studies only forward-pass attacks on inputs, never training gradients. Its moving-target mechanism also concerns transient noise, which our hypothesis predicts is the weaker component for privacy.

Towards Exact Gradient-based Training on Analog In-memory Computing supplies the on-chip training setting. It analyzes asymmetric conductance updates and the Tiki-Taka two-array optimizer, with ResNet-34 on CIFAR-10 reaching 95.15% versus 93.44% for digital SGD. It measures only convergence and accuracy, not privacy. Its result does suggest that analog perturbations need not cost accuracy, which is the property that differential privacy lacks.

Fault-Free Analog Computing with Imperfect Hardware supplies the observation that stuck-cell maps are unique per chip. It mentions privacy only as a reason to avoid retraining and evaluates no attack.

On the attack side, we reuse three methods: Deep Leakage from Gradients (Euclidean gradient matching), Inverting Gradients (cosine matching with a total-variation prior), and Gradient Inversion with Generative Image Prior. The last of these, called GIAS, searches over a generator's latent space and reconstructs images even with 99% of gradients pruned. It is therefore the stress test for whether any hardware-induced loss of information is real or merely cosmetic.

On the defense side, Mixed Quantization Enabled Federated Learning is the closest structural analogue. It also hides client-side parameters (per-layer quantization scales) from the server. It is purely digital and was evaluated only against the original Euclidean attack, not adaptive or generative ones. Our study runs that same comparison: secret client parameters, then an attacker who tries to estimate them.

Research Program

All simulation uses the IBM Analog Hardware Acceleration Kit (Using the IBM Analog In-Memory Hardware Acceleration Kit), configured with its phase-change-memory device models. We study two client regimes.

In the first, the forward and backward matrix multiplications run on simulated crossbars, the circuit grids of memory cells that perform the analog multiplication. Weight gradients are then formed digitally and transmitted; this is the near-term regime for chips built for analog inference.

In the second, local steps are taken fully on chip with analog SGD or Tiki-Taka. The client transmits the read-out conductance change after $K$ local steps, so update asymmetry and read noise enter the message itself.

We decompose the non-idealities into persistent components and transient components. The persistent ones are programming error, drift since programming, stuck-at cells, and per-tile scale mismatch. The transient ones are read noise and converter quantization. We turn each component on alone and in combination, at magnitudes calibrated to the toolkit's device models. We sweep around those magnitudes to cover chips of different quality.

The new attack component is a hardware-aware inversion. In addition to the dummy input $x$ and label $y$, the attacker optimizes a low-dimensional deviation model $\delta(\phi)$, shared across all rounds from the same client:

$$\min_{x_{1:R},\,\phi}\ \sum_{r=1}^{R} \Big[1-\cos\big(\nabla_W \mathcal{L}(f(x_r; W_r+\delta(\phi)), y_r),\ g_r\big)\Big] + \lambda\, \mathrm{TV}(x_r).$$

Here $R$ is the number of intercepted rounds, $W_r$ is the nominal model at round $r$, and $g_r$ is the received update. The parameters $\phi$ capture a per-tile gain and offset, a drift exponent with elapsed time, and a sparse stuck-cell mask relaxed to continuous values. $\mathrm{TV}$ is the total-variation image prior, weighted by $\lambda$.

Persistence is what makes $\phi$ learnable. The deviation is the same across rounds while the data change, so evidence accumulates about the chip, much as GIML accumulates evidence about the data distribution. For the generative variant, we replace $x_r$ with GIAS latents.

The final step tests a mitigation suggested by the analysis: reprogramming the chip at the start of each round. This draws fresh programming noise, so $\delta_c$ is no longer shared across rounds. We measure its accuracy cost under hardware-aware training (Hardware-aware training for large-scale and diverse deep learning inference workloads), and its energy and wear cost is noted as a limitation.

Baselines

The naive reference point is an undefended digital float32 client attacked with the cosine method. The file reports roughly 14 dB reconstruction quality (peak signal-to-noise ratio, PSNR) on a trained ResNet-20 for CIFAR-10, versus roughly 7 dB for the Euclidean attack (Inverting Gradients). GIAS reaches 15.58 dB against 13.78 dB for pixel-space attacks (Gradient Inversion with Generative Image Prior). We rerun both ourselves on identical images, architectures, and batch sizes rather than comparing against reported numbers across papers.

The strongest existing defense is mixed quantization with client-held scales. It drops attack PSNR from 55.3 dB to 8.1 dB while keeping 96.67% MNIST accuracy with LeNet-5 (Mixed Quantization Enabled Federated Learning). We reproduce it on LeNet-5/MNIST and extend it to ResNet-20/CIFAR-10. We attack it with the same adaptive treatment: the attacker optimizes the unknown scales jointly, with the same per-attack iteration budget as against the analog clients.

Differential privacy with matched final accuracy is the formal baseline. The file reports it falling to roughly 78–85% MNIST accuracy at protective noise levels.

The ablation that isolates our key ingredient is a digital client that adds a secret, persistent random weight perturbation matched in magnitude and spatial statistics to $\delta_c$. A second ablation adds isotropic gradient noise matched in total power to the analog gradient error.

The analog client counts as beating a baseline under two conditions. It must achieve lower adaptive-attack PSNR than that baseline at equal or better task accuracy. And the gap must hold under GIAS, not only under pixel-space attacks.

Why not just…?

Why not just add Gaussian noise to the gradients (differential privacy)? The cited evidence says protective noise levels (above $10^{-2}$ variance in Deep Leakage from Gradients) cost substantial accuracy. Analog training, by contrast, has been reported to match or exceed digital accuracy. Still, if analog error is effectively just noise, power-matched Gaussian noise should match it in both privacy and accuracy. Our power-matched noise ablation tests this directly. If the two curves coincide, we will report that analog hardware offers nothing beyond uncertified noise and that differential privacy is strictly preferable, because it comes with a guarantee.

Why not just secretly perturb the weights in software? This is the real threat. If the hypothesis is right, a digital client could imitate the mechanism with a random secret offset at no hardware cost. We treat this as a first-class ablation rather than arguing around it. The adaptive attacker should break both the analog and the software version when the offset is persistent, and both should be harder to break when it is refreshed. The analog-specific contribution then narrows to two things: the mismatch comes at no extra cost on hardware that is already in use, and its structure (drift, stuck cells, asymmetric updates) differs from Gaussian. We test whether that structure is harder or easier to estimate than an isotropic offset of matched magnitude.

Why not just use mixed quantization? It already performs well against the original attack. Hidden scales, however, are a low-dimensional secret of the same kind as our $\phi$, and the original evaluation never tested an attacker who estimates them. Running the same adaptive attack against both defenses shows whether either secret survives estimation. That comparison is informative whichever way it comes out.

Proposed Experiments

The benchmarks are CIFAR-10 with ResNet-20, CIFAR-100 for the Euclidean-attack comparison, MNIST with LeNet-5 for direct comparison to mixed quantization, and FFHQ at 32×32 for GIAS. We use batch sizes 1, 8, and 32, and local-step counts $K \in \{1, 5\}$. Metrics are reconstruction PSNR and MSE averaged over 100 targets, task accuracy after federated training, and the number of intercepted rounds the adaptive attacker needs to recover the PSNR it achieves against a digital client.

Three results are decisive. The first is whether the naive attack degrades against the analog client at matched accuracy, and which non-ideality component accounts for the drop. The second is whether the hardware-aware attacker closes the gap as $R$ grows; we predict it does for persistent deviations and does not when the chip is reprogrammed each round. The third is whether the residual protection under per-round reprogramming exceeds the secret-software-offset and power-matched-noise ablations under GIAS. If it does not, the conclusion is that analog hardware is not a privacy mechanism. In that case the reason it appears to defend against evasion attacks would not carry over to training gradients.