Generating Synthetic Queries with a Differentially Private Language Model for Privacy-Preserving Deep Retrieval SystemsSynthetic Query Generation for Privacy-Preserving Deep Retrieval Systems using Differentially Private Language Models
The authors use DP fine-tuned T5 to generate synthetic queries to train a deep retrieval system, achieving NDCG@10 of 0.1830 on MSMARCO (ε=3), higher than direct DP training's 0.0234.
The goal is to guarantee query-level (ε, δ)-DP for the original training data before training a deep retrieval system (adjacent datasets differ by exactly one query); the protected object is queries containing users' personal information, while candidate item documents are treated as public, non-personal information; the victim system is a dual-encoder deep retrieval system trained with an in-batch softmax contrastive loss.
- Deep retrieval systems are trained with contrastive losses such as in-batch softmax, which cannot be decomposed per example and are difficult to train directly with DP; queries contain users' personal information, so query-level differential privacy must be guaranteed before training.
- Fine-tune a publicly pretrained T5 on MSMARCO with DP-Adafactor so that it generates synthetic queries from documents, then use the synthetic query–original document pairs to train a dual-encoder retrieval model in a standard non-private way, relying on the post-processing property of DP to preserve privacy.
- On MSMARCO, at ε=3 the NDCG@10 of training on synthetic data is 0.1830, while direct DP training is only 0.0234; in BEIR zero-shot evaluation, ε=16 synthetic data is close to the non-private baseline; in the canary experiment, the leakage rate at ε=16 is 0%.
- The authors point out: DP fine-tuning of large models is computationally expensive; the pretrained LM must not have seen the original queries; the DP model generates incoherent queries; the method guarantees only query-level privacy. The experiments use only the T5 family and MSMARCO/BEIR, and retrieval results are reported from a single training run only.
- Evaluated models
- T5-SmallT5-BaseT5-LargeT5-XL
- Benchmarks
- MSMARCOBEIR
- Metrics
- NDCG@10Recall@10BLEUMAUVEcanary exposure (rank, leaked)
Researchers proposed using a differentially private (DP) language model to generate synthetic queries, enabling a deep retrieval system to complete training without leaking query privacy. Contrastive losses are difficult to decompose per sample, and commonly used DP training techniques require per-sample gradients, so retrieval systems are difficult to train directly with DP; this method generates private synthetic queries representing the original data before training for downstream training use. Compared with direct DP training, this method significantly improves retrieval quality while maintaining query-level privacy guarantees.
Paper analysis
What problem does this paper attempt to solve?
The contrastive loss cannot be decomposed per sample, which makes direct DP training of deep retrieval systems difficult; the authors instead use a DP language model to generate synthetic queries.
Core problem: The contrastive losses commonly used in deep retrieval systems (such as in-batch softmax) are not per-example decomposable, making direct DP training difficult, while user queries in the training data require privacy protection.
- Problem setting: Deep retrieval systems match user queries to candidate items; items are usually public, non-personal information (articles, products, ads, etc.), but queries often contain users' personal information. The authors note that neural models memorize and leak sensitive information in training data, and retrieval-augmented generation systems have been shown to be more likely to leak private data.
- Shortcomings of existing methods: The authors state that DP-SGD is incompatible with in-batch softmax — each sample's gradient depends on the entire batch, sensitivity grows with batch size, requiring more noise; standard DP-SGD can only provide example-level guarantees, not directly the looser query-level guarantee; vectorized computation of per-example gradients also requires replicating samples within the batch, with memory cost growing quadratically with batch size, forcing smaller batches, while contrastive learning relies on large batches.
- Core observation: Based on the post-processing property of DP — a DP mechanism first produces synthetic data, after which arbitrary training no longer consumes privacy budget — the authors move privacy protection before retrieval system training.
- Method proposed in the paper: Use a DP-fine-tuned public pretrained language model (T5) to generate synthetic queries from item documents, then train any downstream dual-encoder retrieval system on "synthetic queries + original documents," thereby providing query-level DP guarantees for the original training data.
- Threat model:
- Protection target: queries in the original training data, guaranteeing query-level (ε, δ)-DP, with neighboring datasets defined as differing in exactly one query (Section 3.3).
- Attacker capability: The paper does not specify a concrete attacker; empirical privacy is measured with canary exposure (injecting canaries containing random 10-digit number strings into the training data and measuring the model's tendency to output them).
- Victim system: A dual-encoder deep retrieval model trained with in-batch softmax loss.
- Assumption: The pretrained LM used to generate synthetic data must not be significantly pretrained on the original queries, otherwise the privacy guarantee is broken.
What related research exists?
Related work falls into two categories: DP language model synthetic data (pointwise loss setting) and DP training with non-decomposable loss; this paper extends the former to the contrastive loss setting.
DP language model synthetic data
- Yue et al. (2022), Mattern et al. (2022), Mireshghallah et al. (2022), Putta et al. (2022) — study generating private synthetic data with DP-fine-tuned LMs for downstream tasks with pointwise loss (text classification, semantic parsing). These works find that under the same privacy budget, downstream models trained on private synthetic data outperform models trained directly with DP; non-private synthetic data can even improve performance under no privacy constraint. The authors explain the reason as DP synthetic data injecting additional public information from the pretrained LM.
- The authors position this paper: under the different learning paradigm of non-per-example decomposable loss, another exploration of the advantages of private synthetic data, motivated by achieving query-level DP guarantees with high utility in deep retrieval systems.
DP training with non-decomposable loss
- Huai et al. (2020), Xue et al. (2021), Kang et al. (2021) — propose specialized algorithms for DP training with pairwise loss. The paper notes that these works design algorithms under specific conditions such as convexity, smoothness, and Lipschitz continuity to maintain sensitivity upper bounds; the authors state that this paper is a general method without such additional assumptions.
Background on deep retrieval and privacy risks
- Huang et al. (2020), Ni et al. (2021) — dual-encoder deep retrieval systems; Gillick et al. (2019), Karpukhin et al. (2020), Qu et al. (2020) — in-batch softmax loss.
- Carlini et al. (2019, 2021), Lehman et al. (2021) — neural models memorize and leak training data; Huang et al. (2023), Zeng et al. (2024) — retrieval-augmented generation systems are more likely than LMs trained directly on private data to leak information from private data stores.
- Dai et al. (2022), Bonifacio et al. (2022) — use LMs for synthetic data augmentation to improve deep retrieval, cited by the authors to show that this direction has received attention in recent years.
Baselines and benchmarks: The baseline method is a dual-encoder retrieval model trained directly with DP on the original data (batch size reduced to 32 due to memory limits), plus a non-private training (ε=∞) reference; the benchmarks are MSMARCO (about 533,000 query-document pairs) and the BEIR suite (zero-shot evaluation).
How does the paper address this problem?
Three-step pipeline: DP fine-tune T5 for conditional query generation → use the DP model to generate synthetic queries for each document → train the dual encoder non-privately on the synthetic data.
The overall idea is to place privacy protection before retrieval system training: first use a DP fine-tuned language model to generate synthetic queries representing the original query distribution, then exploit the post-processing property of DP to train the downstream dual encoder on the synthetic data in a standard non-private way, thereby bypassing the problem that in-batch softmax loss is not decomposable per example.
Problem setting and formalization
- Retrieval model: The dual encoder encodes queries and documents into dense vectors respectively, trained with in-batch softmax loss: Li = −log (esim(qi, di))/(∑j ∈ B esim(qi, dj)), where sim is cosine similarity and other documents in the batch serve as negatives.
- Privacy definition: (ε, δ)-DP is adopted, with neighboring datasets defined as differing in exactly one query (query-level privacy); the post-processing property of DP is relied upon to ensure downstream training introduces no additional privacy loss.
Step 1: DP fine-tune the LM for conditional query generation
- Select a public pretrained LM (T5) not pretrained on the original queries, and fine-tune it with DP-Adafactor (Adafactor receiving gradients clipped and noised in the DP-SGD manner).
- Task definition: Given training pairs (q, d), fine-tune the LM so that when the input text is "d" it generates the target text "q".
- The authors mention that for large models with billions of parameters, parameter-efficient fine-tuning techniques can be used to reduce cost, but their impact on synthetic data quality is left for future research.
Step 2: Generate synthetic queries with the DP LM
- For each document d, input "generate_query: d" to the model to generate a matching synthetic query q̃; multiple synthetic queries can be generated per document.
- Synthetic training set = pairs of original documents with their corresponding synthetic queries.
Step 3: Train the dual encoder on synthetic data
- Synthetic data can be safely shared, and subsequent training no longer consumes the privacy budget of the original queries (post-processing property).
- Train the dual encoder on synthetic data with in-batch softmax loss using standard non-private methods.
Key implementation parameters
- Synthetic data generation: T5 {Small, Base, Large, XL} (about 60M / 220M / 770M / 3B parameters), ε ∈ {3, 8, 16, ∞}; trained for 30 epochs, batch size 1024, input token length 384, target 128; DP-Adam, learning rate 0.001, clip norm 0.1; δ = 1/2n (n is the training set size); sampling uses nucleus sampling, p = 0.8. Hyperparameters come from a grid search on T5-Small with validation set BLEU as the criterion (Table 1).
- Downstream retrieval model: Both query and document encoders are pretrained T5-Base encoders, sharing parameters; learning rate 0.001, batch size 32, epochs 5; the direct DP training baseline has clip norm 0.1, with batch size reduced to 32 due to memory limits.
- Pretraining data overlap analysis: The authors sampled multiple rounds of 10,000 query-text pairs and found that on average about 22% of MSMARCO documents have an exact match in C4 (T5's pretraining data), but exact matches for queries average <1.9%, and the matched queries are mostly generic search terms that can be regarded as public knowledge; the authors consider this overlap level acceptable for query-level privacy.
What experiments did the paper conduct?
On MSMARCO, NDCG@10 of synthetic data at ε=3 is 0.1830, far higher than direct DP training's 0.0234; BEIR zero-shot is close to the non-private baseline; in the canary experiment, leakage rate at ε=16 is 0%.
Experimental setup
- Models under test: The downstream retrieval model is a dual encoder, with both query/document encoders using pretrained T5-Base and sharing parameters; one retrieval model is trained per data source (original data, synthetic data at each ε and each model size).
- Synthetic data generation models: T5 {Small, Base, Large, XL}, ε ∈ {3, 8, 16, ∞}, DP fine-tuned on the MSMARCO training set.
- Datasets: MSMARCO (about 533,000 query-document pairs, from Bing search logs) for fine-tuning and testing; 11 datasets in the BEIR suite for zero-shot evaluation.
- Baselines: Dual encoder trained directly with DP on the original data (ε ∈ {3, 8, 16}, batch size 32); reference is non-private training on the original data (ε=∞).
- Metrics: NDCG@10 (measures ranking quality and position) and Recall@10 (the proportion of ground truth appearing in the top 10 predictions); retrieval uses the ScaNN library with brute force scoring and inner product distance.
- Number of repetitions: Retrieval evaluation reports results from a single training run; canary experiments are repeated multiple times with different canaries and DP settings and averaged.
Main results
MSMARCO test set (according to Table 3, Table 4):
Swipe horizontally to read the table
Training data ε NDCG@10 Recall@10 Original (non-private reference) ∞ 0.2525 0.4098 T5-Base synthetic ∞ 0.2590 0.4192 T5-Base synthetic 16 0.2027 0.3342 T5-Base synthetic 8 0.1912 0.3196 T5-Base synthetic 3 0.1830 0.3108 T5-XL synthetic 3 0.1854 0.3098 T5-Small synthetic 3 0.1346 0.2272 Original direct DP training 3 0.0234 0.0388 - The authors state that retrieval models trained on DP synthetic data outperform direct DP training in retrieval quality: at ε=3, NDCG@10 is 0.1830 vs. 0.0234 (Table 3, 4). The authors attribute the poor performance of direct DP training to the difficulty of DP training with contrastive loss discussed in Section 3.3.2.
- The authors report that models trained on non-private synthetic data (ε=∞) even outperform non-private training on the original data (0.2590 vs. 0.2525); the authors believe synthetic data enhances the original data by introducing public information or data cleaning.
- The authors observe that performance improves with increasing generator model size, and cite prior work stating this is consistent with the finding that "DP-SGD performs better on overparameterized models." Note that in Table 3 at ε=3, the NDCG@10 of T5-XL (0.1854) and T5-Large (0.1833) are both only slightly higher than T5-Base (0.1830), while Recall@10 is slightly lower.
Zero-shot generalization (BEIR)
- What was measured: Zero-shot evaluation on 11 datasets in BEIR, comparing three retrieval models: non-private training on original data (ε=∞), direct DP training on original data (ε=16), and T5-Base synthetic data (ε=16) (Table 5).
- Results: Synthetic data (ε=16) is close to the non-private baseline on most datasets, and exceeds it on some; for example, on arguana NDCG@10 is 0.2757, higher than the non-private baseline's 0.2653; on covid it is 0.4351, lower than the baseline's 0.4971. Direct DP training (ε=16) is clearly lower on all datasets (e.g., dbpedia only 0.1272).
- Authors' interpretation: The authors believe that on zero-shot generalization tasks, the benefits of synthetic data generation can offset the utility loss of DP training at a reasonable privacy level.
Similarity between synthetic and original data
- What was measured: BLEU and MAUVE scores computed between synthetic data generated by DP fine-tuned T5 and the original data (Table 6).
- Results: T5-Base non-private (ε=∞) gives BLEU 0.2939, MAUVE 0.9763; at ε=3 this drops to BLEU 0.0856, MAUVE 0.2974. Fixing ε=3 and increasing model size: T5-Small BLEU 0.0436, T5-Large 0.1096, T5-XL MAUVE reaches 0.7117.
- Authors' interpretation: Similarity increases with ε and model size; however, the authors observe that when larger models bring large improvements in similarity, the improvement in downstream retrieval performance is relatively modest.
Empirical privacy (canary exposure)
- What was measured: Three types of canaries containing random 10-digit number strings (the secret part being the number string) were injected into the training data, LMs were trained with different DP settings and synthetic data generated, and canary exposure was measured (Table 7), averaged over multiple repetitions.
- Results: Without DP (ε=∞), the canary leakage rate is 67% for 10 repetitions and 100% for 100 repetitions; at ε=16, the leakage rate is 0% for both repetition counts, with rank rising from 1/100 to 43/100 (10 repetitions) and 32/100 (100 repetitions).
- Authors' interpretation: The authors state that training without DP leads to leakage, whereas the ε=16 method prevents secret leakage; using the conversion technique of Stock et al. (2022), these ranks can be interpreted as an empirical lower bound of roughly 0.015 for ε, which the authors state is consistent with prior findings on the empirical privacy of DP-SGD on LMs.
Other ablations and analyses
- Pretraining data overlap: Over multiple rounds of sampling 10,000 pairs, on average about 22% of MSMARCO documents have an exact match in C4, and <1.9% of queries (Section 5.2.3).
- Model size ablation: Fixing ε=3, T5-Small's NDCG@10 is 0.1346, lower than T5-Base's 0.1830 (Table 3).
- Qualitative example: Table 2 gives an example of synthetic queries generated for one document under different ε and model sizes, showing that at ε=3 some queries are incoherent.
What are some points that can be further explored?
The authors list four limitations: large model training cost, pretraining data restrictions, incoherent queries, and query-level privacy only; the experiments cover only T5 and MSMARCO/BEIR.
Limitations and future directions noted by the authors
- Large model training cost (Limitations in the Conclusion): Larger LMs generate higher-quality synthetic queries, but training these large models may be computationally too expensive; the authors propose exploring parameter-efficient fine-tuning methods for DP training to reduce the computational burden of training large models.
- Limited choice of pretrained LM (Limitations): The public pretrained LM used to generate synthetic queries must not have been pretrained on the original queries to be privatized, which limits the choice of pretrained models.
- Incoherent queries (Limitations): As shown in the example in Table 2, DP fine-tuned LMs sometimes generate incoherent queries, which may limit the relevance and interpretability of the data.
- Query-level privacy only (Limitations): The method guarantees only query-level privacy; achieving more general example-level privacy may require other methods or more conventional DP training.
- Impact of parameter-efficient DP fine-tuning (Section 4): The impact of parameter-efficient DP fine-tuning on the quality of synthetic retrieval data is explicitly left by the authors for future work.
Scope of experiments
- The retrieval model tested has only one architecture: a dual encoder (T5-Base encoder, shared parameters); the authors explicitly state that they did not experiment with other downstream retrieval models, because the intent was to compare general DP-guaranteeing methods (Section 5.3.2).
- The synthetic data generation models cover only four sizes in the T5 family (Small/Base/Large/XL), with ε ∈ {3, 8, 16, ∞}.
- The evaluation datasets are the MSMARCO test set and 11 datasets in the BEIR suite (zero-shot); retrieval evaluations report results from a single training run, and the paper does not report the mean or variance over multiple runs.
- Empirical privacy is measured only with canary exposure, with ε at two settings, ∞ and 16 (Table 7); the paper does not report membership inference or data extraction attacks against the downstream retrieval model itself.
- The paper does not report specific time or computational cost figures for training/generation, stating only in Limitations that large model training may be too expensive.
Summarize the main content of the paper
Fine-tuning T5 with DP to generate synthetic queries for training a deep retrieval system preserves query-level DP while achieving retrieval quality far higher than direct DP training.
A defense-type work on privacy-preserving deep retrieval: before training the retrieval system, user queries are protected with differential privacy, bypassing the problem that contrastive loss is difficult to train directly with DP.
- Problem to solve: Deep retrieval systems are trained with an in-batch softmax contrastive loss; the loss cannot be decomposed per sample, the sensitivity of DP-SGD grows with batch size, memory overhead is large, and direct DP training has poor utility; meanwhile queries contain users' personal information, requiring query-level privacy guarantees.
- Method highlights: Fine-tune a publicly pretrained T5 on MSMARCO with DP-Adafactor (ε ∈ {3, 8, 16, ∞}) so that it generates synthetic queries from documents; then use "synthetic queries + original documents" to train a dual-encoder retrieval model in a standard non-private way, relying on the post-processing property of DP to maintain query-level privacy.
- Main results (MSMARCO, Table 3/4): At ε=3, NDCG@10 for T5-Base trained on synthetic data is 0.1830, versus only 0.0234 for direct DP training; non-private synthetic data (0.2590) is even slightly higher than non-private training on the original data (0.2525).
- Zero-shot generalization (BEIR, Table 5): Synthetic data at ε=16 is mostly close to the non-private baseline on 11 datasets, and exceeds it on some (e.g., arguana NDCG@10 0.2757 vs. 0.2653), all higher than direct DP training.
- Empirical privacy (Table 7): With canaries repeated 100 times, the leakage rate is 100% without DP and 0% at ε=16; the authors state that the converted empirical ε lower bound is about 0.015.
- Authors' conclusions and implications: The authors believe this work improves retrieval quality while maintaining query-level DP, demonstrating the potential of using LMs to overcome the limitations of DP training; they also acknowledge limitations such as the method guaranteeing only query-level privacy, the high training cost of large models, and the DP model generating incoherent queries.