Gradient Inversion of Multimodal Models

Omri Ben Hemo, Alon Zolfi, Oryan Yehezkel, Omer Hofman, Roman Vainshtein, Hisashi Kojima, Yuval Elovici, Asaf ShabtaiICML 2025

Federated Learning (FL) has long been touted as the "privacy-first" way to train AI. The pitch is simple: keep your data on your device and only share mathematical updates (gradients) with a central server. But a new paper, Gradient Inversion of Multimodal Models, reveals that for complex vision-language models, those "private" gradients might be leaking your most sensitive documents in near-perfect detail.

The Illusion of Privacy in Federated Learning

In Federated Learning, we assume that because we aren't sending raw images of our tax returns or medical charts to a server, the data is safe. However, Gradient Inversion (GI) attacks have shown that an adversary can reverse-engineer the original input by finding a dummy image that, when fed into the model, produces the exact same gradients the user sent.

Most GI research has focused on simple tasks like identifying a dog in a photo. This paper tackles a much harder and more sensitive domain: Document Visual Question Answering (DQA). DQA models process visually rich documents where the layout and tiny text strings are the most important—and most private—parts. Reconstructing a 10-pixel-tall font from a gradient is significantly harder than reconstructing a large object, yet the privacy stakes are much higher.

Overview of the GI-DQA attack architecture

Introducing GI-DQA

To expose this vulnerability, the researchers developed GI-DQA, an optimization-based attack specifically tuned for the nuances of document images. The core engine is a loss function that minimizes the distance between the client’s real gradients and the adversary’s dummy gradients.

Crucially, the attack assumes the adversary has access to a document template (e.g., a blank version of a standard hospital form). By starting with a template, the optimizer only has to "fill in the blanks" for the private fields. To make the reconstructed text legible, the authors introduced specialized mathematical constraints (priors):

  1. Visual Text Prior (Laplacian Filter): Emphasizes sharp edges and fine-grained details essential for readable text.
  2. Gaussian Prior: Acts as a low-pass filter to scrub out high-frequency noise that often plagues gradient reconstruction.
  3. Total Variation (TV) Prior: Includes a channel-wise constraint that forces the reconstruction toward grayscale, matching the typical appearance of black-and-white documents.
Ablation study showing how different priors improve text reconstruction

Key Insights and Vulnerabilities

The study evaluated the attack using the PFL-DocVQA dataset (containing sensitive invoice information) on both Donut (an OCR-free transformer) and LayoutLMv3 (an OCR-based model). The researchers uncovered several critical insights:

  • The "Pre-Fusion" Vulnerability: Gradients from the early stages of the model—before the text and image features are deeply fused—contain the most recoverable information. Once the modalities are mixed, the signal becomes too blurry to reconstruct fine text.
  • Tokens over Semantics: Surprisingly, the attack doesn't care about the meaning of the question being asked. As long as the attacker knows the exact tokens (the IDs the model uses for words) and their positions, they can reconstruct the document even if the words themselves are replaced with random gibberish.
  • The Sparsity Challenge: Text-based gradients are inherently sparse. Unlike a natural photo where every pixel contributes to the gradient, a document is mostly white space. This makes the signal-to-noise ratio very low, requiring the specialized priors to achieve a clean result.

Results and Defenses

The results are a wake-up call for FL practitioners. On the Donut model, GI-DQA perfectly reconstructed 70.1% of the document’s words. On LayoutLMv3, that number jumped to 82.1%. Standard gradient inversion techniques (like DLG or APRIL) essentially failed on this task, often reconstructing nothing but noise (0-5% accuracy).

To counter this threat, the authors proposed Safe Template, a defense that adds tiny, human-imperceptible perturbations to public document templates. This breaks the gradient alignment for the attacker, dropping their success rate to near zero without hurting the model's actual performance.

Limitations and Future Work

The primary limitation of GI-DQA is its template dependency. The attack is most effective when the adversary knows the general layout of the document. While templates are common in business (invoices, forms), the attack might struggle with completely unstructured documents like handwritten letters.

Additionally, the attack's effectiveness drops as the batch size increases. If a client averages gradients over multiple documents at once, the individual signals become too diffused to isolate. Future work will likely explore how to scale these attacks to larger batches and how to design privacy-aware architectures that bake protection directly into the cross-modal fusion layers.

Summary updated

BibTeX
@inproceedings{hemo2025gradient,
  author = {Omri Ben Hemo and Alon Zolfi and Oryan Yehezkel and Omer Hofman and Roman Vainshtein and Hisashi Kojima and Yuval Elovici and Asaf Shabtai},
  title = {{Gradient Inversion of Multimodal Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=j4IELrBhoG},
}
Figure