This repo is an official implementation for the paper Stealing Exact Training Data from Clients during Federated Learning (https://arxiv.org/abs/2611.24689).
Malicious adversaries can employ gradient inversion attacks to reverse-engineer private data using the model updates of a round in Federated Learning (FL). While there have been developments in gradient inversion for text, exact text recovery by a malicious client has so far remained infeasible, as FedAvg entangles the gradient contributions of many clients and obscures the signal of any individual sentence. We introduce a novel attack pipeline that unwinds this entanglement progressively through an iterative loop, in which the gradient contributions of sentences recovered exactly in one round are subtracted from the aggregate, exposing the remaining sentences for recovery in the next iteration. We show, for the first time, exact sentence recovery, with 100% precision, and on aggregates containing up to
Given one gradient
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtRequires Python 3.10+, a CUDA GPU for non-trivial batches, and a locally cached Hugging Face checkpoint for a model.
Provide a client JSON (client 0 is the known acting client whose contribution is subtracted; clients 1+ hold the private sentences to recover):
python3 recover.py \
--client-data examples/client_data_example.json \
--model-name <model-name-on-huggingface> \
--run-dir runs/demoThe run prints the recovered sentences and writes a summary JSON. Because ground truth is known in this mode, it also reports exact-recovery metrics.
{
"clients": [
{"weight": 1.0, "texts": ["A short acting-client sentence."]},
{"weight": 1.0, "texts": ["First private sentence.", "Second private sentence."]},
{"weight": 1.0, "texts": ["A sentence held by another client."]}
]
}Run python3 recover.py --help for the full list of detailed, stage-by-stage
description of every knob and help information.
Our source code is under the CC BY-NC-SA 4.0.
- Omkar Shrikanth
- Soham Dambalkar
- Parag Pal
- Advik Raj Basani
- Arnab K. Paul
First-author order settled via a Clash Royale tournament.
Our attack exposes a privacy risk in FL, a participating client may reconstruct other clients' training text from aggregate updates. This capability poses a dual-use risk, as it could enable unauthorized access to sensitive information. Our evaluation uses existing research datasets rather than data collected from deployed federated systems. Our aim is to inform privacy assessments and the development of stronger defenses, not to facilitate unauthorized data recovery.
If you found this work helpful, please feel free to cite our work:
@misc{shrikanth2026stealingexacttrainingdata,
title={Stealing Exact Training Data from Other Clients during Federated Learning},
author={Omkar Shrikanth and Soham Dambalkar and Parag Jyoti Pal and Advik Raj Basani and Arnab K. Paul},
year={2026},
eprint={2611.24689},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2611.24689},
}
