Privacy-preserving Active Learning on Sensitive Data for User Intent Classification
Oluwaseyi Feyisetan Thomas Drake Borja Balle Tom Diethe

























Privacy-preserving Active Learning on 
 Sensitive Data for User Intent Classification
    
  Oluwaseyi Feyisetan 

  Amazon Research

   

  
 Thomas Drake 

 Amazon Research

  

 Borja Balle 

 Amazon Research

  

 Tom Diethe 

 Amazon Research

  


    December 30, 2023
=======================================================================================================================================================================



Active learning holds promise of significantly reducing data annotation costs while maintaining reasonable model performance. However, it requires sending data to annotators for labeling. This presents a possible privacy leak when the training set includes sensitive user data. In this paper, we describe an approach for carrying out privacy preserving active learning with quantifiable guarantees. We evaluate our approach by showing the tradeoff between privacy, utility and annotation budget on a binary classification task in a active learning setting.





§ INTRODUCTION

Preserving data privacy is an essential tenet required to maintain the bond of trust between consumers and corporations. Consumers expect their data to remain secure while being used to design better services for them without compromising their identities – especially while carrying out sensitive transactions and interactions. We define these potentially compromising and personally identifiable data as sensitive data. Annotated data drives the machine learning economy and sensitive data holds the key to building richer experiences for users interacting with modern AI interfaces. However, in a bid to get annotations, sensitive data in the wrong hands could lead to irreparable damage in terms of reputation and trust between data holders and their users. 

This potential data transfer deserves greater monitoring in the era of  human powered crowdsourcing and active learning. As niche classification tasks arise to power new applications, they often lack an abundance of pre-annotated datasets. With active learning, the learner can select a subset of the available data points to be annotated. This can exponentially reduce <cit.> (in some cases) the number of training queries required. However, the cost <cit.> of labelling machine learning datasets is traditionally viewed as a function of the expert, time or price.

In this paper, we argue that, for non-public datasets, the cost of learning the true labels should also factor in the privacy of the information contributed by the data owners to the data custodians. As a result, the active learning condition (beyond simply selecting the best examples) becomes two-fold when submitting a batch of data for annotation: (1) labeling this selected subset leads to the greatest increase in our machine learning model performance, (2) the probability of revealing any query that can uniquely identify a specific user is very small (and quantifiable by a privacy parameter). 



  
Contributions 
Recent studies into privacy and machine learning have focused on preserving model parameters from leaking training data <cit.>. See <cit.> for a recent survey. However, in this paper, we address the privacy preserving requirement from the point of view of training samples that are sent to annotators from an active learning model. To the best of our knowledge, this is the first paper that views preserving privacy in machine learning from this angle. We also describe how techniques such as k-anonymity does not provide sufficient privacy guarantees and how this can be improved using differential privacy (DP). We describe how to do this by providing experimental results after discussing an approach that leverages one of the DP algorithms from literature. 



§ BACKGROUND



In this section, we present an introduction to active learning and the privacy challenge of outsourcing queries to the crowd. We then describe k-anonymity, its shortcoming in providing an adequate privacy model for active learning and how this can be improved with differential privacy.



 §.§ Active Learning


The central premise of active learning is that a model is able to perform as well with less data, if a learner can select the training examples that provide the highest information <cit.>. Formally described, using a classification task: let 𝒟 be a distribution over 𝒳×𝒴 where the goal is to output a label 𝒴 from the label space {±1} given an input from the feature space 𝒳. The learner receives a batch of i.i.d. draws (x_1,y_1), ..., (x_n,y_n) over the unknown underlying distribution 𝒟. The value of y_i is unknown unless an annotation request is made by the learner. The objective is to select a hypothesis function h: 𝒳→𝒴, where err(h) = ℙ_(x,y)∼𝒟[h(x) ≠ y] is small. Given that ℋ is the space of all hypothesis, and h* = {err(h) : h ∈ℋ} is the hypothesis with minimum error, the aim of active learning is to select a hypothesis h ∈ℋ with error err(h) within reasonable bounds of err(h*) by using few annotation requests (i.e., few compared to a passive learner).

Various strategies have been proposed to implement an active learner. One is uncertainty sampling <cit.> which attempts to select the query x' that the model is least convinced about;  i.e.,  x' = _x 1 - P_θ(ŷ|x) , where ŷ is the label with the highest posterior for model  θ and x is maximized over the range of all the unlabeled examples in the training pool. Other approaches to uncertainty sampling use either the margin between the two most probable classes ŷ_1 and ŷ_2; i.e.,  x' = _x P_θ(ŷ_1|x) - P_θ(ŷ_2|x) or a general entropy-based uncertainty over all the possible ŷ_i classes; i.e.,  x' = _x - ∑_i P_θ(ŷ_i|x) log P_θ(ŷ_i|x) .

The main privacy issue with active learning stems from the need to scale the annotation process by crowdsourcing the labels via an open call <cit.>. Whenever you make a request to an external resource, you pay a privacy cost by transmitting the information to be annotated. This problem is compounded when there is only one oracle <cit.> or collusion among crowd workers. In this paper, we describe privacy notions that can be used to address these concerns along the privacy-utility tradeoff spectrum. 



 §.§ Privacy-preserving machine learning






  
k-Anonymity 
At first glance, a straightforward approach for addressing the privacy concerns of active learning could be through k-anonymity <cit.>; i.e., ensuring each query that is sent out for crowdsourcing occurs at least k times. In deploying k-anonymity, the first step involves identifying a set of quasi-identifiers. In our context, these are user queries which can be potentially combined with an externally available dataset to uniquely identify a user. The frequency set of these quasi-identifiers represent the number of occurrences in the dataset. We therefore say that a dataset satisfies k-anonymity relative to the quasi-identifiers if when it is projected on an external dataset, the frequency set occurs greater than or equal to k times. 



To achieve k-anonymity when the size of the frequency set is less than a desired  k , the attributes are anonymized by either generalizing or suppressing the information. For example, marital status attributes listed as married, divorced or widowed are generalized as once married, while the ethnicity is redacted as *****. 



Despite its promise, k-anonymity has fundamental challenges, some of which are exacerbated by our unstructured data domain. First, <cit.> demonstrated that k-anonymity suffers from the curse of dimensionality since generalization (such as with traditional database columns), requires co-occurrence of words across different examples, but unstructured data such as text phrases tend to follow a heavy-tailed distribution that have a low co-occurrence of words. Secondly, the choice of quasi-identifiers might exclude the selection of some useful sensitive attributes which could then be used for re-identification attacks. This led to other approaches such as l-diversity <cit.> and t-closeness <cit.> to handle sensitive attributes. In our implementation, we subsume the quasi-identifiers to include the entire user query.



Therefore, by `hiding in the crowd' of k, a user has received some assurance from k-anonymity that their sensitive query will not be outsourced from the active learning model unless it passes a meaningful threshold. However, stronger formal privacy guarantees are required to demonstrate that given the user's query, an attacker cannot decide where it came from with certainty. With k-anonymity, we are unable to directly quantify a privacy loss value, nor state the bounds of the guarantee of this loss. These two quantities are obtainable from a differential privacy model which we now describe. 






  
Differential Privacy

To motivate our discourse on why we need stronger privacy guarantees than what k-anonymity provides, we consider a hypothetical scenario: Would a user be comfortable asking an AI agent a sensitive question, with the knowledge that the question will be possibly used to further train agent's learning model? We denote the training data available to the model before the user submission as 𝒟, and the data after the user question as 𝒟'. These are adjacent datasets differing on only one record. We posit that a user c will be comfortable if (1) 𝒬(𝒟) = 𝒬(𝒟') where 𝒬 is a query over the dataset; and (2) P(𝒮(c)|D') = P(𝒮(c)) where 𝒮 is a user secret. These 2 points are articulated in Dalenius's Desideratum <cit.> that:  Anything that can be learned about a respondent from the statistical database should be learnable without access to the database 

However, we can't make these exact guarantees because datasets are meant to convey information and they will have no utility if these points were true.

What Differential Privacy <cit.> offers is a strong privacy guarantee on adjacent datasets (taking our AI agent example), that: the example selected for active learning will be very similar whether or not the user added their sensitive question. This means, an adversarial annotator receiving a random training query cannot guess with certainty if the query was from dataset 𝒟 (which doesn't include the user's query) or 𝒟' (which includes it). 



With this, we state that, a randomized algorithm ℳ : ℕ^𝒳→𝒞 that receives as input a dataset 𝒟 with records from a universe 𝒳 and outputs an element from 𝒞 is (ε,δ)-differentially private if for every pair of databases 𝒟 and 𝒟' differing in one record and every possible set of outputs C ⊆𝒞 we have

    𝖯𝗋[ℳ(𝒟) ∈ C] ≤ e^ε𝖯𝗋[ℳ(𝒟') ∈ C] + δ




The  δ parameter accounts for a < 1 / ||𝒟||_1 relaxed chance of the  ϵ guarantee not holding – otherwise, it will be equivalent to just selecting a random sample on the order of the size of the dataset. One benefit of the differential privacy model is that it has a quantifiable, non binary value for privacy loss which helps in deciding to comparatively select one algorithm over the other. We observe an output of the random algorithm  C ∼ℳ(D)  where we believe that  C  was more likely produced by 𝒟 and not 𝒟', then the privacy loss from the query that yields  C  on an auxiliary input x is: 
    ℒ(C;ℳ,x,𝒟,𝒟') def=ln(Pr[ℳ(𝒟) = C]/Pr[ℳ(𝒟') = C])


So we surmise that differential privacy promises to prevent a user from sustaining additional damage by including their data in a dataset; and the privacy loss obtained is  ϵ with probability  ≥1-δ. 

A common method for making the results of a statistical query differentially private involves adding Laplacian noise proportional to either the query's global sensitivity <cit.> or the smooth bound of the local sensitivity <cit.> (where sensitivity Δ f = max||f𝒟 - f𝒟'||). However, for non-continuous domains, adding noise can result in unintended consequences that completely wipe out the utility of the results e.g., <cit.> describe how attempting to add noise to the query for the optimal price for an auction could drive the revenue to zero. 

Research has however shown that apart from providing reasonable and well understood protection from inadvertent exposure <cit.>,  k-anonymity can also be used as a launchpad for achieving quantifiable differential privacy without the utility loss that comes from applying noise <cit.>. 





§ PRIVACY PRESERVING ACTIVE LEARNING FRAMEWORK

This section introduces our proposed framework for carrying out active learning with privacy guarantees on queries that are sent to an external oracle. It presents the task we try our approach on, highlights the considerations that drive our choices and lays out a high level pseudo-code of our approach.









 §.§ Task model

Our task consists of a very large dataset of user queries 𝒰 = {u_1,...,u_n} that represent the user intent (we map the queries to the intent and do not extract specific quasi-identifiers in order to prevent leakages from un-captured sensitive attributes). Our pipeline consists of an active learning model which learns a binary classifier, predicting if a user intent belongs to a specified class or not. The model is bootstrapped with a golden set of user queries and their associated intents. Subsequent queries from a fixed pool are added to a RankedExamplePool where they are ordered by confidence/uncertainty <cit.> from our deep learning model. 

To train the model, it first draws on the golden set, then we make a next_example call to draw an uncertain query from the pool with the criteria that knowing the accurate intent of this query gives the best performance increase to the model while preserving privacy. The query is then outsourced to external annotators and the annotated labels are re-incorporated into the model training process.



 §.§ Considerations
 
Given the size and projected scale of our dataset (≈ 10^9 queries), we decide to employ randomized probabilistic algorithms in estimating if a query satisfies k-anonymity. Compute and memory resources are thus freed up for training and retraining the model rather than maintaining the frequency and cardinality of incoming queries. Each algorithm (detailed below) is adjusted to prevent over-estimations which could erode the privacy guarantees. Furthermore, after a query is presumed to satisfy k-anonymity, only 1 of the k queries is sent to n external annotators to prevent an aggregation of privacy losses. 



 §.§ Approach


In this paper, we adopt the differential privacy algorithm from <cit.> but we utilize it in an active learning setting to select a subset of training examples to send for crowdsourcing. We also note that other DP methods that have been designed for search logs and include a form of k parameter aggregation such as: <cit.>, Zealous <cit.> and SafeLog <cit.> can be implemented to obtain similar results. 

We take a two-stepped approach to extend k-anonymity to yield a quantifiable differentially private active learning model taking a cue from how <cit.> demonstrated the use of pre-sampling to achieve differential privacy with k-anonymity. This is predicated on Theorem 1 from <cit.> which states that: given an algorithm ℳ which satisfies (β_1, ϵ_1, δ_1)-differential privacy under sampling, then ℳ also satisfies (β_2, ϵ_2, δ_2)-differential privacy under sampling for any β_2 < β_1 where 

    ϵ_2 = ln(1 + (β_2/β_1(e^ϵ_1 - 1))); δ_2 = β_2/β_1δ_1




Therefore, k-anonymity on our full dataset (i.e., β_1 = 1) can instead be preceded by a mechanism that samples each row of its input with probability β_2, with k-anonymity then applied to the resulting sub-sample to yield ϵ_2,δ_2-differential privacy for ϵ_2 = ln(1 + (β_2(e^ϵ_1 - 1))) within the bounds δ_2 = β_2δ_1. Thus the effect of sampling serves to amplify pre-existing privacy guarantees <cit.>.



Furthermore, we harden our k-anonymity to offer `safe' k-anonymization by aggregating the queries by frequency rather than using a distance based measure <cit.>. The benefit we get from this is that no query within our set of k contains any extraneous sensitive text which could be used as a source of re-identification or to carry out reconstruction attacks.

The next sections describe: how we carry out our sampling to ensure we select useful candidates in an efficient manner, and how we estimate k-anonymity using the queries.




algoruled






§ EFFICIENT SUB-SAMPLING FOR ACTIVE LEARNING



Given a multiset of query sets  ℳ =   {U_1, ..., U_s } with repetitions where a given  U_i  is a tuple  ⟨u_i, ..., u_k ⟩, and a sampling rate β, our objective is to return a sub-sample from which to carry out k-anonymization before training our active learner. Let n be the number of distinct query sets |{ U_1, ..., U_s }| with elements { e_1, ..., e_n }. For a very large dataset size s, we seek to estimate  n̂  using only m registers where  m << n . The number of distinct queries in our sample set therefore become βn̂.

To estimate the cardinality  n̂ , we utlize the HyperLogLog algorithm by <cit.>. HyperLogLog is a probabilistic cardinality estimator that uses a very small memory footprint ( ≈ 12kb per key) for a low standard error ( ≈ 0.81%) while scaling up to dataset sizes as large as  2^64  items[Values taken for the Redis implementation of HyperLogLog - http://antirez.com/news/75]. 

For each incoming  U_i : ⟨u_i, ..., u_k ⟩, a hash h(U_i)  is computed and converted to base 2. The b least significant bits are used to identify the register location to modify, where  2^b = m  or log_2 m. With the remaining bits w, a count p(w) is made of the number of running 0s up to the leftmost 1. For a very large, uniformly distributed multiset of random numbers, 2 raised to the maximum value of p(w) gives a wide approximate of the cardinality. To correct this, HyperLogLog breaks the multiset into subsets and uses the harmonic mean of the subsets.

After determining our sample size, the next step is to draw a random set of unique samples without replacement up to βn̂. We keep each element in the dataset with probability β. The ensuing sub-sample represents the new dataset in our RankedExamplePool from which we will carry out our k-anonymization.





§ ESTIMATING K-ANONYMITY USING QUERY FREQUENCY

Given a multiset of query sets ℳ = {U_1, ..., U_s} with repetitions such that the frequency of U_i is f_U_i and U_i is a tuple  ⟨u_i, ..., u_k ⟩. For a very large dataset size s, we seek to estimate f̂_̂Û_̂î using sub-linear space. To estimate the query frequency, we use the Count-Mean-Min with conservative update <cit.> sketch algorithm which is an improvement on the proposed Count-Min sketch algorithm by <cit.>. For each incoming U_i : ⟨ q_i, ..., q_k ⟩, d different hashes of the queries is computed and a counter indexed by each hashed result is incremented. To return the frequency, the minimum over all d index locations for Q_i is returned. To further reduce the potential of error from over-estimation, conservative updates are employed to increment only the minimum counter from the d indexes, and an estimated noise is further deducted from the result.

Therefore after initial pre-sampling step, we select only queries which occur at least k times. These queries are then added to the RankedExamplePool where the next_example is drawn based on the element with the highest uncertainty measure. The benefit of using the frequency to satisfy k-anonymity rather than using partitioning, clustering and recoding, or distance based algorithms, is to prevent attacks that rise from an attackers a-priori knowledge of a dataset. For example, a cluster of k with one sensitive or extreme outlier (e.g., a cluster of incomes within zip code with one UHNW outlier becomes easily identifiable by an attacker even though the aggregation was based on nearest neighbors).





§ EXPERIMENTS


Our work seeks to demonstrate quantifiable privacy preserving guarantees in an active learning setting by taking a pre-sampling approach before carrying out k-anonymization. We evaluate our approach on an internal dataset used for intent classification on voice devices.




 §.§ Datasets

The Intent Classifier dataset consists of a subset of queries from February 2018. The dataset is used to train a model which determines a binary intent for a user. The dataset consists of 2.5M queries comprising 58K distinct data points. Each record contains a user query and a label indicating if it is categorized as a Positive or Negative intent query. Part of the dataset has also been previously discussed and described by <cit.>. Figures <ref> and <ref> show the nature of the dataset with a histogram and plot of the frequency distribution of the queries. As expected with textual data, there is a long tail of queries which were observed just once (making up ≈ 60% of the dataset). The dataset consists of 63% of queries labelled as Positive intents vs 27% being Negative.




 §.§ Experiment setup

The experiment task was binary intent classification in an active learning setting. We created a new baseline model which predicts Positive and Negative intents. For the experiments, the model was initially bootstrapped with 1,000 labeled examples. The active learner then queries a data pool to get a batch of additional training examples to improve the model. The active learning strategy was uncertainty sampling based on confidence scores. 

The confidence and uncertainty scores for the active learning model were obtained from a Bayesian deep learning model described in <cit.> where model uncertainty, quantified by Shannon entropy is 𝒰(x) = -∑_c(1/T∑_tp̂_c) log (1/T∑_tp̂_c) and 1/T∑_tp̂_c is the averaged predicted probability of class c for x, sampled T times by Monte Carlo dropout. A histogram of the confidence and uncertainty scores can be seen in Figures <ref> and <ref>. 

We simulated the probability of the crowd annotators returning the correct answers to the requested queries by drawing from a normal distribution with mean centered at 0.65 and standard deviation 0.01 (see <cit.>'s Figure 2(a) for more). 







 §.§ Evaluation metrics

To evaluate our results, we compared the annotation accuracy between the baseline model, and the models trained with active learning and our privacy preserving model. We vary the sub-sampling parameter β and the anonymization factor k while training our model and recording its accuracy. We set the evaluation data at 5,000 samples (i.e., about 10% of the dataset). We also provide privacy guarantee values from numerical computations of ϵ and δ and highlight in the appendix, what values of k and β provide those levels of guarantees.





  
Baseline condition train standard classification model. Sub-sampling parameter β = 1, anonymization factor k = 1 i.e., using the entire dataset





  
Experiment conditions train classification model using privacy preserving active learning. Sub-sampling parameter varied at β = {0.1, 0.3, 0.6, 0.9}, anonymization factor varied at k = {1, 20, 100, 200, 500}























 §.§ Results

The results of our experiments are presented in Figures <ref>, <ref> and <ref>. Our findings provide insight to the tradeoffs between privacy, utility and our annotation budget. 



 §.§ Privacy vs Utility Tradeoff

Figure <ref> highlights the privacy–utility tradeoff which occurs as a result of varying β and k. As expected, as the value of k, gets smaller, i.e., by selecting more items in the tail of the dataset, we are able to improve the accuracy of our model. This however has the effect of degrading our privacy guarantees. Similarly, by providing privacy amplification by subsampling, the utility of our model suffers. Figure <ref> paints a wholistic picture of this by showing how by tuning the values of β and k, we can arrive at the same values of accuracy.






 §.§ Annotation budget

Figure <ref> describes how our annotation budget changes for different privacy settings. With a stronger privacy model, we incur less cost as a function of less annotation requests. By reading across the graph, we also discover that the same budget can be realized from different privacy configurations: e.g., by subsampling with β = 0.1 and selecting k = 20, we incur the same budget as β = 0.3 and k = 100 and therefore, the same accuracy (from Figure <ref> above). 






 §.§ Budget vs Accuracy

We established from Figure <ref> and Figure <ref>, the relationship between privacy and accuracy, and between privacy and our annotation budget. Since we can obtain the same level of accuracy and budget requirements from different parameter values, Figure <ref> highlights how an increase in budget affects our overall model accuracy. Increasing the budget initially accelerates the improvement of our model, however, the utility gains quickly slow down. For example, after 30,000 labels, we do not see any significant increase in model accuracy.




These results can serve as a guideline in selecting appropriate privacy parameters for different annotation budgets in a way that is more representative of the dataset. For example, for a fixed annotation budget, you can reduce β to select more data points from the tail of the dataset (i.e., a smaller k). This variation can also be done by starting with a target accuracy score and varying β and k. The results also demonstrate that by sacrificing some utility gains, we can make stronger privacy guarantees and reduce our annotation budget when carrying out active learning. 























    


§ CONCLUSION

We now briefly revisit our results in the light of our hypothesis. We also discuss the limitations of our process, its implication to the broader discourse on privacy and machine learning and conclude with future work.

We apply the approach from <cit.> to offer privacy guarantees when training models with active learning which requires sending unlabelled examples to an external oracle. Our results join the conversation on differential privacy and machine learning <cit.> with particular reference to preserving the privacy of users.

Our results show that by taking a small performance hit, we can achieve similar accuracy scores with a smaller annotation budget and stronger privacy guarantee. One limitation however is that we have only reported results on a binary classification task. We are currently expanding our approach by designing a new algorithm for differential privacy on text. We show that the accuracy loss increases as task complexity increases. Therefore, if we were to apply the approach in this work to other NLP tasks, e.g. multi-class classification or question answering, we will expect the accuracy loss to be greater.

Another limitation of our approach and potentially other k-parameter based approaches (<cit.>,<cit.>,<cit.>) to differential privacy for text is that it will not work for tasks where almost all the data is unique i.e., k is essentially 1 (e.g., a datasets of emails or movie reviews). Therefore, a different approach is needed to provide quantifiable privacy guarantees without resorting to k-anonymity. 

We believe that this is an area worthy of further research in order to further quantify the true cost of privacy in crowdsourcing and machine learning. We have already begun further work to address two of the limitations reported in this current paper. 




§ APPENDIX




Table <ref> lays out a grid of ϵ, δ scores and the corresponding sampling parameter β and anonymization factor k required to satisfy that level of (ϵ,δ)-differential privacy. The shaded region presents a β× k high level view of how to achieve a desired level of privacy. 

A few insights can be gleaned from the results, the most obvious being that strong privacy requirements, (indicated by small ϵ and δ scores as we traverse the table towards the bottom left corner), require a higher anonymization factor k and smaller sampling rate β. This is also observed by the fact that lowering the k factor only preserves privacy at the highest displayed ϵ value of 1.0 and δ = 1 × 10^-6 (at the top right corner of the table).

Observing β individually, we also note that, when k and ϵ are at fixed values, as δ decreases, i.e., to obtain stronger privacy guarantees, we need to lower the sampling rate β. This indicates as β decreases, privacy guarantees increase. Similarly, observing k by fixing the values of β and ϵ, demonstrates that increasing k improves our privacy guarantees.









aaai



