DIFFERENTIALLY PRIVATE FINE-TUNING OF LANGUAGE MODELS
Year: 2021

Abstract:
We give simpler, sparser, and faster algorithms for differentially private finetuning of large-scale pre-trained language models, which achieve the state-ofthe-art privacy versus utility tradeoffs on many standard NLP tasks. We propose a meta-framework for this problem, inspired by the recent success of highly parameter-efficient methods for fine-tuning. Our experiments show that differentially private adaptations of these approaches outperform previous private algorithms in three important dimensions: utility, privacy, and the computational and memory cost of private training. On many commonly studied datasets, the utility of private models approaches that of non-private models. For example, on the MNLI dataset we achieve an accuracy of 87.8% using RoBERTa-Large and 83.5% using RoBERTa-Base with a privacy budget of ε = 6.7. In comparison, absent privacy constraints, RoBERTa-Large achieves an accuracy of 90.2%. Our findings are similar for natural language generation when privately fine-tuning GPT-2. Our experiments also show that larger models are better suited for private fine-tuning: while they are well known to achieve superior accuracy non-privately, we find that they also better maintain their accuracy when privacy is introduced.

heading: 1 INTRODUCTION
text: Deep learning models are well known to leak sensitive information about the dataset when trained using conventional methods (Shokri et al., 2017; Carlini et al., 2019; 2021). To combat this issue, models can instead be trained to guarantee differential privacy (DP) (Dwork et al., 2006b), a strong notion of data privacy which limits the influence of any individual training point on the final model. While DP is one of the few approaches capable of providing machine learning models with rigorous privacy guarantees, it generally comes at a cost in terms of test accuracy. One oft-cited explanation is that the constraint of DP necessitates much more training data (Tramèr & Boneh, 2021; Feldman, 2020; Brown et al., 2021). Unfortunately, more training data may be hard to acquire, particularly in settings where privacy is a concern.
Parallel to these developments, Transformer-based (Vaswani et al., 2017) large language models (LLMs), including the BERT (Devlin et al., 2019; Liu et al., 2019) and GPT (Radford et al., 2018; 2019; Brown et al., 2020) families, have enabled significant progress in natural language processing, achieving state-of-the-art accuracy in almost every task considered. These models are first pre-trained on an extremely large and diverse public dataset. The weights are then fine-tuned for each task of interest using a much smaller task-specific dataset. For example, a single pre-trained GPT-family model may be fine-tuned for various downstream tasks, such as email reply suggestion, sentence completion in text editors, language translation, and more. This two-stage paradigm can naturally be adapted to solve tasks in private learning, automatically addressing the aforementioned data shortage issue via the massive scale of the public pre-training dataset. One may pre-train the model on public data as usual,1 but then fine-tune the model privately.
Despite the success of these models, task-specific fine-tuning introduces a number of technical challenges. In the non-private setting, the immense size of LLMs makes it impractical to fine-tune the
1Despite the fact that the pre-training data is public, there may nonetheless be privacy concerns related to personal or copyrighted data. However, since these pre-trained models have already been released, any associated privacy loss has already been incurred.
full model and store a separate copy of the parameters for hundreds of downstream tasks. Things only get worse with privacy, which leads to overheads in terms of running time, memory usage, and most importantly, accuracy. The magnitude of noise introduced to a model due to DP grows as the model size increases (Bassily et al., 2014; Abadi et al., 2016; Bun et al., 2014), which can overwhelm any signal for larger models. A recent line of work in the non-private literature has proposed parameter-efficient methods to alleviate the issues of storage and computational cost for fine-tuning (Houlsby et al., 2019; Li & Liang, 2021; Aghajanyan et al., 2020; Hu et al., 2021; Mahabadi et al., 2021). The main focus of our work is to explore parameter-efficiency in the context of private learning.

heading: 1.1 OUR CONTRIBUTIONS
text: Our primary contribution is to show that advanced parameter-efficient methods can lead to simpler and significantly improved algorithms for private fine-tuning. Our framework is illustrated in Figure 1. Our findings and contributions are summarized as follows:
State-of-the-art utility and privacy. Empirical evaluation of our algorithms reveals that they achieve state-of-the-art accuracy versus privacy tradeoffs, improving upon the previous best (Yu et al., 2021b). More importantly, for many fine-tuning tasks, the utility of models trained with DP approaches that of non-private models. For example, privately fine-tuning RoBERTa-Large on the MNLI data set (Williams et al., 2018), we achieve an accuracy of 87.8% with a privacy budget of (ε = 6.7, δ = 1e-6). Without privacy guarantees, RoBERTa-Large achieves an accuracy of 90.2% (GPT-3 is known to achieve 91.7% (Hu et al., 2021)); see Table 1 for a summary. We also explore private natural language generation tasks, fine-tuning GPT-2 models on the E2E dataset (Novikova et al., 2017). Again, the utility approaches non-private levels: we achieve a ROUGE-L score of 0.6755 with GPT-2-Large and (ε = 5.4, δ = 1e-5), compared to 0.72 without privacy.
Larger models are better. Prior work has consistently shown that larger language models achieve better accuracy for downstream tasks. Our results give evidence that this phenomenon extends to the private setting. For example, on the MNLI dataset, RoBERTa-Base achieves an accuracy of 83.5% whereas RoBERTa-Large achieves an accuracy of 87.8%, both under a privacy budget of (ε = 6.7, δ = 1e-6). Similarly, privately fine-tuning with E2E, GPT-2-Small, GPT-2-Medium, and GPT-2-Large achieve ROUGE-L scores of 0.6219, 0.6645 and 0.6755 respectively, all under a privacy budget of (ε = 5.4, δ = 1e-5). While established in the non-private setting, we find this phenomenon quite surprising under DP. There is often a tension when choosing private model architectures: larger models may have higher capacity, but necessitate the introduction of more noise. Consequently, smaller and simpler private models achieve the better accuracy in several settings (Papernot et al., 2019; Tramèr & Boneh, 2021). In contrast, our experiments show that fine-tuning the biggest models achieves the best accuracy.2
Simpler, sparser, and faster. Beyond accuracy concerns, DP requirements also lead to significant overheads in terms of computation and memory usage. The large number of parameters contributes to the high cost of training LLMs, and things get worse under privacy, which has been documented to increase training time by up to two orders of magnitude (Carlini et al., 2019; Subramani et al., 2021). The parameter-efficient approaches we employ partially offset this issue: as we only update a small fraction of the total number of parameters, training becomes considerably more computationally and memory efficient. Furthermore, as in the non-private setting, this framework leads to a modular design, where a single large pre-trained model can be augmented with lightweight modifications for each individual downstream task.
To the best of our knowledge, we are the first to fine-tune GPT-2-Large using differential privacy, the largest model trained thus far using DP. Given our state-of-the-art results for a variety of standard NLP tasks using advanced fine-tuning techniques, we believe that our paper will serve as a benchmark for further work in this direction. For example, the best average accuracy achieved by the prior work of Yu et al. (2021b) on four standard NLP tasks in Table 1 is 83.9% using ε = 8 (and the same δ as in Table 1), whereas we can achieve an average accuracy of 90.3% using ε = 6.7 by a combination of better algorithms, larger models, and new privacy accounting techniques.
Finally, though recently considered elsewhere (see Section 5), we put further focus on the framing of public pre-training and private fine-tuning as an important conceptual direction in DP deep learning.

heading: 2 PRELIMINARIES AND PRIOR ALGORITHM BASELINES
text: Recall the formal definition of differential privacy.
Definition 2.1 (Differential Privacy (DP) (Dwork et al., 2006b;a)). A randomized algorithm A is (ε,δ)-differentially private if for any two neighboring datasets D and D′, which differ in exactly the data pertaining to a single user, and for all sets S of possible outputs: Pr[A(D) ∈ S] ≤ eε Pr[A(D′) ∈ S] + δ.
We review prior techniques for private fine-tuning.

heading: 2.1 FULL FINE-TUNING VIA DPSGD
text: To train a machine learning model with privacy, the most popular algorithm is the celebrated DP stochastic gradient descent (DPSGD) (Song et al., 2013; Bassily et al., 2014; Abadi et al., 2016). This optimization method serves as a drop-in replacement for SGD, augmenting it with the addition of per-example gradient clipping and Gaussian noise addition steps. These two steps serve to limit and mask the contribution of a single example. Two key points to note are that a) per-example gradient clipping incurs significant computational and memory overheads in most implementations, and b) noise introduced due to privacy grows as the square-root as the number of model parameters. With this tool in place, the most basic fine-tuning strategy is to train all parameters using DPSGD.
2An alternative perspective is that what we currently think of as “large” language models are relatively small, and we are yet to reach the point where the benefits of model size on accuracy are outweighed by the drawbacks.

heading: 2.2 REPARAMETRIZED GRADIENT PERTURBATION
text: To mitigate the limitations of DPSGD, a recent work of Yu et al. (2021b) introduced an elegant method called reparametrized gradient perturbation (RGP). RGP exploits the implicit low-rank structure in the gradient updates of SGD to substantially improve upon DPSGD. Specifically, they reparametrize each layer’s weight matrix W into LR + W̃ , where L and R are low-rank gradientcarrier matrices and W̃ is the residual weight. The authors show that one can obtain a lowdimensional projection of W ’s gradient by taking gradients only of the low-rank matrices L and R (and not the high-rank W̃ ). Privacy is introduced by clipping and noising these low-dimensional gradients of L andR. While this low-dimensional projection loses some of the signal inW ’s gradient, it turns out to contain enough to still achieve high accuracy. At the same time, the low-dimensional gradients alleviate the aforementioned issues related to privatization, significantly reducing the memory consumption and noise introduced.

heading: 3 OUR APPROACH

heading: 3.1 A META-FRAMEWORK
text: We introduce our approach as a meta-framework for private deep learning, which abstracts the key principles of recent fine-tuning methods.
Suppose f(WPT;x) is a pre-trained model where WPT are the pre-trained weights and x is any input. We create a new fine-tuning model
fFT(WPT, θ;x) (1)
which incorporates additional trainable parameters θ, where dim(θ) dim(WPT). That is, the number of new parameters in θ is a small fraction of the original number of parameters in the pretrained weights WPT. Fine-tuning is done by running DPSGD on the additional parameters θ, while freezing the weights of pre-trained model WPT. The new parameters are initialized to θ0 such that
fFT(WPT, θ0;x) = f(WPT;x). (2)
The initialization condition (2) is very important, as it ensures that fine-tuning starts at the pre-trained model and improves it by modifying the parameters θ. Most fine-tuning methods are additive and have the following special form:
fFT(WPT, θ;x) = f(WPT + π(θ);x), (3)
i.e., they modify the pre-trained weights by adding a correction term π(θ) parametrized by θ.
Recent work in the non-private literature has described concrete instantiations of this framework (Houlsby et al., 2019; Mahabadi et al., 2021; Hu et al., 2021), which (crucially) are effective when dim(θ) dim(WPT). In the non-private setting, such reparametrizations are useful for reducing the computation and memory required for fine-tuning, and enable lightweight and plug-in modifications to the base model for different downstream tasks. At the same time, they maintain (or sometimes surpass) the accuracy achieved by full fine-tuning. However, this approach seems to be more important for achieving high accuracy in the context of private fine-tuning. For instance, full fine-tuning of RoBERTa-Base with DPSGD achieves an accuracy of 53.1% for the MNLI dataset (Yu et al., 2021b), whereas all the algorithms that fine-tune based on Equation (1) all achieve accuracy better than 80%.
We give some intuition as to why parameter-efficient methods seem to be more effective for private fine-tuning. For simplicity, we assume that the fine-tuning method is additive as in (3), such that the fine-tuned weights WFT = WPT + π(θ). We can imagine that WFT lies on a manifold passing through WPT of very small dimension (equal to the dimension of θ) compared to the dimension of WPT. Even if the parameters θ are very noisy due to the noise added during DPSGD, we will always stay in this manifold. In particular, we are not disturbing the pre-trained weights in most directions (those orthogonal to the manifold near WPT). If we run DPSGD on all the weights instead, then we add noise in all directions, thus potentially unlearning the knowledge learned during pre-training, especially in low data regimes.
Besides substantial gains in the accuracy, the above method of reparametrization has several other advantages:
• A single pre-trained model such as BERT or GPT is generally applied to hundreds of downstream tasks via fine-tuning. Private fine-tuning using previous methods requires updating all parameters and storing a different copy of the fine-tuned model per task. This creates substantial overheads for storing and deploying, and can be very expensive in practice. On the other hand, the reparametrization (1) means that we only need to store a single pretrained model that can be shared across many downstream tasks. Each downstream task requires only a small number of new parameters that can be plugged in.
• Differentially private training requires computing and storing per-example gradients, which increases the memory footprint. In our approach, however, learning is done in a much lower dimension, hence saving on the memory cost as compared to prior works.
• Finally, we expect that (1) also gives a more communication-efficient method of fine-tuning in distributed settings such as federated learning, due to the significantly smaller number of parameters learned during fine-tuning.

heading: 3.2 INSTANTIATING THE META-FRAMEWORK
text: In this section, we discuss a few ways to instantiate our meta-framework. This list is non-exhaustive, but covers the methods we employ in our experiments.

heading: 3.2.1 FINE-TUNING VIA LOW-RANK ADAPTATION
text: Low-Rank Adaptation (LoRA) (Hu et al., 2021) is an additive fine-tuning scheme as defined in (3). For each dense weight matrix W iPT of size a × b in the pre-trained network, we add a low-rank correction term LiRi, i.e.,
W i = W iPT + L iRi, (4)
where Li ∈ Ra×r, Ri ∈ Rr×b are new trainable parameters. Hu et al. (2021) apply this reparameterization only to the Transformer attention weights (Wq,Wv), and freeze all other weights (e.g., Wk and Wo and those in the feed-forward layers). The rank r is typically chosen to be small, e.g., r = 4, 16, 64. Since most parameters in Transformer architectures are dense weight matrices, choosing a small r results in a nearly square-root reduction in the number of parameters.

heading: 3.2.2 FINE-TUNING VIA ADAPTERS
text: Houlsby et al. (2019) propose adapter-based fine-tuning, in which we modify the architecture of the pre-trained model by adding new “adapter” layers after each attention and feed-forward layer. Adapter layers are bottleneck layers with residual connections. Specifically, given an input x, an adapter layer A performs A(x) = U(τ(D(x))) + x, (5) where U is an up-projection affine linear map, D is a down-projection affine linear map, and τ is a non-linear activation function such as the Gaussian error Linear Unit (GeLU) (Hendrycks & Gimpel, 2016). If x has dimension d, then U ∈ Rd×r, D ∈ Rr×d for some r d. Thus, the number of introduced parameters is significantly less than the number of parameters in the pre-trained model. When fine-tuning, the parameters of the original model are frozen, and only parameters of the adapter layers, as well as layer normalizations, are modified. Note that fine-tuning with adapters is not an additive fine-tuning framework as in (3), but is captured by the broader framework in (1).

heading: 3.2.3 FINE-TUNING VIA COMPACTER
text: The recent work of Mahabadi et al. (2021) introduces Compacters (Compact adapters), a method which further improves the parameter efficiency of adapters. This is done by replacing the dense matrices in the up-projection U and down-projection D by tensor products of smaller matrices, thus reducing the number of trainable parameters. Specifically, they replace the dense matrix M` in the adapter layer ` by a low-rank parameterized hypercomplex multiplication (LPHM) layer, i.e., each dense matrix M` ∈ Ra×b is expressed as
M` = n∑ i=1 Ai ⊗ ( S`iT ` i ) (6)
where Ai ∈ Rn×n, S`i ∈ Ra/n×k, T `i ∈ Rk×b/n and ⊗ is the matrix Kronecker product. Note the matrices Ai are not indexed by the layer ` because these matrices are shared among all the adapter layers. Since each adapter layers has two dense matrices (one for up-projection and one for down-projection), if there are L adapter layers, this reduces the number of parameters from L(2ab) to L(2(a + b)k) + n3. In practice, a and b are chosen to be either the model dimension d or the intermediate representation dimension r in the adapters, n is typically chosen to be a small constant such as n = 2, 4, 8, 12 and k is chosen to be 1.

heading: 3.2.4 WHY DOES PARAMETER-EFFICIENT TUNING WORK?
text: Theoretical explanation of success of parameter-efficient fine-tuning methods is active area of research in deep learning. Indeed, since trends have consistently shown that model accuracy increases with size, how can one achieve competitive accuracy while fine-tuning less than 1% of the parameters? One popular hypothesis is intrinsic dimensionality (Li et al., 2018), which posits that the minimum number of parameters needed to train a machine learning model may be much less than the total number of model parameters. Aghajanyan et al. (2020) explore this hypothesis in the context of fine-tuning LLMs, showing that one can achieve most of their accuracy by training only a very small number of parameters (chosen via a random projection). Perhaps surprisingly, they find that as the model size increases, intrinsic dimension decreases, in the limit exhibiting zero-shot learning. While we did not explore this hypothesis in the context of DP due to computational restrictions, we believe it may be an interesting lens through which one can understand the effectiveness of private parameter-efficient fine-tuning.

heading: 3.3 COMPARISION WITH BASELINE ALGORITHMS
text: We highlight some key algorithmic differences between our proposed methods and the baselines of full fine-tuning and RGP.
• DPSGD and RGP both require updating all parameters of the pre-trained model, whereas our proposed methods update only a tiny fraction (between 0.05% and 1%). The rightmost columns of Tables 3 and 4 list the number of parameters trained by these algorithms.
• RGP performs a low-rank decomposition of weight matrices which is very similar to LoRA, though there are subtle differences. Recall that in RGP, at the beginning of each iteration t, the historical weight matrix Wt−1 is decomposed to find a low-rank product LR. The gradients computed on L and R are then projected back to the full parameter space to perform the descent step. Hence, RGP does not keep the pre-trained weights frozen during the learning process. LoRA can be viewed as a simplification of RGP. LoRA reparametrizesWFT := WPT +LR, where the pre-trained weight matrix WPT is frozen during training. Hence, compared to RGP, LoRA eliminates the decomposition and the projection to the full parameter space at each iteration, simplifying the implementation and reducing the running time and memory cost. This is summarized in Table 2. We observe that DP LoRA reduces the memory cost by about 33% and the training speed by 8%. As we will see, this simplification also results in improved utility.
• Neither full fine-tuning nor RGP fall into our meta-framework described by (1). Thus, if a pre-trained model is to be applied to several downstream tasks, one must store a separate set of weights for each task, incurring a significant memory cost and losing the plug-in functionality. In contrast, our methods are much more lightweight.

heading: 4 EXPERIMENTS
text: We experimentally evaluate our methods for DP fine-tuning to demonstrate their utility, privacy, and parameter-efficiency. We investigate both language understanding and text generation tasks, using RoBERTa and GPT-2 models, to establish that our techniques are applicable to a variety of tasks and model architectures. Code for reproducibility, as well as additional experimental results, will be released within the following weeks at https://github.com/AnonymousAKES/ Differentially-Private-Fine-tuning-of-Language-Models.

heading: 4.1 FINE-TUNING FOR LANGUAGE UNDERSTANDING TASKS
text: We first compare our methods with state-of-the-art fine-tuning algorithms using models from the BERT family, which was used in the prior work (Yu et al., 2021b). Specifically, we use RoBERTa models (Liu et al., 2019),3 which are pre-trained on public data collected from the web. RoBERTaBase has 125M parameters and RoBERTa-Large has 355M parameters. We fine-tune the pre-trained models on four tasks: MNLI, QQP, QNLI and SST-2 from the GLUE benchmark (Wang et al., 2018), following Yu et al. (2021b).
Implementation Details: For fine-tuning with adapters, we may choose the intermediate representation dimension r, shared across all adapter layers. Similarly, for fine-tuning with Compacter, we can choose both r and the Kronecker product kernel dimension n in (6). For LoRA fine-tuning, we add bottleneck branches for both the attention layers and the feedforward layers, which differs slightly from the addition of bottleneck branches for only the Wq and Wv matrices of the attention layers as done by Hu et al. (2021). Given the same bottleneck representation dimension r in (4), our new implementation uses twice as many trainable parameters as the original paper, and achieves some improvements for learning with DP. We perform privacy accounting using the approach of Gopi et al. (2021), which currently gives the tightest bounds.
3The model can be found at https://github.com/pytorch/fairseq/tree/master/ examples/roberta.
4We report RoBERTa-Base numbers from https://github.com/dayu11/ Differentially-Private-Deep-Learning, by the authors of Yu et al. (2021b). Though the paper itself only reports results on BERT-Base, we cite their paper to also reference the RoBERTa numbers.
Hyperparameter choice: Given the large number of hyperparameter choices, e.g., the intermediate representation dimension, learning rate, weight decay, privacy delta, and model size, an exhaustive grid search over all hyperparameters is expensive, due to the model sizes. Our hyperparameter choices are informed by prior work and are as follows. For privacy parameters, we use δ = 1e-5 for SST-2 and QNLI and δ = 1e-6 for QQP and MNLI due to their dataset sizes, and use noise multipliers 0.92, 0.83, 0.66 and 0.65 for SST-2, QNLI, QQP and MNLI, respectively, which is the same as Yu et al. (2021b). The clipping threshold of per-example gradients is 10 for all methods. For adapters and Compacter, we follow suggestions in the original papers and choose r from a set {16, 48, 96} and n from a set {4, 8, 12}. For LoRA, we choose the best-performing rank r from the set {4, 16, 48, 64}. The best performing hyperparameters are noted in Tables 3 and 4. We use batch size 2000 and train for 20 epochs. We use the optimizer AdamW (Loshchilov & Hutter, 2019) with weight decay 1e-2 and search over four learning rates {5e-4, 1e-3, 2e-3, 5e-3}. Results: We report the prediction accuracy on four tasks in Tables 3 and 4. Our experiments using RoBERTa-Base serve as a direct comparison to the work of Yu et al. (2021b) who only trained the base model, whereas RoBERTa-Large experiments demonstrate the significance of using larger models. We could not report the numbers for full fine-tuning using DPSGD on RoBERTa-Large due to running time and memory costs; see the discussion at the end of this section. We summarize our key findings:
• On all datasets, our methods achieve the best accuracy while training a only tiny fraction of parameters; larger models give significant improvements.
• Noticeable improvements in the privacy parameter ε versus Yu et al. (2021b) are primarily due to new privacy accountants based on Fourier-based numerical composition (Koskela et al., 2020; 2021; Gopi et al., 2021); we use the accountant in Gopi et al. (2021) since it is the most efficient.
• Private adapters provide the best average performance for RoBERTa-Base, whereas LoRA outperforms all other methods for RoBERTa-Large.
Remark: While our experiments indicate that full fine-tuning with DPSGD does not achieve competitive performance, there could be a choice of hyperparameters that can improve upon the reported numbers. A recent work (Anil et al., 2021) says that “mega” batch sizes (in the millions) helps DPSGD. Such experiments are costly for large models. The memory consumption of DPSGD requires that batch size on a single GPU is small for large language models; on the other hand, large batch size requires gradient accumulation and running for more epochs. All of this leads to substantial stretching of the training time. Moreover, our main message is that one does not need to fine-tune all parameters to achieve the best accuracy. Nevertheless, it is interesting and natural to wonder if full fine-tuning with DPSGD can match the accuracy of parameter-efficient methods for some choice of hyperparameters. A positive answer would imply that private and non-private finetuning conceptually mirror each other, whereas a negative answer would demonstrate that parameter efficiency is both necessary and sufficient for private fine-tuning.

heading: 4.2 FINE-TUNING FOR NATURAL LANGUAGE GENERATION (NLG)
text: Next, we study private fine-tuning for text generation problems using the GPT-2 series of models on the End-2-End (E2E) NLG challenge (Novikova et al., 2017), one of the primary benchmarks used in recent works on non-private fine-tuning (Hu et al., 2021; Li & Liang, 2021). We use GPT-2-Small (117M parameters), GPT-2-Medium (345M parameters), and GPT-2-Large (774M parameters).5 To the best of our knowledge, we are the first to privately fine-tune for E2E or fine-tune GPT-2-Large. The purpose of this section is not to evaluate various fine-tuning algorithms, but to show that private fine-tuning is competitive with non-private fine-tuning for text generation problems. Due to the high cost of training, we report experimental results only for fine-tuning (private and non-private) with LoRA. We think that all fine-tuning methods in this paper should achieve comparable accuracy.
E2E NLG challenge: The E2E dataset was introduced by Novikova et al. (2017), and contains template-like information in the restaurant domain to be mapped to natural language with end-toend training. The dataset consists of 42K training samples, 4.6K validation samples, and 4.6K test
5https://huggingface.co/transformers/model_doc/gpt2.html.
samples. We use standard metrics such as BLUE, ROUGE-L, etc., used in (Hu et al., 2021) for measuring the quality of predictions.
Hyperparameter choice: For LoRA, we choose the bottleneck rank r = 4 in (4) and fine-tune Wq and Wv matrices of the attention layers as in the original paper. We optimize using AdamW with learning rate 2e-4, weight decay 1e-2 and train our models for 5 epochs using batch size 64. We take the gradient clipping parameter to be 1.0 and the noise multiplier to be 0.5 for the accountant in Gopi et al. (2021), achieving ε = 5.4, δ =1e-5.
Results: The results of our experiments are summarized in the Table 5, which reiterate the main themes of this paper: private fine-tuning with a parameter-efficient approach performs close to their non-private counterparts and show consistent improvement in the utility as the model size increases.

heading: 5 RELATED WORK
text: More on DP learning: Some work studies private language models on more traditional architectures such as LSTMs (Hochreiter & Schmidhuber, 1997), either training with DPSGD (McMahan et al., 2018; Carlini et al., 2019) or related heuristics (Ramaswamy et al., 2020). Though pre-training on public data is suggested (McMahan et al., 2018), public data appears to only be used in one of these works for honest hyperparameter selection (Ramaswamy et al., 2020). A few more recent works consider training LLMs with DP. Anil et al. (2021) privately train BERT-Large from scratch, compared to our work which focuses on private fine-tuning. (Hoory et al., 2021; Basu et al., 2021) perform private full fine-tuning of BERT models. Hoory et al. (2021) achieve accuracy which is comparable to the non-private model, but additionally supplement the public pre-training data with additional domain-relevant material, while we use off-the-shelf pre-trained models. Basu et al. (2021) observe significant drops in utility, compared to our parameter-efficient methods which do not. While Kerrigan et al. (2020) consider public pre-training and private fine-tuning, their experiments are on much smaller architectures (i.e., feedforward networks with three hidden layers).
More on Fine-tuning: There exist other parameter-efficient tuning methods which we did not evaluate in our work. Some of these include random subspace projection (exploiting intrinsic dimensionality (Li et al., 2018; Aghajanyan et al., 2020)), prefix and prompt tuning (Li & Liang, 2021; Lester et al., 2021), tuning only biases (Cai et al., 2020; Ben Zaken et al., 2021), and other architecture variants including Adapters (Pfeiffer et al., 2021; Rücklé et al., 2020). An interesting direction for future work is to see whether parameter-efficient tuning approaches specifically designed for the private setting can achieve higher utility. We also mention zero-shot learning, in which no task-specific dataset is required and thus perfect privacy is achieved. Currently, zero-shot approaches achieve low utility compared to fine-tuning, though it is possible that future models may narrow this gap.

heading: 6 CONCLUSION
text: So far, DP deep learning has focused on training models from scratch. The spectacular success of transfer learning in real-world applications, however, shows that private fine-tuning is an equally pertinent problem to study and deserves more attention. We show that by combining recent advances in NLP, parameter-efficiency, privacy accounting, and using larger models, one can privately fine-tune models whose utility approaches that of non-private models. We hope our work inspires more study on the core problem of private fine-tuning, which we believe to be a central direction for research in private machine learning, leading to more interaction between the LLM and DP communities.

heading: A ADDITIONAL RELATED WORK
text: Our investigation fits more broadly into a line of work employing public data for private data analysis. Some works on image classification consider pre-training on a large public dataset and finetuning on a smaller private dataset (Abadi et al., 2016; Papernot et al., 2019; Tramèr & Boneh, 2021). One line of work uses unlabeled public data to train a student model (Papernot et al., 2017; 2018; Bassily et al., 2018). Another recent idea uses a small amount of public data to identify a lowerdimensional subspace of the gradients in which to perform private descent (Zhou et al., 2021; Yu et al., 2021a; Kairouz et al., 2021). Finally, other works (both theoretical and experimental) investigate the role of public data in private query release, synthetic data generation, and prediction (Ji & Elkan, 2013; Beimel et al., 2016; Alon et al., 2019; Nandi & Bassily, 2020; Bassily et al., 2020a;b; Liu et al., 2021).

heading: B EXPERIMENTS WITH DIFFERENT PRIVACY PARAMETERS
text: Now we test our framework under different privacy constraints. Specifically, we run LoRA on the language understanding tasks with various choices of privacy parameters ε and δ. We consider both RoBERTa-Base and RoBERTa-Large.
For the RoBERTa-Large model, we set ε = 1 and 3 with δ being the same as those in Section 4. We use the PRV accountant (Gopi et al., 2021). After getting the noise multipliers, we also reduce the value of δ and report the corresponding value of ε. The hyperparameters are the same as those in Section 4. We run experiments on all four tasks, i.e., MNLI (n ∼ 392k), QQP (n ∼ 364k), QNLI (n ∼ 104k), and SST-2 (n ∼ 67k). We report the results in Table 6. The performance of our framework is decent even with very tight privacy budgets. For instance, with ε < 2 and δ = 1/1000n, the accuracy gap between the non-private baseline is only 3.8 for MNLI and 2.1 for SST-2.
For the RoBERTa-Base model, we try various choices of ε. The values of ε are chosen from [0.1, 0.5, 1, 3, 5, 8, 12]. All other settings are the same as those in Section 4. We run experiments on the MNLI and SST-2 datasets. The results are presented in Figure 2. Our framework performs well for a wide range of ε. We note that our algorithm achieves meaningful accuracy even for very tight privacy parameters ε = 0.5 and 1. Such values of ε are rarely explored when training deep models with differential privacy.

heading: C ON THE INFLUENCE OF HYPERPARAMETERS
text: Here we demonstrate that our algorithms perform well for a wide range of hyperparameters. We study two hyperparameters that are directly related to the variance of noise: clipping threshold and batchsize. The clipping threshold is chosen from [0.1, 1.0, 3.0, 5.0, 10.0] and the batchsize is chosen
from [200, 500, 1000, 2000, 4000]. We note that we keep the number of updates the same as that in Section 4 when the batchsize is changed. We fine-tune the RoBERTa-Base model with differentially private LoRA (r = 16) on the SST-2 dataset. The results are presented in Figure 3. DP LoRA performs well for all the hyperparameters considered. The gap between the best accuracy and the worst accuracy is only 2%.

heading: D FULL FINE-TUNING WITH GPT-2
text: All results in Table 5 (in the main body), both private and non-private, perform fine-tuning using LoRA. In Table 7, we additionally report utility of non-private full fine-tuning. These numbers are taken from Table 1 of Li & Liang (2021). In general, these numbers are slightly lower than those obtained by performing non-private fine-tuning with LoRA.

heading: E ADDITIONAL EXPERIMENTS ON NATURAL LANGUAGE GENERATION
text: In this section, we perform additional experiments on private fine-tuning for text generation problems using the GPT-2 series of models. This includes the private fine-tuning of the GPT-2-XL model with 1.5B parameters. There are three main points to note compared to our results in the main body: 1) We show an improved performance on E2E NLG challenge using better hyperparameters; 2) We conduct experiments on E2E dataset with different privacy parameters to show that large language models perform strong even with smaller privacy budgets; 3) Finally, we conduct new experiments on DART dataset.
E.1 IMPROVING THE PERFORMANCE ON E2E NLG CHALLENGE
We improve the results of Table 5 with the following set of new hyperparameters.
Hyperparameter choice: For LoRA, we choose the bottleneck rank r = 4 in (4) and fine-tune Wq and Wv matrices of the attention layers as in the original paper. We optimize using AdamW with learning rate 4e-4, weight decay 1e-2 and train our models for 20 epochs. We use batch size 128. We take the gradient clipping parameter to be 1.0 and the noise multiplier to be 0.6 for the accountant in Gopi et al. (2021), achieving ε = 6.0, δ =1e-5.
Results: The results of our experiments are summarized in the Table 8.
E.2 EXPERIMENTS WITH DIFFERENT PRIVACY PARAMETERS
On E2E dataset, we test our framework with smaller privacy budgets (ε < 5 and δ 1/n) where n is the number of samples in the training data.
Hyperparameter choice: The hyperparameter choices are similar as in Section E.1. The only difference is that we increase the noise multiplier to be 0.71 for the accountant in Gopi et al. (2021), achieving the following (ε, δ) pairs: (ε = 3.0, δ =1e-5), (ε = 3.4, δ = 1/10n), (ε = 3.9, δ = 1/100n) and (ε = 4.5, δ = 1/1000n).
Results: The results of our experiments are summarized in the Table 9.
There are a couple of interesting observations comparing Table 9 with Table 8. First, we observe that although privacy budget is tight in Table 9, the results are quite similar to Table 8, which shows
that our methods also perform very well under stronger privacy guarantees. A more interesting observation is that under smaller epsilon regimes, the performance for private fine-tuning of GPT2-XL model improves. Observe that the performance improvement is more prominent going from GPT-2-Small to GPT-2-XL in this setting, which may indicate that larger models can be even more effective in private learning when the privacy budgets are tight.
E.3 PERFORMING EXPERIMENTS ON DART DATASET
We study the DART dataset as a text generation problem for private fine-tuning of GPT-2 series of models.
DART: DART was introduced as an open-domain data-to-text dataset by Nan et al. (2021). The dataset consists of 62K training samples, 6.9K validation samples, and 12K test samples. In comparison to E2E, the dataset is larger and the task is more challenging.
Hyperparameter choice: The hyperparameter choices are similar as in the previous setting. The only difference is that we use batch size 256 for the experiments on DART. This achieves ε = 6.8, δ =1e-5 on DART using the accountant in Gopi et al. (2021).
Results: The results of our experiments are summarized in the Table 10.

Review summaries:
This paper demonstrates the feasibility of fine-tuning large language models (pretrained on public dataset) on private datasets for various downstream tasks. It proposes a meta-framework in which most of the pretrained weights are held constant and only a small number of additional parameters are updated during fine-tuning. Combined with state-of-the-art dimension reduction and privacy accounting techniques, their method achieves good privacy/utility tradeoff on several GLEU benchmarks using RoBERTa and NLG using GPT-2.

In this paper, the authors propose a meta-framework that applies DP-SGD to NLP tasks. As a DP learning algorithm, DP-SGD provides a practical method to protect the privacy of the training samples of the deep learning model. The framework works on the fine-tuning phase of the pre-trained language model and protects the privacy of the fine-tuning datasets. To adapt DP-SGD to NLP models, the authors propose to fine-tune only a part of the parameters in the large pre-trained language model. The proposed meta-framework can handle various fine-tuning algorithms. The experimental results show the proposed method can achieve performance very close to the non-protection algorithms.

This paper introduces a parameter-efficient framework for privately fine-tuning large language models. The techniques were proposed in prior literature for non-private learning while the authors found that these techniques are very effective for training with differential privacy (DP), which was extremely hard for large models due to the amount of noise added. On common NLP benchmarks and with relatively small privacy budget, these parameter-efficient methods outperformed the regular DPSGD and could even be close to the non-private baseline, in terms of utility. These methods are also much more memory-efficient and faster than DPSGD as well.