Papers › Large Language Models Can Be Strong Differentially Private Learners

Large Language Models Can Be Strong Differentially Private Learners

12 Oct 2021ICLR 2022 4arXiv:2110.05679archive 2025-07-28

Xuechen Li, Florian Tramèr, Percy Liang, Tatsunori Hashimoto

Differentially Private (DP) learning has seen limited success for building large deep learning models of text, and straightforward attempts at applying Differentially Private Stochastic Gradient Descent (DP-SGD) to NLP tasks have resulted in large performance drops and high computational overhead. We show that this performance drop can be mitigated with (1) the use of large pretrained language models; (2) non-standard hyperparameters that suit DP optimization; and (3) fine-tuning objectives which are aligned with the pretraining procedure. With the above, we obtain NLP models that outperform state-of-the-art DP-trained models under the same privacy budget and strong non-private baselines -- by directly fine-tuning pretrained models with DP optimization on moderately-sized corpora. To address the computational challenge of running DP-SGD with large Transformers, we propose a memory saving technique that allows clipping in DP-SGD to run without instantiating per-example gradients for any linear layer in the model. The technique enables privately training Transformers with almost the same memory cost as non-private training at a modest run-time overhead. Contrary to conventional wisdom that DP optimization fails at learning high-dimensional models (due to noise that scales with dimension) empirical results reveal that private learning with pretrained language models doesn't tend to suffer from dimension-dependent performance degradation. Code to reproduce results can be found at https://github.com/lxuechen/private-transformers.

PaperPDFConference PDFCodeCode 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="2110.05679")

Code

Syntology Ran 0 of 9 code samples harvested from 3 repositories linked to this paper; 9 have no recorded run.

By repository: community (archive-listed): 9 samples from 3 repositories, 0 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

lxuechen/private-transformers officialmentioned in papermentioned on GitHubpytorchApache-2.0 report
facebookresearch/pytorch-dp mentioned on GitHubpytorchApache-2.0 report
jialinmao/private_cnn mentioned on GitHubpytorch report
pytorch/opacus mentioned on GitHubpytorchApache-2.0 report
woodyx218/SLOPE_AMP mentioned on GitHub report
woodyx218/private_vision mentioned on GitHubpytorch 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

9 samples harvested; 0 ran; 0 honoured the contract we drafted; 9 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.

9unverified

Licence: 0 of the 9 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 3 repositories linked to this paper, official or community; each sample names its own and says which. “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.

apply_permutation pytorch/opacus/opacus/layers/dp_rnn.py community (archive-listed) unverified Apache-2.0 (permissive) · 46783ac8b5216877 · report
dtype_safe facebookresearch/pytorch-dp/opacus/data_loader.py community (archive-listed) unverified Apache-2.0 (permissive) · 0b1c417eba15b30c · report
filter_out_old_keys pytorch/opacus/opacus/layers/param_rename.py community (archive-listed) unverified Apache-2.0 (permissive) · a20422f8abbda65c · report
get_layer_set facebookresearch/pytorch-dp/benchmarks/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · 38d3968927d62f28 · report
get_sigma_from_gdp woodyx218/private_vision/private_vision/privacy_engine.py community (archive-listed) unverified Apache-2.0 (permissive) · fc285748768188e6 · report
get_sigma_from_rdp woodyx218/private_vision/private_vision/privacy_engine.py community (archive-listed) unverified Apache-2.0 (permissive) · 4cb8d0becf117730 · report
get_sigma_from_rdp_cks woodyx218/private_vision/private_vision/privacy_engine.py community (archive-listed) unverified Apache-2.0 (permissive) · 5d0f89a9f572d13f · report
reset_peak_memory_stats facebookresearch/pytorch-dp/benchmarks/utils.py community (archive-listed) unverified Apache-2.0 (permissive) · e49fd334c05bf4ec · report
shape_safe facebookresearch/pytorch-dp/opacus/data_loader.py community (archive-listed) unverified Apache-2.0 (permissive) · 556ad0ee1120c05e · report

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

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