Papers › DAGER: Exact Gradient Inversion for Large Language Models

DAGER: Exact Gradient Inversion for Large Language Models

24 May 2024arXiv:2405.15586archive 2025-07-28

Ivo Petrov, Dimitar I. Dimitrov, Maximilian Baader, Mark Niklas Müller, Martin Vechev

Federated learning works by aggregating locally computed gradients from multiple clients, thus enabling collaborative training without sharing private client data. However, prior work has shown that the data can actually be recovered by the server using so-called gradient inversion attacks. While these attacks perform well when applied on images, they are limited in the text domain and only permit approximate reconstruction of small batches and short input sequences. In this work, we propose DAGER, the first algorithm to recover whole batches of input text exactly. DAGER leverages the low-rank structure of self-attention layer gradients and the discrete nature of token embeddings to efficiently check if a given token sequence is part of the client data. We use this check to exactly recover full batches in the honest-but-curious setting without any prior on the data for both encoder- and decoder-based architectures using exhaustive heuristic search and a greedy approach, respectively. We provide an efficient GPU implementation of DAGER and show experimentally that it recovers full batches of size up to 128 on large language models (LLMs), beating prior attacks in speed (20x at same batch size), scalability (10x larger batches), and reconstruction quality (ROUGE-1/2 > 0.99).

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2405.15586")

Code

Syntology Ran 7 of 12 code samples harvested from 1 repository linked to this paper; 5 have no recorded run. Of those that ran: 7 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 7 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

insait-institute/dager-gradient-inversion officialmentioned in paperpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 7 ran; 0 honoured the contract we drafted; 5 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

7ran
5unverified

Licence: 0 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from insait-institute/dager-gradient-inversion. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

check_if_in_span insait-institute/dager-gradient-inversion/token_filtering.py official repository ran fingerprinted Apache-2.0 (permissive) · e7f735177bdb9824 · report
filter_in_span insait-institute/dager-gradient-inversion/attack_new.py official repository ran fingerprinted Apache-2.0 (permissive) · 14424832926f4643 · report
get_args insait-institute/dager-gradient-inversion/args_factory.py official repository ran Apache-2.0 (permissive) · e9b16d51d51a6e25 · report
get_param insait-institute/dager-gradient-inversion/analyze_neptune.py official repository ran Apache-2.0 (permissive) · 68917fefa350c8e4 · report
get_stat_mean_std insait-institute/dager-gradient-inversion/analyze_neptune.py official repository ran Apache-2.0 (permissive) · c82d36eb12a25ac4 · report
get_top_B_in_span insait-institute/dager-gradient-inversion/attack_new.py official repository ran Apache-2.0 (permissive) · 85d5abb9ab3a86b5 · report
get_top_B_in_span insait-institute/dager-gradient-inversion/token_filtering.py official repository ran Apache-2.0 (permissive) · 0fc3bbcdae92794f · report
add_partial_forward_bert insait-institute/dager-gradient-inversion/utils/partial_models.py official repository unverified Apache-2.0 (permissive) · 0eb45ed221f977d8 · report
add_partial_forward_gpt2 insait-institute/dager-gradient-inversion/utils/partial_models.py official repository unverified Apache-2.0 (permissive) · 0a2c13e5eac7ed1c · report
add_partial_forward_llama insait-institute/dager-gradient-inversion/utils/partial_models.py official repository unverified Apache-2.0 (permissive) · d75aa69345393336 · report
check_if_in_span insait-institute/dager-gradient-inversion/attack_new.py official repository unverified Apache-2.0 (permissive) · a91a45021f881ade · report
filter_in_span insait-institute/dager-gradient-inversion/token_filtering.py official repository unverified Apache-2.0 (permissive) · 62d1cc29fda7d4f9 · report

Tasks

DecoderFederated LearningHeuristic Search

1 archive task tag without a task page not shown.

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SPEED

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections