Cryptanalytic Extraction of Neural Network Models Nicholas Carlini 1 - - PowerPoint PPT Presentation

cryptanalytic extraction of neural network models
SMART_READER_LITE
LIVE PREVIEW

Cryptanalytic Extraction of Neural Network Models Nicholas Carlini 1 - - PowerPoint PPT Presentation

Cryptanalytic Extraction of Neural Network Models Nicholas Carlini 1 , Matthew Jagielski 12 , Ilya Mironov 13 1 Google, 2 Northeastern, 3 Facebook Solve For W Given: Given: Given: CAT Our Question: Given query access to a neural network,


slide-1
SLIDE 1

Cryptanalytic Extraction

  • f Neural Network Models

Nicholas Carlini1, Matthew Jagielski12, Ilya Mironov13

1Google, 2Northeastern, 3Facebook

slide-2
SLIDE 2

W

Given: Given: Given: Solve For

CAT

slide-3
SLIDE 3

Our Question:

Given query access to a neural network, can we extract the hidden parameters?

slide-4
SLIDE 4

Two views of the problem

Machine Learning (function approximation) Mathematical (direct analysis)

slide-5
SLIDE 5

Our Question:

Given query access to a neural network, can we extract the hidden parameters?

slide-6
SLIDE 6

Our Result: Yes.*

* For small fully connected neural networks with ReLU activations with a few layers evaluated in float64 precision and fully precise inputs and outputs as long as the network isn't pathologically worst-case (e.g., a reduction from 3-SAT) and even then we can only get functional equivalence because exact extraction is provably impossible and even then we only get up to 40 bits of precision when we could theoretically hope for up to 56 bits of precision with float64.

slide-7
SLIDE 7

Neural Networks 101

slide-8
SLIDE 8
slide-9
SLIDE 9

x y x y x y

slide-10
SLIDE 10

x y x y x y h1 h2 h3

slide-11
SLIDE 11

h1 h2 h3 h1 h2 h3 h1 h2 h3

slide-12
SLIDE 12

h1 h2 h3 h1 h2 h3 h1 h2 h3

slide-13
SLIDE 13

h4 h5 h6

slide-14
SLIDE 14

h4 h5 h6

slide-15
SLIDE 15

z

slide-16
SLIDE 16
slide-17
SLIDE 17

Σ a1 a2 x1 x2

slide-18
SLIDE 18

Σ x1 x2 a1 a2

slide-19
SLIDE 19

Σ x1 x2 a1 a2

slide-20
SLIDE 20

ReLU(x) = max(x, 0)

slide-21
SLIDE 21

Σ x1 x2 a1 a2

slide-22
SLIDE 22

Σ

slide-23
SLIDE 23

Σ Σ Σ Σ Σ Σ Σ

slide-24
SLIDE 24

Extracting Neural Networks

slide-25
SLIDE 25

Given (oracle) query access to a neural network, can we extract model? the exact

slide-26
SLIDE 26

can we extract Given (oracle) query access to a neural network, model? a functionally equivalent

slide-27
SLIDE 27

Given (oracle) query access to a neural network, can we extract model? a functionally equivalent

slide-28
SLIDE 28

Given (oracle) query access to a neural network, can we extract model? a functionally equivalent learned through stochastic gradient descent,

slide-29
SLIDE 29

Given (oracle) query access to a neural network, can we extract model? a functionally equivalent learned through stochastic gradient descent, This paper: yes (empirically)

slide-30
SLIDE 30

Reduced Round Attack: 1 Hidden Layer

[MSDH19, JCB+20]

slide-31
SLIDE 31

Visual Intuition

[MSDH19, JCB+20]

slide-32
SLIDE 32

[MSDH19, JCB+20]

slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36
slide-37
SLIDE 37

(+, +, +) (-, -, -) (+, -, -) (-, +, +) (

  • ,
  • ,

+ )

slide-38
SLIDE 38

(+, +, +) (-, -, -) (+, -, -)

slide-39
SLIDE 39
slide-40
SLIDE 40
slide-41
SLIDE 41

Observation #1: location of the
 critical hyperplanes almost completely determines the neural network

slide-42
SLIDE 42
slide-43
SLIDE 43

[MSDH19, JCB+20]

x y u v w

slide-44
SLIDE 44

[MSDH19, JCB+20]

x+ε y u' ? v' w+ɑε

slide-45
SLIDE 45

[MSDH19, JCB+20]

x+ε y+δ u'' v'' w+ɑε 
 +ɣδ

slide-46
SLIDE 46

[MSDH19, JCB+20]

x+ε y+δ u'' v'' w+ɑε 
 +ɣδ a1 a2

slide-47
SLIDE 47

[MSDH19, JCB+20]

x z w a1 a2 = a--ε b+δ

slide-48
SLIDE 48

however....

slide-49
SLIDE 49

ε δ

slide-50
SLIDE 50
slide-51
SLIDE 51
slide-52
SLIDE 52
slide-53
SLIDE 53

Observation #2: local information is insufficient to recover neuron signs

slide-54
SLIDE 54
slide-55
SLIDE 55
slide-56
SLIDE 56
slide-57
SLIDE 57

Finding witnesses to each neuron

slide-58
SLIDE 58

u v

slide-59
SLIDE 59
slide-60
SLIDE 60

u v

slide-61
SLIDE 61

Our Contributions

slide-62
SLIDE 62

Our Contributions

  • 1. Extract deep models
  • 2. Efficient extraction

  • 3. High Fidelity Extraction
slide-63
SLIDE 63

Our Contributions

  • 1. Extract deep models
  • 2. Efficient extraction

  • 3. High Fidelity Extraction
slide-64
SLIDE 64

Our Contributions

  • 1. Extract
  • 2. Efficient extraction

  • 3. High Fidelity Extraction

deep models

slide-65
SLIDE 65

Our Contributions

  • 1. Extract
  • 2. Efficient extraction

  • 3. High Fidelity Extraction

deep models 2-

slide-66
SLIDE 66

Our Contributions

  • 1. Extract

deep models 2-

  • 2. Efficient extraction

  • 3. High Fidelity Extraction
slide-67
SLIDE 67

Our Contributions

  • 1. Extract

deep models 2-

  • a. Recover weight values
  • b. Recover neuron signs
slide-68
SLIDE 68

2-deep Neural Network

slide-69
SLIDE 69

(+,+,+) (+,-,-) (-,+,+) (+,-,-) (-,-,-) (-,+,+)

slide-70
SLIDE 70
slide-71
SLIDE 71
slide-72
SLIDE 72

Recovering the first layer (up to sign)

slide-73
SLIDE 73
slide-74
SLIDE 74
slide-75
SLIDE 75
slide-76
SLIDE 76
slide-77
SLIDE 77
slide-78
SLIDE 78
slide-79
SLIDE 79
slide-80
SLIDE 80
slide-81
SLIDE 81
slide-82
SLIDE 82
slide-83
SLIDE 83
slide-84
SLIDE 84
slide-85
SLIDE 85
slide-86
SLIDE 86

Recovering the first layer sign

slide-87
SLIDE 87
slide-88
SLIDE 88
slide-89
SLIDE 89
slide-90
SLIDE 90
slide-91
SLIDE 91
slide-92
SLIDE 92
slide-93
SLIDE 93

Hyperplane Following

slide-94
SLIDE 94
slide-95
SLIDE 95
slide-96
SLIDE 96
slide-97
SLIDE 97
slide-98
SLIDE 98
slide-99
SLIDE 99
slide-100
SLIDE 100
slide-101
SLIDE 101

... then peel off first weight, and re-run attack from there

slide-102
SLIDE 102

Key Challenges

(that I don't have time to discuss in this talk, but make up most of the technical work that we had to do in the paper)

slide-103
SLIDE 103

Bounded floating 
 point precision

slide-104
SLIDE 104

Not all hidden states
 are reachable

slide-105
SLIDE 105

Results

slide-106
SLIDE 106

Results

slide-107
SLIDE 107

Results

slide-108
SLIDE 108

Results

slide-109
SLIDE 109

Results

slide-110
SLIDE 110

Results

slide-111
SLIDE 111

Results

slide-112
SLIDE 112

Results

slide-113
SLIDE 113

Results

slide-114
SLIDE 114

Results

slide-115
SLIDE 115

Results

slide-116
SLIDE 116

Results

slide-117
SLIDE 117

Conclusions

slide-118
SLIDE 118

Direct analysis

  • f neural networks
slide-119
SLIDE 119

"Secure Inference"
 maybe isn't so secure ...

slide-120
SLIDE 120

Don't put neural networks in your ideal functionalities

  • A talk by Matthew Jagielski
slide-121
SLIDE 121

Code: https://github.com/google-research/cryptanalytic-model-extraction

Live Q&A:
 Friday 8:00 PT / 15:00 UTC

After-the-fact Q&A: nicholas@carlini.com

slide-122
SLIDE 122

Code: https://github.com/google-research/cryptanalytic-model-extraction

Live Q&A:
 Friday 8:00 PT / 15:00 UTC

After-the-fact Q&A: nicholas@carlini.com