Knowledge Removal in Sampling-based Bayesian Inference

1 INTRODUCTION . “ The right to be forgotten ” refers to the right of individuals to request data controllers such as tech giants to delete the data collected from them . It has been recognized in many countries through legislation , including the European Union ’ s General Data Protection Regulation ( 2016 ) and the California Consumer Privacy Act ( 2018 ) . In the field of machine learning , legal experts suggest that companies may need to delete and re-train the machine learning models to meet the legal requirements of the right to be forgotten ( Li et al. , 2018 ; Garg et al. , 2020 ) . However , training a machine learning model would usually cost massive amounts of resources , including data , energy , and time . Thus , the enforcement of the right to be forgotten in the AI industry may result in unbearable costs . Toward this end , recent works ( Cao & Yang , 2015 ; Guo et al. , 2020 ) propose machine unlearning algorithms to efficiently characterize and remove the knowledge learned from specific data . To enable knowledge removal analysis , existing unlearning approaches usually require the machine learning models to be explicitly parameterized , which however do not cover an important family of machine learning algorithm , the Markov chain Monte Carlo ( MCMC ) . MCMC is a sampling-based Bayesian inference method that aims to draw samples along a Markov chain to approximate a target posterior distribution ( Hastings , 1970 ; Geman & Geman , 1984 ; Welling & Teh , 2011 ) . Distributions inferred by MCMC are usually implicitly parameterized , which makes it difficult to directly apply existing unlearning algorithms to the MCMC unlearning problem . In this paper , we propose an MCMC unlearning algorithm to realize the right to be forgotten in the sampling-based Bayesian inference for the first time . The key of tackling the MCMC unlearning problem is to design methods to directly analyze the implicit parameter of the learned distribution . To this end , we propose to employ the learned implicit distribution to approximate the target posterior under the measure of KL-divergence , which then converts the MCMC unlearning problem to an optimization problem with an explicit distribution parameter for knowledge removal analysis . Based on this conversion , an MCMC influence function is designed ( Huber , 2004 ; Koh & Liang , 2017 ) to characterize the knowledge learned from single data samples . The new influence function then delivers the MCMC unlearning algorithm , which removes data knowledge by directly subtracting the corresponding influence from the learned distribution . Theoretical analyses are conducted for the proposed MCMC unlearning algorithm . For the knowledge removal analysis , we prove that the proposed MCMC unlearning algorithm can provably realize a ε-knowledge removal , which is a new notation defined for evaluating the machine unlearning performance in Bayesian inference . For the generalization analysis , a PAC-Bayesian generalization upper bound ( McAllester , 1998 ; 1999 ; 2003 ) is established for the distribution processed by the MCMC unlearning algorithm . The upper bound shows that the difference introduced by MCMC unlearning in the generalization upper bound is no larger than the order of O ( 1/N ) . This result demonstrates that the proposed algorithm would not compromise the generalization ability of the learned distribution . In summary , our work has four main contributions : ( 1 ) We enable the knowledge removal analysis in MCMC by converting the MCMC unlearning problem to an optimization problem . ( 2 ) Based on this problem conversion , we design an MCMC influence function to characterize the knowledge learned from data , which then delivers the MCMC unlearning algorithm . ( 3 ) We conduct theoretical analyses for the proposed algorithm . We prove that the MCMC unlearning can realize an εknowledge removal and has little impact on the generalization ability of the learned distribution . ( 4 ) We conduct comprehensive experiments to verify the effectiveness of the proposed algorithm , which include Gaussian mixture models for clustering on synthetic data , and Bayesian neural networks for classification on real-world dataset . The results suggest that the MCMC unlearning algorithm can effectively remove the knowledge learned from the requested data while retaining the information learned from other data intact . The code has been submitted and will be released publicly . 2 RELATED WORKS . Markov chain Monte Carlo . MCMC is a Bayesian inference method that would draw samples along a Markov chain , in which the drawn samples are proved to converge to that from a targeted distribution ( Hastings , 1970 ) . Although many improvements have been made such as Hamiltonian Monte Carlo ( HMC ) ( Duane et al. , 1987 ; Neal et al. , 2011 ) , Gibbs sampling ( Geman & Geman , 1984 ; George & McCulloch , 1993 ) and slice sampling ( Neal , 2003 ; Walker , 2007 ) , MCMC still suffers from huge computational cost when inferring on large-scale dataset since each sampling step in MCMC requires computation over the whole dataset . To tackle this issue , Welling & Teh ( 2011 ) introduce a scalable MCMC sampler named stochastic gradient Langevin dynamics ( SGLD ) that by adding a proper noise to a standard stochastic gradient optimization algorithm ( Robbins & Monro , 1951 ) , which can help the update iterations converge to samples from the true posterior distribution . Since that , a variety of stochastic gradient MCMC samplers ( SG-MCMC ) have been proposed , including stochastic gradient HMC ( SGHMC ) ( Chen et al. , 2014 ) , stochastic gradient Riemannian Langevin dynamics ( SGRLD ) ( Patterson & Teh , 2013 ) , Ahn et al . ( 2012 ) , Ding et al . ( 2014 ) , and Zhang et al . ( 2020 ) . Ma et al . ( 2015 ) further design a complete framework for constructing SG-MCMC . Machine unlearning . Machine unlearning aims to remove the knowledge learned from specific data in efficient manners ( Cao & Yang , 2015 ) . Existing unlearning methods can be roughly divided into two categories , exact methods and approximate methods . Exact methods aim to recover the model that trained without the removed data exactly , which therefore are usually realized by reducing the retraining cost as much as possible . For example , Ginart et al . ( 2019 ) propose an efficient unlearning method for k-means clustering via model parameter quantization . Bourtoule et al . ( 2021 ) propose a SISA framework that would only retraining the affected part of the model during data deletion . Other advances of exact machine unlearning include Ullah et al . ( 2021 ) and Brophy & Lowd ( 2021 ) . On the other hand , the approximate method aims to modify the trained model to approximate that trained only on the remaining data . A series of works are designed via characterizing the influence of data on the trained model with influence functions ( Cook & Weisberg , 1982 ; Huber , 2004 ; Koh & Liang , 2017 ) , including Guo et al . ( 2020 ) , Golatkar et al . ( 2020 ) , and Golatkar et al . ( 2021 ) . Other approaches include Baumhauer et al . ( 2020 ) and Izzo et al . ( 2021 ) . Some works have also studied machine unlearning in Bayesian inference ( Nguyen et al. , 2020 ; Gong et al. , 2021 ) . However , these works only focus on variational inference , an optimization-based Bayesian inference method , and could not be applied to sampling-based Bayesian inference , MCMC . In contrast , our approach is the first machine unlearning method for MCMC , with a theoretical knowledge removal guarantee . 3 PRELIMINARIES . Suppose p ( z|θ ) is a parameterized distribution over the sample space Z , where θ ∈ Θ ⊂ Rd is the parameter with a prior distribution p ( θ ) . Suppose S = { z1 , z2 , · · · , zN } is a dataset consists of N samples , where each sample zi ∈ Z is drawn from the parameterized distribution p ( z|θ ) , i.e. , zi ∼ p ( z|θ ) . Bayesian inference aims to infer the posterior distribution p ( θ|S ) of the parameter θ , p ( θ|S ) = p ( θ ) ∏N i=1 p ( zi|θ ) ∫ p ( θ ) ∏N i=1 p ( zi|θ ) dθ . For simplicity , for the given dataset S , we let pS denotes the true posterior distribution p ( θ|S ) , and p̂S denotes the posterior distribution that inferred by Bayesian inference . Usually , the denominator of the posterior pS has no closed-form solution , which barriers directly calculating the posterior distribution . Thereby , researchers have designed methods to approximate the target posterior . A canonical approach is the sampling-based Bayesian inference method , Markov chain Monte Carlo ( MCMC ) ( Hastings , 1970 ) . MCMC infers a posterior distribution via first constructs a Markov chain and then draws samples according to the state of the chain . When the target posterior is the stationary distribution of the Markov chain , it is proved that the drawn samples will converge to that from the target posterior . However , MCMC methods usually suffer from scalable issues on large-scale datasets . To this end , stochastic gradient MCMC ( SG-MCMC ) ( Ma et al. , 2015 ) leverage mini-batch estimation ( Robbins & Monro , 1951 ) to enable scalable sampling . In SG-MCMC , the posterior distribution p ( θ|S ) can be rewritten as p ( θ|S ) ∝ exp ( −U ( θ ) ) , where U ( θ ) is the potential function defined as U ( θ ) = − ∑ zi∈S log p ( zi|θ ) − log p ( θ ) . In each sampling step , drawing samples with SG-MCMC requires one to estimate the potential function U ( θ ) with mini-batch data S̃ ⊂ S as follows , Ũ ( θ ) = −|S| |S̃| ∑ zi∈S̃ log p ( zi|θ ) − log p ( θ ) . Typical SG-MCMC methods include SGLD and SGHMC . Stochastic gradient Langevin dynamics ( SGLD ) ( Welling & Teh , 2011 ) inserts Gaussian noise to stochastic gradients . In each sampling step , SGLD updates the posterior sample θt as follows , θt+1 = θt − ηt∇θŨ ( θt ) + 2 √ ηtW , where W is drawn from the standard Gaussian distribution N ( 0 , I ) and ηt > 0 is the step size . To improve the sampling efficiency of SGLD , stochastic gradient Hamiltonian Monte Carlo ( SGHMC ) ( Chen et al. , 2014 ) inserts a momentum vt into the posterior sample update as below , θt+1 = θt + vt , vt+1 = ( 1− α ) vt − ηt∇θŨ ( θt ) + √ 2αηtW , where W is also drawn from the Gaussian distribution N ( 0 , I ) , ηt > 0 is the step size , and α ∈ ( 0 , 1 ) is the momentum factor . The initial momentum term v0 is drawn from the Gaussian distribution N ( 0 , η0I ) . To ensure the drawn samples converge to the targeted posterior , the step size ηt for both SGLD and SGHMC needs to satisfy ( Welling & Teh , 2011 ) : ( 1 ) ∑∞ t=1 ηt = ∞ ; and ( 2 ) ∑∞ t=1 η 2 t < ∞ . A typical step size schedule is ηt = a ( b+ t ) −r , where a , b > 0 and r ∈ ( 0.5 , 1 ] .

Summary: This paper approaches the problem of how to make a machine learning model forgets some data samples it was trained on. This is of high relevance in the context of “the right to be forgotten” legislation. In this case, this work approaches this problem for machine learning models represented as Markov Chain Monte Carlo, which is of relevance in the context of Bayesian learning. The presented approach is based on the formalization of the problem as an optimization problem. Authors also provide theoretical guarantees that the presented approach really makes the Markov Chain Monte Carlo forgets a given set of samples.