Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee...

102
Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina, E.J. Gallego Arias, A.Gordon,…

Transcript of Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee...

Page 1: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Marco GaboardiUniversity of Dundee

Verifying Differentially Private Bayesian Inference

Joint work with G. Barthe, G.P. Farina, E.J. Gallego Arias, A.Gordon,…

Page 2: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Differentially Private vs Probabilistic Inference

DifferentialPrivacy

ProbabilisticInference

Page 3: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Differentially Private vs Probabilistic Inference

DifferentialPrivacy

ProbabilisticInference

The goal in machine learning is very often similar to the goal in private data analysis. The learner typically wishes to learn some simple rule that explains a data set. However, she wishes this rule to generalize […] Generally, this means that she wants to learn a rule that captures distributional information about the data set on hand, in a way that does not depend too specifically on any single data point.

C. Dwork & A. Roth - The algorithmic Foundations of Differential privacy

Page 4: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Outline

• Bayesian learning

• A language for bayesian learning

• Differential Privacy

• Combining differential privacy and bayesian learning

Page 5: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Bayesian Inference

Page 6: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Probabilistic Inference

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Fun/TabularData

Page 7: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Bayes theorem

Bayes’ theorem

� � � � � �� �

P | PP |

Px y y

y xx

We have just (perhaps without realising it) derived and used Bayes’ theorem to solve a problem.

It inverts a conditional.It follows directly from the product rule.

AC50001 - Introduction to machine learning and data mining - Marco Gaboardi - 2014

� � � � � � � � � �P , P | P P | Px y x y y y x x

Page 8: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Bayes theorem

Bayes’ theorem

� � � � � �� �

P | PP |

Px y y

y xx

We have just (perhaps without realising it) derived and used Bayes’ theorem to solve a problem.

It inverts a conditional.It follows directly from the product rule.

AC50001 - Introduction to machine learning and data mining - Marco Gaboardi - 2014

� � � � � � � � � �P , P | P P | Px y x y y y x x

PriorPosterior

NormalizationFactor

Model

Page 9: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

A simple example: bias of a coin

ID disease1 02 13 04 15 16 17 08 19 …

Page 10: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Bayes theorem

Bayes’ theorem

� � � � � �� �

P | PP |

Px y y

y xx

We have just (perhaps without realising it) derived and used Bayes’ theorem to solve a problem.

It inverts a conditional.It follows directly from the product rule.

AC50001 - Introduction to machine learning and data mining - Marco Gaboardi - 2014

� � � � � � � � � �P , P | P P | Px y x y y y x x

PriorPosterior Model

Page 11: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Model/Likelihood: Bernoulli

y = (0,1,0,1,1,1,…,0)Observed values

Page 12: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Model/Likelihood: Bernoulli

The probability mass function f(s,Θ) is

where Θ is the “bias of the coin”. This can also be expressed as:

f(s,Θ) = Θ if s = 1{ 1 - Θ if s = 0

f(s,Θ) = Θs(1-Θ)1-s

y = (0,1,0,1,1,1,…,0)Observed values

Page 13: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Prior: Beta distribution

f(a,b,Θ) = Θa(1-Θ)b

Probability Distribution Function

B(a,b)

Conjugate to the Bernoulli distribution

Page 14: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Prior: Beta distribution

Page 15: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Bias of a Coin

Beta(2500,500)Beta(1500,1500)

Page 16: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Another example

ID Cholesterol1 4.662 5.013 3.45 4 4.12 5 6.35 6 4.45 7 6.068 4.98 9 …

Known variance

Page 17: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Another example

ID Y X1 4.2 1.5 2 2.5 0.2 3 2.2 24 1.1 6.5 5 1.5 8.26 0.5 5.6 7 2.0 2.3 8 0.8 4.3 9 … …

Page 18: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Graphical ModelsID

disease1 02 13 04 15 16 17 08 19 …

Page 19: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Probabilistic PCF

Page 20: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Probabilistic Semantics

Page 21: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Observe for Conditional Distributions

observe z ⇒ X(z) in Y

Page 22: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Observe for Conditional Distributions

observe z ⇒ X(z) in Y Bayes’ theorem

� � � � � �� �

P | PP |

Px y y

y xx

We have just (perhaps without realising it) derived and used Bayes’ theorem to solve a problem.

It inverts a conditional.It follows directly from the product rule.

AC50001 - Introduction to machine learning and data mining - Marco Gaboardi - 2014

� � � � � � � � � �P , P | P P | Px y x y y y x x

Page 23: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Semantics of Observe

Page 24: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Semantics of Observe

Filter and rescaling

Page 25: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Semantics of Observe

Filter and rescaling

Page 26: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Differential Privacy

Page 27: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Private Queries?

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Page 28: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Private Queries?

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

medicalcorrelation?

queryanswer

Page 29: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Private Queries?

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

answer

query

Does Critias have

cancer?

Page 30: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Private Queries?

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

answer

query

Does Critias have

cancer?

I know he visited Atlantis

From Plato’s Timaeus dialogue

Page 31: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Private Queries?

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Does Critias have

cancer?

I know he visited Atlantis

From Plato’s Timaeus dialogue

Page 32: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Differential Privacy

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Page 33: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Differential Privacy

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

query

answer + noise

medicalcorrelation?

Page 34: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Differential Privacy

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

answer + noise

query

?!?

Page 35: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: motivation

A. Haeberlen

Motivation: Protecting privacy

2USENIX Security (August 12, 2011)

19144 02-15-1964 flue

19146 05-22-1955 brain tumor

34505 11-01-1988 depression

25012 03-12-1972 diabets

16544 06-14-1956 anemia

...

Fair insurance

plan?

Resend

policy?

DataI know Bob is

born 05-22-1955

in Philadelphia…

A first approach: anonymization.I Using different correlated anonymized data sets one

can learn private data.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

?!?

Differential Privacy

Page 36: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

(ε,δ)-Differential Privacy

Definition Given ε,δ ≥ 0, a probabilistic query Q: db → R is (ε,δ)-differentially private iff ∀b1, b2:db differing in one row and for every S⊆R:

Pr[Q(b1)∈ S] ≤ exp(ε)· Pr[Q(b2)∈ S] + δ

Page 37: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

(ε,δ)-Differential Privacy

Definition Given ε,δ ≥ 0, a probabilistic query Q: db → R is (ε,δ)-differentially private iff ∀b1, b2:db differing in one row and for every S⊆R:

Pr[Q(b1)∈ S] ≤ exp(ε)· Pr[Q(b2)∈ S] + δ

A query returning a probability distribution

Page 38: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

(ε,δ)-Differential Privacy

Definition Given ε,δ ≥ 0, a probabilistic query Q: db → R is (ε,δ)-differentially private iff ∀b1, b2:db differing in one row and for every S⊆R:

Pr[Q(b1)∈ S] ≤ exp(ε)· Pr[Q(b2)∈ S] + δ

Privacy parameters

Page 39: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

(ε,δ)-Differential Privacy

Definition Given ε,δ ≥ 0, a probabilistic query Q: db → R is (ε,δ)-differentially private iff ∀b1, b2:db differing in one row and for every S⊆R:

Pr[Q(b1)∈ S] ≤ exp(ε)· Pr[Q(b2)∈ S] + δ

a quantification over all the databases

Page 40: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

(ε,δ)-Differential Privacy

Definition Given ε,δ ≥ 0, a probabilistic query Q: db → R is (ε,δ)-differentially private iff ∀b1, b2:db differing in one row and for every S⊆R:

Pr[Q(b1)∈ S] ≤ exp(ε)· Pr[Q(b2)∈ S] + δ

a notion of adjacency or distance

Page 41: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

(ε,δ)-Differential Privacy

Definition Given ε,δ ≥ 0, a probabilistic query Q: db → R is (ε,δ)-differentially private iff ∀b1, b2:db differing in one row and for every S⊆R:

Pr[Q(b1)∈ S] ≤ exp(ε)· Pr[Q(b2)∈ S] + δ

and over all the possible outcomes

Page 42: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ε-Differential PrivacyDefinition Given ε ≥ 0, a probabilistic query Q: db → R is ε-differentially private iff ∀b1, b2:db differing in one row and for every S⊆R:

Pr[Q(b1)∈ S] ≤ exp(ε)· Pr[Q(b2)∈ S]

Page 43: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Let’s substitute a concrete instance:

Let’s use the two quantifiers:exp(-ε)· Pr[Q(b)∈ S] ≤ Pr[Q(b∪{x})∈ S] ≤ exp(ε)· Pr[Q(b)∈ S]

Definition Given ε ≥ 0, a probabilistic query Q: db → R is ε-differentially private iff ∀b1, b2:db differing in one row and for every S⊆R:

Pr[Q(b1)∈ S] ≤ exp(ε)· Pr[Q(b2)∈ S]

Pr[Q(b∪{x})∈ S] ≤ exp(ε)· Pr[Q(b)∈ S]

ε-Differential Privacy

Pr[Q(b∪{x})∈S] Pr[Q(b)∈S]log ≤ε

and so:

Page 44: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Q : db => R probabilistic

Q(b) Q(b∪{x})

ε-Differential Privacy

Page 45: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ε-Differential PrivacyPr[Q(b∪{x})∈S]

Pr[Q(b) ∈ S]log ≤ε

Page 46: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Probability of a bad event∫BQ(b∪{x}) ∫BQ(b)

log ≤ε

Page 47: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Probability of a bad eventDataset bad

eventwithout my data 16%

with my data 16.3%

Page 48: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Pr[Q(b’)∈S] ≦ eε Pr[Q(b) ∈ S] + δ

(ε,δ)-Differential privacy

for b ~1 b’

Page 49: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Pr[Q(b’)∈S] ≦ eε Pr[Q(b) ∈ S] + δ

(ε,δ)-Differential privacy

for b ~1 b’

Program

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Noise

+Differentially Private Program

Page 50: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

PP Result

Sensitivity

PP Result’

+

Page 51: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

PP Result

Sensitivity

PP Result’

+

Sensitivity

≤K

Page 52: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Calibrating the Noise on the Sensitivity

Program

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Noise( )

+k sensitive

ε-Differentially Private Program

εk

Page 53: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

• Relational Refinement Types

• Higher Order Refinements

• Partiality Monad

• Semantic Subtyping

• Approximate Equivalence for Distributions

Components

HOARe2: Higher Order Approximate Relational Refinement Types for DP

Barthe et al,POPL’15

Page 54: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

HOARe2: Higher Order Approximate Relational Refinement Types for DP

Page 55: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

• Relational Refinement Types

• Higher Order Refinements

• Partiality Monad

• Semantic Subtyping

• Approximate Equivalence for Distributions

Components

Barthe et al,POPL’15

reasoning about two runs of a program

HOARe2: Higher Order Approximate Relational Refinement Types for DP

Page 56: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Program Logic

Program PX Y

Page 57: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Program P

Precondition Postcondition

X Y

Program Logic

Page 58: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Program P

Precondition Postcondition

X Y

x ≥ 0 y ≥ 1

Program Logic

exp

Page 59: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Program P Precondition Postcondition→

Refinement Type

P : {x | Pre(x)} → {y | Post(y)}

Page 60: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

LogicalPredicates

Program P Precondition Postcondition→

Refinement Type

P : {x | Pre(x)} → {y | Post(y)}

Page 61: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Program P Precondition Postcondition→

exp : {x | x ≥ 0} → {y | y ≥ 1}Example

Refinement Type

P : {x | Pre(x)} → {y | Post(y)}

Page 62: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Program P

Precondition Postcondition

X1 Y1

Program PX2 Y2

Differential privacy as a Relational Property

Page 63: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Program P

Precondition Postcondition

X1 Y1

Program PX2 Y2

X1 and X2 differs for the presence or

absence of an individual

Pr[Y1∈ S] ≤ exp(ε)· Pr[Y2∈ S]

Differential privacy as a Relational Property

Page 64: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

P : {x | Pre(x1,x2)} → {y | Post(y1,y2)}

Program P Precondition Postcondition→

HOARe2:

Relational Refinement Types

Page 65: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

P : {x | Pre(x1,x2)} → {y | Post(y1,y2)}

Program P Precondition Postcondition→

HOARe2:

Relational Refinement Types

LogicalRelations

Page 66: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

P : {x | Pre(x1,x2)} → {y | Post(y1,y2)}

Program P Precondition Postcondition→

HOARe2:

Relational Refinement Types

exp : {x | x1 ≤ x2 } → {y | y1 ≤ y2}Example: Monotonicity of exponential

Page 67: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

• Relational Refinement Types

• Higher Order Refinements

• Partiality Monad

• Semantic Subtyping

• Approximate Equivalence for Distributions

Components

Barthe et al,POPL’15

reasoning about DP

HOARe2: Higher Order Approximate Relational Refinement Types for DP

Page 68: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Lifting of P

P(x1,x2) P*(x1,x2)

Relation over distributionsRelation

Page 69: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

iff it exists a dist. μ over AxB s.t.

• μ(x) > 0 implies x∈R

• 𝞹1μ ≦ μ1 and 𝞹2μ ≦ μ2

Lifting of P

• Given dist. μ1 over A and μ2 over B:

μ1 P* μ2

Page 70: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

iff it exists a dist. μ over AxB s.t.

• μ(x) > 0 implies x∈R

• 𝞹1μ ≦ μ1 and 𝞹2μ ≦ μ2

• maxA(𝞹iμ(A) - eε μi(A), μi(A) - eε 𝞹iμ(A)) ≦ δ

(ε,δ)-Lifting of P

• Given dist. μ1 over A and μ2 over B:

μ1 P* μ2εδ

Page 71: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Verifying Differential Privacy

C:{x:db|d(y1,y2)≦1}!{y:O|y1 =* y2}

If we can conclude

then C is (ε,δ)-differentially private.

εδ

Page 72: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Programming Languages forDifferentially Private Probabilistic Inference

DifferentialPrivacy

ProbabilisticInference

Page 73: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Programming Languages forDifferentially Private Probabilistic Inference

DifferentialPrivacy

ProbabilisticInference

ProgrammingLanguage

Tools

Page 74: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Adding noise

Page 75: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Adding noise

Program

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Noise

+Differentially Private Program

Probabilistic

Page 76: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Adding noise

Page 77: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Adding noise

Page 78: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

Page 79: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Page 80: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Page 81: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noiseDifferential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Page 82: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Page 83: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

Page 84: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

ProbabilisticInference

Page 85: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

ProbabilisticInference

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Page 86: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

ProbabilisticInference

Page 87: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

ProbabilisticInference

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Page 88: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise on the data

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

ProbabilisticInference

Page 89: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

An examplefunction privBerInput (l: B list) (p1: R) (p2: R): M[(0,1)]{ let function vExp (l: B list) : M[B list]{ match l with |nil -> mreturn nil |x::xs -> coercion (exp eps((0,0)->1,(0,1)->0,(1,1)->1, (1,0)->0) x) :: (vExp l) } in mlet nl = (vExp l) in let prior = mreturn(beta(p1,p2)) in let function Ber (l: B list) (p:M[(0,1)]): M[(0,1)]{ match l with |nil -> ran(p) |x::xs -> observe y => y = x in (Ber xs p) } in mreturn(infer (Ber nl prior)) }

Page 90: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

An examplefunction privBerInput (l: B list) (p1: R) (p2: R): M[(0,1)]{ let function vExp (l: B list) : M[B list]{ match l with |nil -> mreturn nil |x::xs -> coercion (exp eps((0,0)->1,(0,1)->0,(1,1)->1, (1,0)->0) x) :: (vExp l) } in mlet nl = (vExp l) in let prior = mreturn(beta(p1,p2)) in let function Ber (l: B list) (p:M[(0,1)]): M[(0,1)]{ match l with |nil -> ran(p) |x::xs -> observe y => y = x in (Ber xs p) } in mreturn(infer (Ber nl prior)) }

Noise

Page 91: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

Adding noise on the output

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

ProbabilisticInference

Page 92: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

DP for Probabilistic Programs

PosteriorDistribution

Page 93: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

DP for Probabilistic Programs

PosteriorDistribution

Releasing theParameters

Page 94: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

DP for Probabilistic Programs

PosteriorDistribution

Releasing theParameters

Sampling fromthe Distribution

Page 95: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

DP for Probabilistic Programs

PosteriorDistribution

Releasing theParameters

Sampling fromthe Distribution

Page 96: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

An exampleA distance over distributions

function privBerInput (l: B list) (p1: R) (p2: R): M[(0,1)]{ let function hellingerDistance (a0:R) (b0:R) (a1:R) (b1:R) : R { let gamma (r:R) = (r-1)! in let betaf (a:R) (b:R) = gamma(a)*gamma(b))/gamma(a+b) in let num=betaf ((a0+a1)/2.0) ((b0+b1)/2.0) in let denum=Math.Sqrt((betaf a0 b0)*(betaf a1 b1)) in Math.Sqrt(1.0-(num/denum)) } in let function score (input:M[(0,1)]) (output:M[(0,1)]) : R { let beta(a0,b0) = input in let beta(a1,b1) = output in (-1.0) * (hellingerDistance a0 b0 a1 b1) } in let prior = mreturn(beta(p1,p2)) in let function Ber (l: B list) (p:M[(0,1)]): M[(0,1)]{ match l with |nil -> ran(p) |x::xs -> observe y => y = x in (Ber xs p) } in exp eps score (infer (Ber l prior)) }

Page 97: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Noise

An exampleA distance over distributions

function privBerInput (l: B list) (p1: R) (p2: R): M[(0,1)]{ let function hellingerDistance (a0:R) (b0:R) (a1:R) (b1:R) : R { let gamma (r:R) = (r-1)! in let betaf (a:R) (b:R) = gamma(a)*gamma(b))/gamma(a+b) in let num=betaf ((a0+a1)/2.0) ((b0+b1)/2.0) in let denum=Math.Sqrt((betaf a0 b0)*(betaf a1 b1)) in Math.Sqrt(1.0-(num/denum)) } in let function score (input:M[(0,1)]) (output:M[(0,1)]) : R { let beta(a0,b0) = input in let beta(a1,b1) = output in (-1.0) * (hellingerDistance a0 b0 a1 b1) } in let prior = mreturn(beta(p1,p2)) in let function Ber (l: B list) (p:M[(0,1)]): M[(0,1)]{ match l with |nil -> ran(p) |x::xs -> observe y => y = x in (Ber xs p) } in exp eps score (infer (Ber l prior)) }

Page 98: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Noise

An exampleA distance over distributions

function privBerInput (l: B list) (p1: R) (p2: R): M[(0,1)]{ let function hellingerDistance (a0:R) (b0:R) (a1:R) (b1:R) : R { let gamma (r:R) = (r-1)! in let betaf (a:R) (b:R) = gamma(a)*gamma(b))/gamma(a+b) in let num=betaf ((a0+a1)/2.0) ((b0+b1)/2.0) in let denum=Math.Sqrt((betaf a0 b0)*(betaf a1 b1)) in Math.Sqrt(1.0-(num/denum)) } in let function score (input:M[(0,1)]) (output:M[(0,1)]) : R { let beta(a0,b0) = input in let beta(a1,b1) = output in (-1.0) * (hellingerDistance a0 b0 a1 b1) } in let prior = mreturn(beta(p1,p2)) in let function Ber (l: B list) (p:M[(0,1)]): M[(0,1)]{ match l with |nil -> ran(p) |x::xs -> observe y => y = x in (Ber xs p) } in exp eps score (infer (Ber l prior)) }

Page 99: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

More general Lifting of P

P(x1,x2) P*(x1,x2)

Relation over distributionsRelation

Page 100: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Accuracy

Different ways of adding noise can have differentaccuracy.- we have theoretical accuracy (how to integrate it

in a framework for reasoning about DP?)- we have experimental accuracy (we need a

framework for for test our programs)

Page 101: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

ProgramProbabilistic

PriorDistribution

PosteriorDistribution

A Nice Playground!

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

ProbabilisticInference

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Differential Privacy: the idea

A. Haeberlen

Promising approach: Differential privacy

3USENIX Security (August 12, 2011)

Private data

N(flue, >1955)?

826±10

N(brain tumor, 05-22-1955)?

3 ±700

Noise

?!?

Differential Privacy:Ensuring that the presence/absence of an individual has anegligible statistical effect on the query’s result.

Trade-off between utility and privacy.

Page 102: Bayesian Inferencetarmo/tsem15/gaboardi0312-slides.pdf · Marco Gaboardi University of Dundee Verifying Differentially Private Bayesian Inference Joint work with G. Barthe, G.P. Farina,

Tänan teid väga!