Differentially Private Bayesian Programming
Total Page:16
File Type:pdf, Size:1020Kb
Differentially Private Bayesian Programming ˚ Gilles Barthe Gian Pietro Farina IMDEA Software University at Buffalo ˚ Marco Gaboardi Emilio Jesús Gallego Arias Andy Gordon University at Buffalo CRI Mines-ParisTech Microsoft Research : Justin Hsu Pierre-Yves Strub University of Pennsylvania IMDEA Software ABSTRACT of tools for differentially private data analysis. Many of these We present PrivInfer, an expressive framework for writing tools use programming language techniques to ensure that and verifying differentially private Bayesian machine learning the resulting programs are indeed differentially private [2– algorithms. Programs in PrivInfer are written in a rich func- 4, 6, 19–21, 29, 33]. Moreover, property (2) has encouraged tional probabilistic programming language with constructs the interaction of the differential privacy community with the for performing Bayesian inference. Then, differential pri- machine learning community to design privacy-preserving vacy of programs is established using a relational refinement machine learning techniques, e.g. [12, 18, 25, 39]. At the same type system, in which refinements on probability types are time, researchers in probabilistic programming are exploring indexed by a metric on distributions. Our framework lever- programming languages as tools for machine learning. For ages recent developments in Bayesian inference, probabilistic example, in Bayesian inference, probabilistic programming programming languages, and in relational refinement types. allows data analysts to represent the probabilistic model, its We demonstrate the expressiveness of PrivInfer by verifying parameters, and the data observations as a specially crafted privacy for several examples of private Bayesian inference. program. Given this program as input, we can then use inference algorithms to produce a distribution over the pa- rameters of the model representing our updated beliefs on 1. INTRODUCTION them. Several works have explored the design of program- Differential privacy [17] is emerging as a gold standard in ming languages to compute efficiently the updated beliefs data privacy. Its statistical guarantee ensures that the prob- in order to produce efficient and usable tools for machine ability distribution on outputs of a data analysis is almost learning, e.g. [22, 24, 28, 31, 32, 36]. the same as the distribution on outputs obtained by per- Recently, research in Bayesian inference and machine forming the same data analysis on a (hypothetical) dataset learning has turned to privacy-preserving Bayesian infer- differing in one individual. A standard way to ensure dif- ence [15, 38, 40, 41], where the observed data is private. ferential privacy is by perturbing the data analysis adding Bayesian inference is a deterministic process, and directly some statistical noise. The magnitude and the shape of noise releasing the posterior distribution would violate differential must provide a protection to the influence of an individual privacy. Hence, researchers have developed techniques to on the result of the analysis, while ensuring that the algo- make Bayesian inference differentially private. Basic tech- rithm provides useful results. Two properties of differential niques add noise on the input data, or add noise on the privacy are especially relevant for this work: (1) composabil- result of the data analysis, while more advanced techniques ity, (2) the fact that differential privacy works well on large can ensure differential privacy by releasing random samples datasets, where the presence or absence of an individual has from the posterior distribution instead of releasing the pos- limited impact. These two properties have led to the design terior distribution itself. The diversity of approaches makes ˚ Bayesian inference an attractive target for verification tools Partially supported by NSF grants CNS1237235, for differential privacy. CNS1565365 and by EPSRC grant EP/M022358/1. : In this work we present PrivInfer, a programming frame- Partially supported by NSF grants TC-065060 and TWC- work combining verification techniques for differential privacy 1513694, and a grant from the Simons Foundation (#360368 with learning techniques for Bayesian inference. PrivInfer to Justin Hsu). consists of two main components: a probabilistic functional Permission to make digital or hard copies of all or part of this work for personal or language extending PCF for Bayesian inference, and a rela- classroom use is granted without fee provided that copies are not made or distributed tional higher-order type system that can verify differential for profit or commercial advantage and that copies bear this notice and the full citation privacy for programs written in this language. on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or The core idea of Bayesian learning is to use conditional republish, to post on servers or to redistribute to lists, requires prior specific permission distributions to represent the beliefs updated after some and/or a fee. Request permissions from [email protected]. observations. PrivInfer, similarly to other programming lan- CCS’16, October 24 - 28, 2016, Vienna, Austria guages for inference models conditioning on data explicitly © 2016 Copyright held by the owner/author(s). Publication rights licensed to ACM. using an observe statement. An interesting aspect of Bayesian ISBN 978-1-4503-4139-4/16/10. $15.00 inference is that although the inferred output is a probability DOI: http://dx.doi.org/10.1145/2976749.2978371 68 distribution, the process to generate it is deterministic. To ‚ A higher-order approximate relational type system for guarantee differential privacy, we need to inject some ran- reasoning about properties of two runs of programs from domness into the inference process. To handle these two roles PrivInfer (§ 5). In particular, the type system permits of distributions, PrivInfer distinguishes between symbolic dis- to reason about f-divergences. The f-divergences can tributions and actual distributions. The former represent the be used to reason about differential privacy as well as result of an inference, while the latter are used to represent about program sensitivity for Bayesian inference. random computations, e.g. differentially private computa- tions (mechanisms). Moreover, we parametrize our language ‚ We show on several examples how PrivInfer can be with an algorithm to perform Bayesian inference returning used to reason about differential privacy (§ 6). We will symbolic distributions, expressed by the statement infer,and explore three ways to guarantee differential privacy: mechanisms to ensure differential privacy returning actual by adding noise on the input, by adding noise on the distributions. output parameters based on p-norms, and by adding Differential privacy is a probabilistic 2-property, i.e. a noise on the output parameters based on f-divergences. property expressed over pairs of execution traces of the pro- gram. To address this challenge, we use an approach based on 2. BAYESIAN INFERENCE approximate relational higher-order refinement type system, 2 Our work is motivated by Bayesian inference,astatisti- like the ones used in the system HOARe [6]. cal method which takes a prior distribution Prpξq over a PrivInfer extends this approach to deal with the construc- parameter ξ and some observed data x, and produces the tions that are needed for Bayesian inference like the observe posterior distribution Prpξ | xq,anupdatedversionofthe and infer constructs and the distinction between symbolic prior distribution. Bayesian inference is based on Bayes’ and actual distributions. Another important aspect of the theorem, which gives a formula for the posterior distribution: verification of differential privacy is reasoning about the sen- Prpx | ξq¨Prpξq sitivity of a data analysis. This measures the influence that Prpξ | xq“ two databases differing in one individual can have on the Prpxq output. Calibrating noise to sensitivity ensures that the data The expression Prpx | ξq is the likelihood of ξ when x is analysis provides sufficient privacy. In Bayesian inference, observed. This is a function L pξq of the parameter ξ for the output of the computation is a distribution (often defined x fixed data x, describing the probability of observing the data by a few numeric parameters) for which one can consider dif- x given a specific value of the parameter ξ.Sincethedata ferent measures. A simple approach is to considered standard x is considered fixed, the expression Prpxq denotes a nor- metrics (Euclidean, Hamming, etc.) to measure the distance malization constant ensuring that Prpξ | xq is a probability between the parameters. Another more interesting approach distribution. The choice of the prior reflects the prior knowl- is to consider distances between distributions, rather than edge or belief on the parameter ξ before any observation has theparameters.ThetypesystemofPrivInfer allows one to been performed. In practice, the prior and the likelihood reason about the parameters of a distribution, using stan- are typically chosen so that the posterior belongs to the dard metrics, but also about the distribution itself using same family of distributions as the prior. In this case the f-divergences, a class of probability metrics including some prior is said to be conjugate prior for the likelihood. Using well known examples like total variation distance, Hellinger conjugate priors, besides being mathematically