Higher-Order Relational Refinement Types for Mechanism Design and - - PowerPoint PPT Presentation

higher order relational refinement types for mechanism
SMART_READER_LITE
LIVE PREVIEW

Higher-Order Relational Refinement Types for Mechanism Design and - - PowerPoint PPT Presentation

Higher-Order Relational Refinement Types for Mechanism Design and Differential Privacy Gilles Barthe 1 , Marco Gaboardi 2 , Emilio Jess Gallego Arias 3 , 4 , Justin Hsu 4 , Aaron Roth 4 , Pierre-Yves Strub 1 1 IMDEA Software, 2 University of


slide-1
SLIDE 1

Higher-Order Relational Refinement Types for Mechanism Design and Differential Privacy

Gilles Barthe1, Marco Gaboardi2, Emilio Jesús Gallego Arias3,4, Justin Hsu4, Aaron Roth4, Pierre-Yves Strub1

1IMDEA Software, 2University of Dundee, 3CRI Mines–ParisTech, 4University of Pennsylvania

January 15th, 2015

slide-2
SLIDE 2

The Application

Mechanism Design

slide-3
SLIDE 3

A story One painting for sale

slide-4
SLIDE 4

A story One painting for sale How much will you pay?

slide-5
SLIDE 5

A story One painting for sale How much will you pay?

$10 million! $50 million! $3

slide-6
SLIDE 6

A story One painting for sale How much will you pay?

$10 million! $50 million! $3

Who wins, and for how much?

slide-7
SLIDE 7

A story

Top bid pays top price?

  • Simple rule
  • Can encourage

manipulation...

How much will you pay?

$10 million! $50 million! $3

slide-8
SLIDE 8

A story

Top bid pays top price?

  • Simple rule
  • Can encourage

manipulation...

How much will you pay?

$10 million! $50 million! $10.1 million? $3

slide-9
SLIDE 9

What is Mechanism Design?

Algorithm design with strategic inputs

slide-10
SLIDE 10

What is Mechanism Design?

Algorithm design with strategic inputs

Rational agents

  • Report data
  • Care about output
  • May lie, strategize
slide-11
SLIDE 11

What is Mechanism Design?

Algorithm design with strategic inputs

Rational agents

  • Report data
  • Care about output
  • May lie, strategize

Goal: encourage “good” behavior

slide-12
SLIDE 12

Truthfulness

Designing auctions

  • Bidders each have personal value v : R for the item
slide-13
SLIDE 13

Truthfulness

Designing auctions

  • Bidders each have personal value v : R for the item
  • Bidder’s happiness is function of price, v, whether they win
slide-14
SLIDE 14

Truthfulness

Designing auctions

  • Bidders each have personal value v : R for the item
  • Bidder’s happiness is function of price, v, whether they win
  • Bidder reports a bid b : R to the mechanism
slide-15
SLIDE 15

Truthfulness

Designing auctions

  • Bidders each have personal value v : R for the item
  • Bidder’s happiness is function of price, v, whether they win
  • Bidder reports a bid b : R to the mechanism

Property: agent always maximizes happiness with b “ v

slide-16
SLIDE 16

A (very) simple auction

Fixed price auction

  • Given a fixed price price
  • Bidder bids bid, buys item if higher than price
slide-17
SLIDE 17

A (very) simple auction

Fixed price auction

  • Given a fixed price price
  • Bidder bids bid, buys item if higher than price

What is the happiness function for a bidder?

fixedprice price value bid = if bid > price then value

  • price

else

slide-18
SLIDE 18

The verification strategy

Consider bidder’s happiness function. . .

  • First run: bidder bids b “ v (honest)
slide-19
SLIDE 19

The verification strategy

Consider bidder’s happiness function. . .

  • First run: bidder bids b “ v (honest)
  • Second run: bidder bids arbitrarily (maybe not honest)
slide-20
SLIDE 20

The verification strategy

Consider bidder’s happiness function. . .

  • First run: bidder bids b “ v (honest)
  • Second run: bidder bids arbitrarily (maybe not honest)
  • Verify: happiness in first run is higher than in second run
slide-21
SLIDE 21

The verification strategy

Consider bidder’s happiness function. . .

  • First run: bidder bids b “ v (honest)
  • Second run: bidder bids arbitrarily (maybe not honest)
  • Verify: happiness in first run is higher than in second run
slide-22
SLIDE 22

The verification strategy

Consider bidder’s happiness function. . .

  • First run: bidder bids b “ v (honest)
  • Second run: bidder bids arbitrarily (maybe not honest)
  • Verify: happiness in first run is higher than in second run

fixedprice p v v = if v > p then v - p else

ě

fixedprice p v b = if b > p then v - p else

slide-23
SLIDE 23

The verification strategy

Consider bidder’s happiness function. . .

  • First run: bidder bids b “ v (honest)
  • Second run: bidder bids arbitrarily (maybe not honest)
  • Verify: happiness in first run is higher than in second run

fixedprice p v v = if v > p then v - p else

ě

fixedprice p v b = if b > p then v - p else

This is a relational property

slide-24
SLIDE 24

Introducing HOARe2

A type system with relational refinement types

slide-25
SLIDE 25

Refinement types

Judgment

Γ $ e : tx : T | φpxq u

type predicate

slide-26
SLIDE 26

Refinement types

Judgment

Γ $ e : tx : T | φpxq u

type predicate

slide-27
SLIDE 27

Refinement types

Judgment

Γ $ e : tx : T | φpxq u

type predicate

slide-28
SLIDE 28

Refinement types

Judgment

Γ $ e : tx : T | φpxq u

type predicate

“e is a program of type T such that φpeq holds”

slide-29
SLIDE 29

Refinement types

Example

Γ $ 3 : tx : Z | x ě 0u

slide-30
SLIDE 30

Refinement types

Example

Γ $ 3 : tx : Z | x ě 0u

“3 is a non-negative integer”

slide-31
SLIDE 31

Relational Reasoning

Relational Judgment Γ $ e :: tx :: T | φp xŸ, xŹ qu

slide-32
SLIDE 32

Relational Reasoning

Relational Judgment Γ $ e :: tx :: T | φp xŸ, xŹ qu

slide-33
SLIDE 33

Relational Reasoning

Relational Judgment Γ $ e :: tx :: T | φp xŸ, xŹ qu

φ mentions two runs of program e via xŸ and xŹ

slide-34
SLIDE 34

Relational Reasoning

Relational Judgment Γ $ e :: tx :: T | φp xŸ, xŹ qu

φ mentions two runs of program e via xŸ and xŹ Example

ty :: Z | yŸ ď yŹu $ e :: tx :: Z | xŸ ď xŹu

slide-35
SLIDE 35

Relational Reasoning

Relational Judgment Γ $ e :: tx :: T | φp xŸ, xŹ qu

φ mentions two runs of program e via xŸ and xŹ Example

ty :: Z | yŸ ď yŹu $ e :: tx :: Z | xŸ ď xŹu

“If y increases, then e increases.”

slide-36
SLIDE 36

Relational Reasoning

Relational Judgment Γ $ e :: tx :: T | φp xŸ, xŹ qu

φ mentions two runs of program e via xŸ and xŹ Example

ty :: Z | yŸ ď yŹu $ e :: tx :: Z | xŸ ď xŹu

“If y increases, then e increases.”

Background

  • First used in the RF* language, POPL 2014
slide-37
SLIDE 37

Typing truthfulness

Happiness function

fixedprice price value bid = if bid > price then value

  • price

else

slide-38
SLIDE 38

Typing truthfulness

Happiness function

fixedprice price value bid = if bid > price then value

  • price

else

Truthfulness in a type

slide-39
SLIDE 39

Typing truthfulness

Happiness function

fixedprice price value bid = if bid > price then value

  • price

else

Truthfulness in a type

tp :: R | pŸ “ pŹu (Fixed price)

slide-40
SLIDE 40

Typing truthfulness

Happiness function

fixedprice price value bid = if bid > price then value

  • price

else

Truthfulness in a type

tp :: R | pŸ “ pŹu (Fixed price) Ñ tv :: R | vŸ “ vŹu (Bidder value fixed)

slide-41
SLIDE 41

Typing truthfulness

Happiness function

fixedprice price value bid = if bid > price then value

  • price

else

Truthfulness in a type

tp :: R | pŸ “ pŹu (Fixed price) Ñ tv :: R | vŸ “ vŹu (Bidder value fixed) Ñ tb :: R | bŸ “ vŸu (Bid “ value on Ÿ run)

slide-42
SLIDE 42

Typing truthfulness

Happiness function

fixedprice price value bid = if bid > price then value

  • price

else

Truthfulness in a type

tp :: R | pŸ “ pŹu (Fixed price) Ñ tv :: R | vŸ “ vŹu (Bidder value fixed) Ñ tb :: R | bŸ “ vŸu (Bid “ value on Ÿ run) Ñ tu :: R | uŸ ě uŹu (Truthful)

slide-43
SLIDE 43

Adding in randomness

A more complex auction

  • Unlimited supply of items (e.g., music files)
  • Want to use fixedprice, but for what price?
slide-44
SLIDE 44

Adding in randomness

A more complex auction

  • Unlimited supply of items (e.g., music files)
  • Want to use fixedprice, but for what price?

Randomize!

A more realistic example

  • n average
slide-45
SLIDE 45

Adding in randomness

A more complex auction

  • Unlimited supply of items (e.g., music files)
  • Want to use fixedprice, but for what price?

Randomize!

A more realistic example

g1 g2

  • n average
slide-46
SLIDE 46

Adding in randomness

A more complex auction

  • Unlimited supply of items (e.g., music files)
  • Want to use fixedprice, but for what price?

Randomize!

A more realistic example

g1 g2

  • ptimal

price

  • ptimal

price

  • n average
slide-47
SLIDE 47

Adding in randomness

A more complex auction

  • Unlimited supply of items (e.g., music files)
  • Want to use fixedprice, but for what price?

Randomize!

A more realistic example

g1 g2

  • ptimal

price

  • ptimal

price

p1 p2

  • n average
slide-48
SLIDE 48

Adding in randomness

A more complex auction

  • Unlimited supply of items (e.g., music files)
  • Want to use fixedprice, but for what price?

Randomize!

A more realistic example

g1 g2

  • ptimal

price

  • ptimal

price

p1 p2

Verify: happiness higher when bid is true value

  • n average
slide-49
SLIDE 49

Adding in randomness

A more complex auction

  • Unlimited supply of items (e.g., music files)
  • Want to use fixedprice, but for what price?

Randomize!

A more realistic example

g1 g2

  • ptimal

price

  • ptimal

price

p1 p2

Verify: happiness higher when bid is true value

  • n average
slide-50
SLIDE 50

One key ingredient

Monotonicity of expectation

  • (One) Distribution µ over A
slide-51
SLIDE 51

One key ingredient

Monotonicity of expectation

  • (One) Distribution µ over A
  • Two functions f1, f2 : A Ñ R with

f1 x ě f2 x for all x : A

slide-52
SLIDE 52

One key ingredient

Monotonicity of expectation

  • (One) Distribution µ over A
  • Two functions f1, f2 : A Ñ R with

f1 x ě f2 x for all x : A

  • Then, fact about expected values:

Eµrf1s ě Eµrf2s f1 bigger than f2 on average

slide-53
SLIDE 53

One key ingredient

Monotonicity of expectation

  • (One) Distribution µ over A
  • Two functions f1, f2 : A Ñ R with

f1 x ě f2 x for all x : A

  • Then, fact about expected values:

Eµrf1s ě Eµrf2s f1 bigger than f2 on average

slide-54
SLIDE 54

Extending HOARe2

Distributions and Higher-order refinements

slide-55
SLIDE 55

Relating Distributions

Probabilistic programs

  • Reason about two runs of a probabilistic program
  • Use type of probability distributions
slide-56
SLIDE 56

Relating Distributions

Probabilistic programs

  • Reason about two runs of a probabilistic program
  • Use type of probability distributions

Typing distributions

Γ $ e :: M0,0rtx :: T | φpxŸ, xŹqus

slide-57
SLIDE 57

Relating Distributions

Probabilistic programs

  • Reason about two runs of a probabilistic program
  • Use type of probability distributions

Typing distributions

Γ $ e :: M0,0rtx :: T | φpxŸ, xŹqus

“e is a distribution over T, with two runs related by φ ”

???

slide-58
SLIDE 58

Relating Distributions

Probabilistic programs

  • Reason about two runs of a probabilistic program
  • Use type of probability distributions

Typing distributions

Γ $ e :: M0,0rtx :: T | φpxŸ, xŹqus

“e is a distribution over T, with two runs related by φ ”

???

slide-59
SLIDE 59

Equivalence of Distributions

Γ $ e :: M0,0rtx :: T | φpxŸ, xŹqus

What does this mean?

  • Convert relation φ to a relation φ# on distributions over T
  • Two runs of e related by φ# (as distributions!)
slide-60
SLIDE 60

Equivalence of Distributions

Example

Γ $ e :: M0,0rtx :: T | xŸ “ xŹ us

slide-61
SLIDE 61

Equivalence of Distributions

Example

Γ $ e :: M0,0rtx :: T | xŸ “ xŹ us

slide-62
SLIDE 62

Equivalence of Distributions

Example

Γ $ e :: M0,0rtx :: T | xŸ “ xŹ us

“e is a distribution over T that is identical in both runs”

slide-63
SLIDE 63

Equivalence of Distributions

Example

Γ $ e :: M0,0rtx :: T | xŸ “ xŹ us

“e is a distribution over T that is identical in both runs” Background

  • Proposed by Barthe, Köpf, Olmedo, Zanella
  • Generalizing 0, 0 to ε, δ models differential privacy
slide-64
SLIDE 64

Equivalence of Distributions

Example

Γ $ e :: M0,0rtx :: T | xŸ “ xŹ us

“e is a distribution over T that is identical in both runs” Background

  • Proposed by Barthe, Köpf, Olmedo, Zanella
  • Generalizing 0, 0 to ε, δ models differential privacy

Our contribution

  • Simplify and build into a type system
slide-65
SLIDE 65

Higher-Order Refinements

Refinements on functions

Γ $ e :: tf :: T Ñ U | φu

slide-66
SLIDE 66

Higher-Order Refinements

Refinements on functions

Γ $ e :: tf :: T Ñ U | φu

“e is a function from T to U that satisfies φ”

slide-67
SLIDE 67

Higher-Order Refinements

Refinements on functions

Γ $ e :: tf :: T Ñ U | φu

“e is a function from T to U that satisfies φ”

Our contribution

  • Consistency by carefully handling termination
slide-68
SLIDE 68

Higher-Order Refinements

Refinements on functions

Γ $ e :: tf :: T Ñ U | φu

“e is a function from T to U that satisfies φ”

Our contribution

  • Consistency by carefully handling termination
  • Show naïve treatment leads to inconsistency
slide-69
SLIDE 69

Expressing monotonicity of expectations

Want to show

E µ f1 ě E µ f2

In HOARe2, type E as. . .

M0,0rtx :: A | xŸ “ xŹus (Same distributions)

slide-70
SLIDE 70

Expressing monotonicity of expectations

Want to show

E µ f1 ě E µ f2

In HOARe2, type E as. . .

M0,0rtx :: A | xŸ “ xŹus (Same distributions) Ñ tf :: A Ñ R | @x. fŸ x ě fŹ xu (Higher-order)

slide-71
SLIDE 71

Expressing monotonicity of expectations

Want to show

E µ f1 ě E µ f2

In HOARe2, type E as. . .

M0,0rtx :: A | xŸ “ xŹus (Same distributions) Ñ tf :: A Ñ R | @x. fŸ x ě fŹ xu (Higher-order) Ñ te :: R | eŸ ě eŹu (Monotonic)

slide-72
SLIDE 72

Expressing monotonicity of expectations

Want to show

E µ f1 ě E µ f2

In HOARe2, type E as. . .

E :: M0,0rtx :: A | xŸ “ xŹus (Same distributions) Ñ tf :: A Ñ R | @x. fŸ x ě fŹ xu (Higher-order) Ñ te :: R | eŸ ě eŹu (Monotonic)

slide-73
SLIDE 73

Much more in the paper

Semantics

  • Soundness of the system
  • Requires termination

Implementation

  • Automated, low annotation burden
  • Why3 and SMT solvers

Translation

  • Embedding of DFuzz, a language for differential privacy

More complex examples

  • Verify differential privacy
  • Verify MD properties beyond truthfulness
slide-74
SLIDE 74

Takeaway points

slide-75
SLIDE 75

Wrapping up

Four features, one system

  • HOARe2: relational properties for randomized programs
  • Combine features in a clean, usable way
slide-76
SLIDE 76

Wrapping up

Four features, one system

  • HOARe2: relational properties for randomized programs
  • Combine features in a clean, usable way

Formal verification for mechanism design!

  • Exciting, under-explored area for verification
  • Tons of interesting properties, mechanisms
  • Strong motivation besides (mere) correctness
slide-77
SLIDE 77

Higher-Order Relational Refinement Types for Mechanism Design and Differential Privacy

Gilles Barthe1, Marco Gaboardi2, Emilio Jesús Gallego Arias3,4, Justin Hsu4, Aaron Roth4, Pierre-Yves Strub1

1IMDEA Software, 2University of Dundee, 3CRI Mines–ParisTech, 4University of Pennsylvania

January 15th, 2015