Training a language model with differential privacy means clipping each example's gradient and adding Gaussian noise to every update, so that no single training sentence can be recovered from the model. This breaks Adam, the optimizer that gives rarely updated parameters larger steps. Adam divides each parameter's step by a running average of its squared gradient, and that average now also absorbs the squared noise. Every parameter then looks equally noisy, and Adam behaves like plain gradient descent. The parameters hurt most are those tied to rare inputs. In language data, the rarest inputs are usually named entities: specific people, companies, drugs.
A separate line of work replaces entity mentions with placeholders such as [PERSON]. The goal there is to stop models from memorizing names instead of reading context. This proposal asks whether that masking and noise-aware optimizer fixes solve the same problem or different ones. The test case is private relation extraction, where entity names are both the main shortcut and the main privacy risk. Our hypothesis is that masking removes the rare tail on the input side, while optimizer correction is still needed for the rare tail on the label side. If so, masking would be close to free under privacy even though it costs accuracy without privacy.
Core Claim
In DP-Adam, the per-coordinate second moment is inflated by the known noise variance $\Phi = \sigma^2$. Here $\sigma$ is the per-coordinate noise standard deviation after averaging, fixed by public quantities: clipping norm, noise multiplier and batch size. DP-AdamBC shows that uncorrected DP-Adam is effectively DP-SGD with momentum. It restores adaptivity by subtracting this variance:
$$\hat v^{corr}_{t,j} = \max(\hat v_{t,j} - \Phi,\ \gamma'),$$
Here $\hat v_{t,j}$ is Adam's running squared-gradient estimate for parameter $j$ and $\gamma'$ is a small floor. The companion analysis in On the Performance of Differentially Private Optimization with Heavy-Tail Class Imbalance traces the damage to rare tokens and rare classes. The correction also has a weak point. For a coordinate whose true gradient is almost always zero, such as the embedding row of a rare entity subword, $\hat v_{t,j}$ is nearly pure noise. The corrected value then hovers near zero and is set mainly by $\gamma'$. We measure each parameter group's health through the ratio
$$\rho_j = \hat v^{corr}_{t,j} / \Phi,$$
which estimates signal energy relative to noise energy for coordinate $j$.
Our claim has two parts. The first concerns inputs. Entity masking collapses thousands of low-$\rho$ entity coordinates into a few frequently updated type tokens. On the input side it can therefore do what bias correction does, and more stably, because it removes near-zero-signal coordinates instead of dividing by a noisy estimate of them. The second concerns labels. Relation labels stay heavy-tailed after masking: TACRED is 78.7% no_relation with dozens of rare relations. Coordinate-wise correction therefore remains necessary in the classifier and upper layers.
The predicted signature appears in a two-by-two design crossing masking with correction. Masking should close most of the gap on entity-driven errors. Correction should close most of the gap on rare-relation F1. Their gains should roughly add rather than overlap.
This intersection is open. User-Entity Differential Privacy in Learning Natural Language Models defines privacy at the level of one user plus one sensitive entity. It uses entity detection only to decide which sentences to sample, and it trains with a standard non-adaptive optimizer. Masked Differential Privacy adds noise only to "private" video tokens, but it is purely visual and also runs plain DP-SGD. The DP-AdamBC papers treat input text as fixed. No work in the file measures how changing the input vocabulary through masking changes the private optimizer's noise geometry.
Research Program
The masking side reuses established techniques. We will compare four input conditions:
- Unmasked text as the reference.
- Blinding with a single
[BLANK]token, following the entity-masked contrastive pre-training of Learning from Context or Names?. That paper showed relation extractors rely heavily on names. - Typed masking with subject/object markers such as
[PERSON]-SUBJ, following Position-aware Attention and Supervised Data Improve Slot Filling. That paper introduced TACRED and used type replacement to block name memorization. - Mention randomization, which replaces each mention with a fresh random string. This condition is diagnostic. It keeps the mention's position and length but guarantees that its tokens carry no reusable signal.
Each masking condition is run twice: once with gold entity spans and once with spans from an off-the-shelf automatic tagger. The tagger version exposes the "ghost entity" leakage that User-Entity DP identifies.
The optimizer side crosses these inputs with three private optimizers under identical sample-level DP accounting: DP-SGD with momentum, uncorrected DP-Adam, and DP-AdamBC. The contribution is not a new optimizer. It is a controlled measurement, plus a mechanistic account of when masking substitutes for or complements correction.
The mechanism is instrumented directly. During training we log the $\rho_j$ distribution for four parameter groups:
- embedding rows of entity subwords;
- embedding rows of context words;
- transformer body;
- relation classifier head.
We also log the fraction of steps at which the $\gamma'$ floor is active in each group. Two things must be observed to support the substitution half of the claim. Masking should remove the low-$\rho$ entity mass. It should also shrink the floor-activation rate, and with it DP-AdamBC's sensitivity to $\gamma'$, which the file lists as a known weakness.
One caveat shapes the analysis. Subword tokenizers split many names into pieces shared with ordinary words. How much rare-token mass masking removes is therefore an empirical question, which the per-group logs answer.
The privacy side is evaluated for its actual protection, not assumed from masking. We insert canary sentences that pair synthetic entity names with relations and measure how readily the trained model reproduces each canary relation. This is done with and without DP, and with gold and tagger-based masking. The canaries are designed to show that masking alone leaks through missed entities, while DP bounds that leak.
Baselines
Naive reference. Unmasked Re-TACRED fine-tuned with uncorrected DP-Adam, the default most practitioners would run, alongside the same model trained without privacy. This fixes both the floor and the ceiling. As non-private context, the file reports 65.4% F1 on the original TACRED for the typed-masking PA-LSTM of Zhang et al. It also reports an average 14.3% F1 improvement when models are evaluated on the cleaned Re-TACRED instead of TACRED. That paper found 23.9% of TACRED labels were wrong, which is why we evaluate on Re-TACRED.
Strongest existing method. DP-AdamBC on unmasked text, because it is the method specifically shown to rescue rare tokens and classes under privacy. The file reports 56.1% versus 52.6% final accuracy for DP-AdamBC versus DP-Adam on SNLI (DP-AdamBC). It also reports 75% versus 66% accuracy on medium-to-low-frequency tokens against DP-GD on TinyPTB (Heavy-Tail Class Imbalance). There is no reported result found on Lacuna for any private optimizer on TACRED or Re-TACRED.
Strong compute-matched optimizer. DP² builds its preconditioner from private gradients averaged over several steps. It reached about 39% versus 33% test accuracy over DP-SGD on StackOverflow. It is included as a second adaptive competitor because it attacks the same noise problem by averaging instead of subtraction.
FIBER reported 44% versus 39% ImageNet top-1 over DP-AdamW at ε = 8, at about 1.79 times the wall-clock cost. Because of that cost, it is run only at the final privacy budget, as a check that a stronger optimizer does not erase the masking effect.
Ablations. Two ablations isolate the key ingredient. First, mention randomization tests whether masking helps by removing reusable name signal or merely by shortening the effective vocabulary. Second, the tagger-versus-gold comparison tests whether the benefit survives imperfect detection.
Fairness. Every configuration gets the same model, data split, privacy budget, number of passes over the data, and the same hyperparameter grid over learning rate and clipping norm. The Role of Adaptive Optimizers for Honest Private Hyperparameter Selection shows that tuning cost differs sharply between optimizers under privacy: peak Adult accuracy took ε ≈ 1.9 for DPAdam versus ε ≈ 5.0 for DPSGD. We therefore also report results when tuning is charged to the privacy budget.
What counts as beating the strongest baseline. Masked DP-AdamBC must exceed unmasked DP-AdamBC on macro F1, and on the context-only evaluation described below, at ε ∈ {1, 3, 8}. The margin must exceed seed variance over at least five seeds. It must do so without losing micro F1 on frequent relations.
Why not just…?
Why not just use DP-SGD with momentum and tune the schedule? The DP-AdamBC work shows that uncorrected DP-Adam already reduces to this. It also shows that correction beats DP-Adam by 3.5 points on SNLI and beats DP-GD by 9 points on rare-token accuracy on TinyPTB. This is a real threat in one specific way: if masking removes the rare input tail, plain DP-SGD on masked text might be nearly as good. That outcome would falsify the complement half of our claim. The masked DP-SGD versus masked DP-AdamBC cell, broken down by relation frequency bucket, settles it directly.
Why not just mask entities and skip differential privacy? Masking is a heuristic. User-Entity DP argues that de-identification fails against linkage and against entities the tagger misses. The canary experiment with tagger-based masking measures that leak directly in our setting. If non-private masked training shows no more canary leakage than private training, we will report it, but prior evidence predicts otherwise.
Why not just use DP-AdamBC and leave the text alone? Correction might already rescue rare entity coordinates, making masking redundant. We think this is unlikely to be the full story. For coordinates whose true gradient is almost always zero, the corrected second moment is dominated by the floor $\gamma'$, so correction cannot recover signal that is barely present. Masking also targets name reliance, which correction does nothing about. The $\rho_j$ logs, the $\gamma'$ sensitivity sweep, and context-only evaluation distinguish these outcomes.
Why not just freeze the embeddings, or drop the second moment as in DPAdamWOSM? Freezing embeddings removes the noisiest rare rows cheaply and is a credible competitor, so frozen-embedding DP-AdamBC is added as a baseline. Dropping the second moment (Adaptive HParam Selection) gives up exactly the per-coordinate scaling the label tail needs. It is included in the ε = 3 sweep so the prediction can be checked rather than assumed.
Proposed Experiments
Setup. The main study fine-tunes a BERT-base-sized encoder on Re-TACRED at ε ∈ {1, 3, 8}. It crosses the four input conditions with the three optimizers, using gold spans, plus tagger-span replicates for the masked conditions.
Metrics. We report:
- micro F1 excluding
no_relation; - macro F1;
- F1 by relation-frequency tercile;
- the "Only Mention" and context-only probes of Peng et al. (Learning from Context or Names?), which measure how much the model relies on names versus context;
- canary exposure;
- the $\rho_j$ and floor-activation diagnostics.
A low-resource run at 1% of training data tests whether the non-private low-resource gains from masking persist under privacy. In that regime Peng et al. report 0.485 versus 0.211 F1 on TACRED for their masked contrastive pre-training over BERT.
Transfer checks. Repeating the key cells with private low-rank fine-tuning via PRISM tests whether the effect holds when only a small low-rank update is trained. PRISM reported 0.690 versus 0.641 average accuracy on Math-10K against AdamW-based DP-LoRA. A CoNLL-2003 language-modeling run under entity-level privacy, compared against User-Entity DP's reported perplexity of about 35 at ε ≈ 0.185, tests whether the effect carries over to generation.
Decisive checks. The claim is supported by three findings together:
- masking and correction gains are approximately additive, with masking moving mainly the context-only probe and correction moving mainly rare-relation F1;
- masking visibly removes low-$\rho$ entity mass and reduces DP-AdamBC's sensitivity to $\gamma'$;
- the accuracy cost of masking relative to unmasked text is smaller under privacy than without it.
The claim is refuted if unmasked DP-AdamBC matches masked DP-AdamBC on every metric, or if masked DP-SGD matches masked DP-AdamBC on rare relations.
References
- DP-AdamBC: Your DP-Adam Is Actually DP-SGD (Unless You Apply Bias Correction)
- On the Performance of Differentially Private Optimization with Heavy-Tail Class Imbalance
- User-Entity Differential Privacy in Learning Natural Language Models
- Masked Differential Privacy
- Learning from Context or Names? An Empirical Study on Neural Relation Extraction
- Position-aware Attention and Supervised Data Improve Slot Filling
- Re-TACRED: Addressing Shortcomings of the TACRED Dataset
- Differentially Private Adaptive Optimization with Delayed Preconditioners
- FIBER: A Differentially Private Optimizer with Filter-Aware Innovation Bias Correction
- The Role of Adaptive Optimizers for Honest Private Hyperparameter Selection
- PRISM: Gauge-Invariant Tangent-Space Differentially Private LoRA