Two common problems arising after deployment of a machine learning model on user devices are discrepancy between training data and actual data stored on user devices, and the need of regular model updates. In the case of language modeling, it corresponds to the difference between language and style of the training corpus mined in the Internet and messages of the user, which account for most of the text generated on the device. Even if the training corpus includes a substantial part of informal texts (tweets, forum threads, etc.), real user data can be very different. This is a challenge for word prediction algorithms in software keyboard applications. The most general approach to improvement of customer experience in typing is integrating a separate user language model trained on device in an on-line fashion. In the simplest case it is a smoothed n-gram (e.g. Kneser-Ney n-gram model (Goodman (2001))).
In Yoon et al. (2017) continuously learned personalized language model based on LSTM was proposed but as far as each user generates only a small portion of textual data, such data by itself cannot be used for updates of the general model. Thus, for a model update, a collection of potentially sensitive data from many users is needed. As shown in McMahan et al. (2016), collecting data for training may be avoided. We propose a similar approach for distributed fine-tuning of language models on private data. In this sense our method can be considered as “federated fine-tuning“ but we prefer to take more traditional term. In this setting we start with a language model trained on a large text corpus representing the general language. This model will be updated continuously on user devices but with an additional requirement that the model must not go too far from the general language model, i.e. we don’t overfit on user data.
We pursue two goals: 1) to develop an algorithm of distributed fine-tuning that is fast, communication efficient and doesn’t need collecting sensitive user data; and 2) to prevent the language model from forgetting “general English“. Besides, we provide analysis of possibility of privacy violation in our model. (Hitaj et al. (2017)) demonstrated an attack on distributed training algorithm leading to information leakage. This means that privacy analysis in necessary for such algorithms.
Our main contributions are: 1) we propose an efficient procedure of distributed fine-tuning of language models immune to the problem of catastrophic forgetting (French (1999)
), 2) we provide experimental evaluation of on-device training time, communication costs and convergence rates of the general language model in realistic conditions, 3) we demonstrate that distributed fine-tuning is applicable to various model architectures (RNNs, CNNs, feedforward neural networks) and tasks (language modeling, image classification), 4) we compare two most popular strategies of improving communication efficiency in the context of distributed learning, and 5) we propose an experimental framework for evaluation of differential privacy of distributed training of language models, and using this framework, we evaluate privacy guarantees of our approach.
In our research we are focused on improvement of keystroke saving rate (see section 2.4) because this metric reflects customer typing experience more directly than perplexity or BLEU. We use LSTM architecture for our language model as described in Zaremba et al. (2014) and evaluate on-device training time for this architecture. We show that the on-device training time is reasonably small, thus demonstrating the feasibility of the whole approach.
2 Distributed fine-tuning of language models
As usual, our task is to predict the next word given a sequence of words . If the prediction algorithm of a software keyboard application is based on a language model with low perplexity on the test data, the application provides a reasonably sorted list of input candidates. Of course, the test data should be drawn from the same distribution as the user data. In our case we also want to have only one, continuously improving model on a user device. As far as the user can always switch to the general English, we have to prevent the model from overfitting on the texts written on the device, or catastrophic forgetting (McCloskey & Cohen (1989); Goodfellow et al. (2014); Kirkpatrick et al. (2016)).
Our approach can be summarized as follows (Figure 1): 0) At the first stage we have an initial language model (at every step t it will be updated to ) trained on a large corpus of standard English; 1) As soon as a user inputs sufficient volume of text, the latest version of is sent from the server to provide updates, and fine-tuning starts on the device leading to the model ; 2) When the training is finished the model is sent back to the server; 3) Every time the updated models are received from different users, a round of model update is run resulting in the model
2.1 Learning without forgetting
In its original formulation (Li & Hoiem (2016)), the problem of learning without forgetting (LwF) consists in re-training of existing model on new data such that its performance on the old data does not degrade.
More formally, suppose we have a classifier with a set of parameterstrained and tested on a dataset where and are train and test sets accordingly. Let be some new dataset. Our goal is to update the parameters with dataset i.e. we have to provide the best performance on old and new types of data having only training data of the new type.
In contrast, joint training (Caruana (1997)) assumes a model update with access to the both datasets: .
As we want to avoid sending user data to the server, classical joint training is impossible. On the other hand, LwF seems promising. In this case we send the user a current instance of the general language model with weights and fine-tune it producing the model , while is used for generating predictions for regularization. The resulting loss at step and true word can be calculated as follows:
A similar approach is taken in Shin et al. (2016) where predictions of a basic model (in this case ) are taken as soft labels.
2.2 Training with rehearsal
) is equivalent to minimizing Kullback-Leibler divergencewith respect to parameters of where density of is given by:
In (3) stands for the real distribution on a user device and
is a probability given by the model of “general English“. It suggests that instead of optimizing we can simply add data from to to obtain the portion. This approach, called random rehearsal, was presented in Robins (1995).
In practice in the case of fine-tuning with rehearsal a portion of the general English training corpus (standard English corpus) must be sent to the user device. Volume of typical user data generated on device is of the order of tens of kilobytes per month, and the size of the training data sent to the device will be of the same order. Overall, random rehearsal is more efficient, because there is no need to calculate soft labels.
2.3 Server-side model update
The server-side part of the solution must aggregate models from many users and use them to update the general model . We took simple model averaging as a baseline solution and transfer learning (Bengio (2011); Tang et al. (2016)) as an alternative approach.
In the case of transfer learning we optimized cross-entropy function (1), with given by an average prediction from aggregated models :
Just as in the case of on-device training, transfer learning-based approach is rather inefficient in terms of time and memory because predictions from all models are needed.
2.4 Keystroke saving rate
Keystroke saving rate (KSS) (McKenzie & Soukoreff (2002)) is defined as a relative decrease in the number of characters the user has to type, given suggestions from the software keyboard:
where is the total number of non-space characters in the typed text and is the number of characters user still had to type until the correct suggestion was presented. In our experiments we used top-3 suggestion lists.
From the definition above one can see that KSS is better for customer experience assessment compared to perplexity. Besides, perplexity measure underestimates out-of-vocabulary (OOV) words. In the presence of OOV words perplexity is ill-defined, so all OOV words must be removed from the test set. It makes a direct comparison of models with different vocabularies impossible, which is impractical. Finally, our experiments have demonstrated that a small decrease in perplexity may not correspond to KSS improvement and doesn’t lead to any practical result. Nevertheless, our method demonstrates considerable perplexity reduction as well.
2.5 Model fine-tuning experiments
The goal of our experiments was to find the most efficient pipeline to distributed fine-tuning of language models. We compared several approaches for client-side and server-side model updates. In accordance with the problem statement we assumed a substantial difference between the real-life user corpus and the standard English corpus used for initial training, so we took Twitter and Wikipedia corpora for the user and standard English corpora correspondingly.
The standard English train dataset contained approximately 30M tokens. The hyperparameters of the model were initially tuned on the Standard English validation set of 3.8M tokens. The user train dataset contained approximately 1.7M tokens. Updated models were tested on subsets of the Twitter and Wikipedia corpora containing 200k and 170k tokens correspondingly. Comparison between the random rehearsal and LwF training methods were carried out on a single node.
For our experiments we used LSTM architecture from Zaremba et al. (2014) with 2x650 LSTM layers, a vocabulary size of 30k, dropout , minibatch size , BPTT steps . The initial general English model was trained in epochs.
We report KSS and perplexity on both the standard English test set and the user data test sets. In the case of the standard English test set KSS was calculated on a subset of 200 sentences (3600 tokens). The initial general English model had a perplexity of and KSS rate on the Standard English test and perplexity and KSS rate on the user data test set. So, the model experienced a considerable drop in performance on the user data test set.
|PPL||KSS, %||PPL||KSS, %|
|Initial server model||100.1||67.9||336.0||49.7||192.6|
|Learning without forgetting,||128.4||66.0||162.8||54.9||146.0|
|Learning without forgetting,||147.0||64.9||121.7||57.5||132.7|
|Learning without forgetting,||186.5||63.1||101.1||59.2||133.9|
|PPL||KSS, %||PPL||KSS, %|
|Initial server model||100.1||67.9||336.0||49.7||192.6|
|TL on generated data (1-cycle)||109.2||67.2||259.7||50.8||174.4|
|TL on generated data (5-cycles)||112.3||67.0||246.0||51.2||171.6|
|TL on real data||108.7||67.2||261.2||50.7||174.6|
|Model averaging (1 round)||102.8||67.7||233.8||51.9||160.3|
|Model averaging (300 rounds)||105.5||67.3||109.3||58.4||107.5|
Table 1 summarizes our experiments with on-device model update algorithms. We see that the performance gap between the standard English and the user test sets can be considerably reduced at the cost of performance degradation on the first dataset. The best average perplexity is reached with the random rehearsal method and . We believe that the reason of the comparably inferior performance of the LwF method can be explained by the fact that soft labels used by LwF give a poor approximation of the true word distribution of general English so adding a small portion of true data gives better results in terms of knowledge preservation.
To compare model averaging and transfer learning for a server-side model update, we carried out a small experiment with nodes and iteration of the server-side update. Each model was trained on a mobile phone with a quad-core mobile CPU with a clock frequency GHz. We used a minibatch size , number of BPTT steps , learning rate and epoch. Training took approximately seconds on
kilobytes of text (user-generated and rehearsal data). Note that we used mobile CPU only, so computation time may be reduced by using mobile GPU. Due to absence of the frameworks that make backpropagation on a device possible we had to implement our own training on the phone. After training the updated user models were used for general model update on the server.
For the server-side model update algorithm we also tried the approach proposed in Shin et al. (2016). In this case the new model is trained on the texts generated by its previous round of update. We tested both generation per epoch and a single time generation before the first epoch. We carried out at most
epochs so we had 1 and 5 cycles of text generation correspondingly.
Results of the experiment are summarized in Table 2. We saw no significant differences between transfer learning on real and generated data. The difference between transfer learning and averaging is more sound but still not large. At the same time model averaging is much more computationally efficient, as long as transfer learning requires calculation of labels from each of the teacher models. After rounds of model updates with nodes ( nodes per round) we ended up with an absolute gain in KSS on the user data test with only a absolute KSS drop on the standard English data test.
Figure 2 shows that the model starts to perform reasonably well after rounds of updates. It also shows the importance of rehearsal for preventing catastrophic forgetting.
3 General Analysis of Distributed Fine-Tuning
3.1 Image classification
The distributed fine-tuning scheme proposed by us in 2.5 doesn’t have any features that make it applicable only to language modeling – it can be applied to a wide range of tasks. To illustrate this, we tested the approach for image classification task on MNIST dataset.
First, we trained a feedforward neural network with three layers consisting of units each. We applied dropout with probability after the input layer and dropout with probability after each hidden layer. We used learning rate , SGD with momentum equal to
, gradient clipping at, weight decay and minibatch size . After epochs we increased momentum to , weight decay to , decreased learning rate to and trained our model for more epochs. This scheme allowed our model to reach accuracy on the test set.
In order to get a new distribution, we applied a fixed random permutation of pixels to all images in the dataset. This trick is often used in recent papers devoted to catastrophic forgetting (e.g. Goodfellow et al. (2014)). Then, we randomly split the new training set (consisting of permuted images) into nodes each one containing images. As in 2.5, in each round of model averaging nodes were involved. Models on a single node were trained for one epoch with learning rate in the first rounds of averaging, in the next rounds and in the remaining rounds.
|Accuracy||Initial model||Fine-tuned with rehearsal||Fine-tuned without rehearsal|
|On standard MNIST|
|On shuffled MNIST|
We can see that distributed fine-tuning leads to the model that performs well on both the new and the old dataset. As for catastrophic forgetting that takes place if we train only on samples from the new dataset, rehearsal helps to minimize decreasing of the quality on the old dataset – it is less than .
3.2 Communication costs
There are several strategies that help to make distributed learning communication efficient. The most successful ones can be divided into two classes: 1) strategies that increase computation on nodes thus sending data to the server less frequently (McMahan et al. (2016)), and 2) strategies that transmit only some part of data from devices to the server in a single round of averaging Lin et al. (2017); Konečný et al. (2016). One of the most impressive results was reached by the Deep Gradient Compression (Lin et al. (2017)). It belongs to the second class – its key idea is to send only the most important weight updates obtained during on-device training while accumulating the remaining ones in order to send them when the sum becomes large enough.
It was shown that Deep Gradient Compression method (DGC) allows to send a very small part of weight updates () in a single round of averaging without loss in the quality of the model. For language modeling task, the gradient compression ratio of 462x was obtained using gradient accumulation strategy for small updates. However, DGC supposes that in each round of averaging only one user’s model update is made for every node while methods from the first class increase computation on nodes to several epochs before model averaging. In our experiments (2.5) we chose to train models on devices for one epoch rather than using DGC-style strategy. As shown in Table 4, this results in a total amount of Gb of data transmitted from nodes to the server in a single round (this amount certainly depends linearly on the size of the model). We used a classical 2-layer LSTM model from Zaremba et al. (2014) but there are models that perform similarly or better but have less parameters (e.g. Inan et al. (2016), Press & Wolf (2017)), so in practice we can improve the results shown in Table 4.
|Number of parameters||Size of the model||Nodes per round||Uploaded data per round|
To prove competitiveness of our approach, we made two experiments (see Tables 5 and 6) in the settings presented in Lin et al. (2017). In each one we used the same model architecture as suggested in Lin et al. (2017) and compared two strategies for improving communication efficiency: increasing computation on nodes and DGC.
In the first experiment the models were trained on a popular language modeling benchmark PTB. We trained -layer LSTM with units, tied input and output embeddings and variational dropout with probability . The results for DGC were taken from Lin et al. (2017). As for the first strategy, we trained the model for rounds. During the first round, a randomly initialized model was trained on the first node, then sent to the second node, trained there, and so on. When training on the last (fourth) node was finished, the updated model was sent to all four nodes and the second round started. The remaining rounds were standard rounds of model averaging. We had to make the first round so specific because we needed to simulate some kind of ”pretraining” (which the task itself didn’t suggest) in order to make model averaging perform well. Since we had only one training corpus, no rehearsal was applied during training on nodes. The number of training epochs on a node and learning rate decreased from - and correspondingly in the first rounds to - and in the last ones. We used minibatch size and BPTT steps.
In the second experiment we trained ResNet-110 for image classification task on CIFAR-10. The model architecture was similar to the one suggested in He et al. (2015)
except for the absense of ReLU layer before addition in building blocks. We also used slightly larger weight decay (instead of in He et al. (2015)) because we needed stronger regularization since training data was split into four nodes. Compared to DGC, we increased computation on nodes to several epochs. The number of training epochs on a node and learning rate decreased from - and correspondingly in the first rounds to and in the last ones. We used minibatch size and SGD with momentum equal to . The whole training took rounds, and the first round was again a round of consecutive learning instead of averaging as described above.
|Communication efficiency improving scheme||Perplexity||Uploaded data||Number of uploads|
|Several epochs of on-device training||Gb|
|DGC (Lin et al. (2017))||Gb|
|Communication efficiency improving scheme||Accuracy||Uploaded data||Number of uploads|
|Several epochs of on-device training||Mb|
|DGC (Lin et al. (2017))||Mb|
The first strategy achieved better perplexity and accuracy with less amount of data sent from nodes to the server compared to DGC. The important thing is that the number of communications for it was much less for DGC (by at least two orders of magnitude). Since communication efficiency involves not only the data that is transmitted from devices to the server but also the time that is necessary to set up connections, we can conclude that increasing computation on nodes perfroms better in terms of communication efficiency than gradient compression methods. This is why we chose the first strategy in our approach. Moreover, in our scheme the data on a device is used only once and can be deleted after the on-device training whereas in DGC and many other distributed learning schemes the data on each device is used many times (once per epoch).
Certainly, the two classes of strategies for improving communication efficiency are not mutually exclusive – we can apply DGC or, for example, methods that are described in Konečný et al. (2016) to further reduce communication costs but this is out of the scope of the present paper.
4 Privacy analysis
Our analysis is based on the experimental evaluation of differential privacy. The notion of differential privacy (Dwork & Roth (2014)
) appears naturally in many applications when it comes to estimating of the possibility of privacy violation. In particular, it can be applied to language models trained on private user data.
Loosely speaking, if we have a mechanism that takes some input data and produces some output then differential privacy measures how a single input unit influences the total output. In order to achieve differential privacy, some randomness must be introduced into the mechanism.
A randomized mechanism with domain and range satisfies -differential privacy if for any two inputs , that are adjacent (i.e. differ in one record) and for any subset of outputs it holds that:
In our case is the set of all subsets of users and a randomized mechanism is a mechanism that generates texts according to a certain language model trained on . Note that for any we need to have
Thus it is necessary for to be the set of all possible texts of some fixed length rather than the set of all texts of an arbitrary length. In our analysis we will consider only the space of texts containing words. This is reasonable because it is close to the average length of a sentence in our user data corpus and it seems that if user’s privacy is violated then consequent words are already enough for an adversary to retrieve important information.
Let us fix two adjacent sets of users and , train models and
on them and introduce random variable. It is defined by the expression
for any . Since a language model assigns some positive probability to any sequence of words, is defined correctly for all .
Parameter in the Definition 1 stands for the probability that two probabilities and differ much. This fact is formalized by the following proposition:
If then for any
Let . Then for any
The proposition implies that it is sufficient to estimate the tail of the distribution of under measure . Furthermore, Figure 4 suggests that the tail of the empirical distribution function of the observed variable has the Pareto distribution. This seems natural as far as words in human language follow Zipf’s law which is a discrete analogue of the Pareto distribution.
To make a confident estimation of differential privacy parameters, we consider 20 different pairs of adjacent sets of users and
. For each one, we consider a composite null hypothesis that the tail of the random variabledefined in (6) has the Pareto distribution with the shape parameter equal to its Hill’s estimator (M. Hill (1975)). Then we apply the Lilliefors test and accept the null hypothesis at a significance level of
. Quantiles of the Pareto distribution can be written down explicitly thus giving the following formula for estimation of parametersand :
where and are parameters of Pareto distribution defined in statistical tests (see Appendix).
Finally, for a given we take the largest value of amongst all the experiments.
4.2 Experimental evaluation
The critical value for the Lilliefors test at significance level is . In 19 cases out of 20 the Lilliefors test fails to reject the null hypothesis. This conclusion, together with sample visual representation in Figure 4, allows us to state that the random variable indeed has tails that decrease like the Pareto distribution tails with quite a big shape parameter. Exact values of KS statistics and Hill’s estimators of this parameter for different pairs of users are provided in the Table 7.
Table 8 shows the results for different values of calculated by formula (7). In this table the value of is the largest value of this parameter in all 20 experiments. The total number of users is so it is reasonable to put . For this choice of parameter equals to . It means that our algorithm offers reasonable privacy guarantees (see (Papernot et al., 2017)). Additionally we provide values of for smaller values of .
The results shown in Table 8 demonstrate that our scheme provides a very good level of privacy protection. However, it is necessary to say that we only aim to produce an empirical estimation of differential privacy which inevitably holds with some high probability but not almost surely (this fact makes our approach close to the so-called random differential privacy introduced in Hall et al. (2011)). In many machine learning algorithms, the outcome is initially deterministic and some well-known distribution is used to generate noise in order to make the algorithm differentially private (e.g. Papernot et al. (2017)). In our mechanism the source of randomness lies inside the neural network and the output distributions can’t be written explicitly. This is the reason why we are able to provide only empirical estimations of differential privacy parameters.
We have presented our results in distributed fine-tuning of neural language models. We paid special attention to preventing a catastrophic forgetting of the general language after a model fine-tuning on the user devices. Our experiments showed that the performance of an initial model of the general English on user data can be improved significantly almost without a performance degradation on the standard English training data. We found that a combination of on-device training with random rehearsal and server-side model averaging provides the best performance for such distributed fine-tuning. Users’ models were trained for the whole epoch that reduced communication costs while at the same time being quite fast – it took less than minutes with a realistic assessment of volume of the available user data. Finally, we provided an experimental evaluation of differential privacy of our method and showed that the method has a reasonable level of differential privacy compared to other solutions. We still have to note that we provided an empirical estimation of differential privacy which holds with some high probability but not almost surely.
- Bengio (2011) Yoshua Bengio. Deep learning of representations for unsupervised and transfer learning. In Proceedings of the 2011 International Conference on Unsupervised and Transfer Learning Workshop, UTLW’11, pp. 17–37. JMLR.org, 2011. URL http://dl.acm.org/citation.cfm?id=3045796.3045800.
- Caruana (1997) Rich Caruana. Multitask learning. Machine Learning, 28(1):41–75, 1997.
- Dwork & Roth (2014) Cynthia Dwork and Aaron Roth. The Algorithmic Foundations of Differential Privacy, volume 9. Now Publishers Inc., Hanover, MA, USA, August 2014.
- French (1999) Robert M. French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3(4):128–135, 1999.
- Gibbons & Chakraborti (2010) Jean Dickinson Gibbons and Subhabrata Chakraborti. Nonparametric Statistical Inference, Fifth Edition. Taylor & Francis, 2010.
- Goodfellow et al. (2014) Ian Goodfellow, Mehdi Mirza, Xiao Da, Aaron Courville, and Yoshua Bengio. An Empirical Investigation of Catastrophic Forgetting in Gradient-Based Neural Networks. TR arXiv:1312.6211v2, 2014.
- Goodman (2001) Joshua T. Goodman. A bit of progress in language modeling. Comput. Speech Lang., 15(4):403–434, 2001.
- Hall et al. (2011) Rob Hall, Alessandro Rinaldo, and Larry Wasserman. Random Differential Privacy. ArXiv e-prints, December 2011.
- He et al. (2015) Kaiming He, Xiangyu Zhang, Shaoking Ren, and Jian Sun. Deep Residual Learning for Image Recognition. ArXiv e-prints, December 2015.
- Hitaj et al. (2017) Briland Hitaj, Giuseppe Ateniese, and Fernando Pérez-Cruz. Deep models under the GAN: information leakage from collaborative deep learning. CoRR, abs/1702.07464, 2017. URL http://arxiv.org/abs/1702.07464.
Inan et al. (2016)
Hakan Inan, Khashayar Khosravi, and Richard Socher.
Tying Word Vectors and Word Classifiers: A Loss Framework for Language Modeling.ArXiv e-prints, November 2016.
- Kirkpatrick et al. (2016) James Kirkpatrick, Razvan Pascanu, Neil C. Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A. Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, Demis Hassabis, Claudia Clopath, Dharshan Kumaran, and Raia Hadsell. Overcoming catastrophic forgetting in neural networks. CoRR, abs/1612.00796, 2016. URL http://arxiv.org/abs/1612.00796.
- Konečný et al. (2016) Jakub Konečný, H. Brendan McMahan, Felix X. Yu, Peter Richtárik, Ananda Theertha Suresh, and Dave Bacon. Federated Learning: Strategies for Improving Communication Efficiency. ArXiv e-prints, October 2016.
- Koning & Peng (2008) Alex J. Koning and Liang Peng. Goodness-of-fit Tests for a Heavy Tailed Distribution. Journal of Statistical Planning and Inference, 138(12):3960 – 3981, 2008.
- Li & Hoiem (2016) Zhizhong Li and Derek Hoiem. Learning without forgetting. CoRR, abs/1606.09282, 2016. URL http://arxiv.org/abs/1606.09282.
- Lin et al. (2017) Yujun Lin, Song Han, Huizi Mao, Yu Wang, and William J. Dally. Deep Gradient Compression: Reducing the Communication Bandwidth for Distributed Training. ArXiv e-prints, December 2017.
- M. Hill (1975) Bruce M. Hill. A Simple General Approach to Inference About the Tail of a Distribution. Ann. Statist., 3, 09 1975.
- McCloskey & Cohen (1989) Michael McCloskey and Neil J. Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. The Psychology of Learning and Motivation, 24:104–169, 1989.
- McKenzie & Soukoreff (2002) Scott McKenzie and William Soukoreff. Text entry for mobile computing: Models and methods, theory and practice. Human-Computer Interaction, 17, 2002.
McMahan et al. (2016)
Brendan H. McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise
Aguera y Arcas.
Communication-efficient learning of deep networks from decentralized
Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS), 2016.
- Newman (2005) Mark J. Newman. Power laws, Pareto distributions and Zipf’s law. Contemporary Physics, 46:323–351, September 2005.
- Papernot et al. (2017) Nicolas Papernot, Martin Abadi, Úlfar Erlingsson, Ian Goodfellow, and Kunal Talwar. Semi-supervised knowledge transfer for deep learning from private training data. In Proceedings of the International Conference on Learning Representations, 2017. URL https://arxiv.org/abs/1610.05755.
- Press & Wolf (2017) Ofir Press and Lior Wolf. Using the output embedding to improve language models. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pp. 157–163. Association for Computational Linguistics, 2017. URL http://aclweb.org/anthology/E17-2025.
- Robins (1995) Anthony V. Robins. Catastrophic Forgetting, Rehearsal and Pseudorehearsal. Connect. Sci., 7:123–146, 1995.
- Shin et al. (2016) Sungho Shin, Kyuyeon Hwang, and Wonyong Sung. Generative Knowledge Transfer for Neural Language Models. ArXiv e-prints, August 2016.
- Tang et al. (2016) Zhiyuan Tang, Dong Wang, and Zhiyong Zhang. Recurrent neural network training with dark knowledge transfer. ICASSP 2016, 2016. URL https://arxiv.org/abs/1505.04630.
W. Lilliefors (1969)
Hubert W. Lilliefors.
On the Kolmogorov-Smirnov Test for the Exponential Distribution with Mean Unknown.Journal of the American Statistical Association, 64:387–389, 03 1969.
- Yoon et al. (2017) Seunghyun Yoon, Hyeongu Yun, Yuna Kim, Gyu-tae Park, and Kyomin Jung. Efficient transfer learning schemes for personalized language modeling using recurrent neural network. CoRR, abs/1701.03578, 2017. URL http://arxiv.org/abs/1701.03578.
- Zaremba et al. (2014) Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. CoRR, abs/1409.2329, 2014.
Appendix A Experimental evaluation of differential privacy for texts
One can usually identify that samples come from a power-law distribution by looking at its tail distribution function where
is a cumulative distribution function (e.g.Newman (2005) describes this method). If then , i.e. the plot should be linear on logarithmic axes.
Figure 4 shows the empirical tail distribution function of the observed variable . We generated samples (10-word sequences) with the model with parameters that relates to a certain user to get observations of . It can be seen that the tail of is linear on logarithmic axes like the tail of the Pareto distribution in the region .
So we suppose that for big values of . More precisely, we suppose that the distribution function of for can be represented by the following formula:
for some . Parameter plays the most important role in the further analysis of differential privacy. A common way to estimate it is to use Hill’s estimator:
where are the order statistics and is the number of samples. This estimator is described in M. Hill (1975). It is a maximum likelihood estimator and it converges in probability to when , and
. Note that the estimator depends only on outliers of. This is a very helpful property because it allows us to use it even when we need to estimate only the tail distribution for large values of rather than the whole distribution. In the experiments we take . We put . For different pairs of adjacent sets of users and values of vary from to . Values of vary from to , so lies in the interval in our experiments.
Then we tested the null hypothesis that the cumulative distribution function of the random variable is of the Pareto law with the shape parameter for all . The Kolmogorov-Smirnov (KS) test is often used for this purpose (Koning & Peng (2008) illustrates this approach). Since we tested a composite hypothesis, we needed to use modification of the KS test that is called the Lilliefors test. In the same way as in Koning & Peng (2008) we introduced new random variables for . Since are order statistics, we have for and it can be shown that these variables are jointly equal in distribution to ordered samples from Pareto law with the shape parameter and the scale parameter . So, under the null hypothesis are exponential with the parameter and we can apply the Lilliefors test to check whether these samples really come from an exponential distribution with an unknown mean estimated by .
The method that we use (the Lilliefors test for exponential distributions) is described in Gibbons & Chakraborti (2010). Essentially, we calculate a KS statistic for the exponential distribution with a mean that’s equal to and an empirical distribution function of the values :
This statistic doesn’t converge to the Kolmogorov distribution as shown in W. Lilliefors (1969). It converges to the distribution with smaller critical values at the same significance levels because we overfit on the sample data when the estimator is plugged in. We chose a significance level and critical value for it is . In 19 cases out of 20 the Lilliefors test failed to reject the null hypothesis at a significance level. Table 7
provides exact values obtained during the application of the statistical test. Relying on these values along with data visualization in4 we can state that random variable has tails that decrease like the Pareto distribution tails.
The hypothesis that we accepted suggests that the cumulative distribution function of is given by the formula (8). It means that the tail distribution function for all is given by
We chose , so is just the ratio . Thus, can be estimated by