Just Fine-tune Twice: Selective Differential Privacy for Large Language Models
Weiyan Shi, Ryan Shea, Si Chen, Chiyuan Zhang, Ruoxi Jia, Zhou Yu
Abstract
Protecting large language models from privacy leakage is becoming increasingly crucial with their wide adoption in real-world products. Yet applying differential privacy (DP), a canonical notion with provable privacy guarantees for machine learning models, to those models remains challenging due to the trade-off between model utility and privacy loss. Utilizing the fact that sensitive information in language data tends to be sparse, Shi et al. (2021) formalized a DP notion extension called Selective Differential Privacy (SDP) to protect only the sensitive tokens defined by a policy function. However, their algorithm only works for RNN-based models. In this paper, we develop a novel framework, Just Fine-tune Twice (JFT), that achieves SDP for state-of-the-art large transformer-based models. Our method is easy to implement: it first fine-tunes the model with redacted in-domain data, and then fine-tunes it again with the original in-domain data using a private training mechanism. Furthermore, we study the scenario of imperfect implementation of policy functions that misses sensitive tokens and develop systematic methods to handle it. Experiments show that our method achieves strong utility compared to previous baselines. We also analyze the SDP privacy guarantee empirically with the canary insertion attack.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Cited by top-tier papers11
- Be like a Goldfish, Don't Memorize! Mitigating Memorization in Generative LLMsAbhimanyu Hans, John Kirchenbauer, Yuxin Wen, Neel Jain et al.NeurIPS 2024 · 65 citations
- SeqPATE: Differentially Private Text Generation via Knowledge DistillationZhiliang Tian, Yingxiu Zhao, Ziyue Huang, Yu-Xiang Wang et al.NeurIPS 2022 · 29 citations
- A New Linear Scaling Rule for Private Adaptive Hyperparameter OptimizationAshwinee Panda, Xinyu Tang, Saeed Mahloujifar, Vikash Sehwag et al.ICML 2024 · 15 citations
- Information Flow Control in Machine Learning through Modular Model ArchitectureTrishita Tiwari, Suchin Gururangan, Chuan Guo, Weizhe Hua et al.USENIX Security 2024 · 12 citations
- PrivLM-Bench: A Multi-level Privacy Evaluation Benchmark for Language ModelsHaoran Li, Dadi Guo, Donghao Li, Wei Fan et al.ACL 2024 · 9 citations
Builds on8
- Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan et al.CCS 2016 · 7,620 citations
- The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural NetworksNicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos et al.USENIX Security 2019 · 1,386 citations
- Large Language Models Can Be Strong Differentially Private LearnersXuechen Li, Florian Tramèr, Percy Liang, Tatsunori HashimotoICLR 2022 · 502 citations
- Differentially Private Fine-tuning of Language ModelsDa Yu, Saurabh Naik, Arturs Backurs, Sivakanth Gopi et al.ICLR 2022 · 494 citations
- Differentially Private Learning Needs Better Features (or Much More Data)Florian Tramèr, Dan BonehICLR 2021 · 325 citations
Related papers
- Differentially Private Subspace Fine-Tuning for Large Language ModelsLele Zheng, Xiang Wang, Tao Zhang, Yang Cao et al.AAAI 2026
- Synthetic Text Generation with Differential Privacy: A Simple and Practical RecipeXiang Yue, Huseyin A. Inan, Xuechen Li, Girish Kumar et al.ACL 2023 · 24 citations
- PrivCode++: Latent-Conditioned Differentially Private Code Generation for Comprehensive GuaranteesZheng Liu, Chen GONG, Terry Yue Zhuo, Zhou Yang et al.ICML 2026
- Large Language Models Can Be Contextual Privacy Protection LearnersYijia Xiao, Yiqiao Jin, Yushi Bai, Yue Wu et al.EMNLP 2024 · 18 citations
- PrivTune: Efficient and Privacy-Preserving Fine-Tuning of Large Language Models via Device-Cloud CollaborationYi Liu, Weixiang Han, Chengjun Cai, Xingliang Yuan et al.INFOCOM 2026 · 2 citations
