Extracting Automata from Recurrent Neural Networks Using...

1
Equivalence Queries: done by parallel exploration Extraction Extracting Automata from Recurrent Neural Networks Using Queries and Counterexamples Gail Weiss, Yoav Goldberg, and Eran Yahav Supported by European Union’s Seventh Framework Programme (FP7) under grant agreement no. 615688 (PRIME) Interaction Overview: RNN Dynamic Partitioning Membership Queries Equivalence Queries L* Demonstration: Learning : (all words that start and end the same, over {a,b}) ε | a(a | b)*a | b(a | b)*b ε ? a ? b ? L* RNN ba ? L* RNN bb ? bab ? baa ? bba ? L* RNN Equivalence queries can cause refinements! aba ? L* RNN abb ? abab ? abba ? aaa ? aa ? L* RNN ? L* RNN Demonstration: Dierentiating sux (of states 0,2) is “ab”. Check “ab” (state 0 + “ab") and “bab" (state 1 + “ab”). RNN agrees with L* on “ab” and on “bab”, so partitioning is refined (Could have not agreed, then counterexample would be returned) L* DFA -1 -1 1 1 initial state - reached with “” 0 a 1 2 3 a,b a a b b b 1 1 0 a reached with “a” 0 a 1 2 3 a,b a a b b b -1 -1 1 1 0 a 0 a 1 2 3 a,b a a b b b -1 -1 1 1 0 a 1 -1 -1 0 a 1 2 3 a,b a a b b b 0 a 1 2 3 a,b a a b b b 1 1 0 1 a b reached with “b” -1 -1 1 1 0 1 a b 0 a 1 2 3 a,b a a b b b -1 -1 1 1 0 1 a b 0 a 1 2 3 a,b a a b b b 2 -1 -1 1 1 0 1 a b 0 a 1 2 3 a,b a a b b b 2 a reached with “aa” -1 -1 1 1 0 a 1 2 3 a,b a a b b b -1 -1 0 Cluster Conflict Dierentiating sux (of states 0,1) is the empty word. Check empty word (state 0) and “a" (state 1). RNN agrees with L* on empty word and on “a”, ao partitioning is refined Cluster Conflict Classification Conflict RNN disagrees with L* on “aa". A counterexample is returned to L*. Counterexample: aa github.com/tech-srl/lstar_extraction contains also link to a Google Colaboratory notebook Try it yourself:

Transcript of Extracting Automata from Recurrent Neural Networks Using...

Page 1: Extracting Automata from Recurrent Neural Networks Using ...cs.technion.ac.il/~sgailw/icml_2018_poster.pdf · Supported by European Union’s Seventh Framework Programme (FP7) under

Equivalence Queries: done by parallel exploration

Extraction

Extracting Automata from Recurrent Neural Networks Using Queries and CounterexamplesGail Weiss, Yoav Goldberg, and Eran Yahav

Supported by European Union’s Seventh Framework Programme (FP7) under grant agreement no. 615688 (PRIME) 

Interaction Overview:

RNN

DynamicPartitioning

Membership Queries

Equivalence Queries

L*

Demonstration: Learning : (all words that start and end the same, over {a,b})ε |a(a |b)*a |b(a |b)*b

ε? a? b?

L*

RNN

ba

?

L*

RNN

bb? bab? baa? bba? …

L*

RNN

Equivalence queries can cause

refinements!

aba

?

L*

RNN

abb?abab? abba?aaa?aa? …

L*

RNN

?

L*

RNN

Demonstration:

Differentiating suffix (of states 0,2) is “ab”.Check “ab” (state 0 + “ab") and

“bab" (state 1 + “ab”).RNN agrees with L* on “ab” and on “bab”,

so partitioning is refined

(Could have not agreed, then counterexample would be returned)

L* DFA

-1-1

1

1

initial state - reached with “”

0

a

1 2

3

a,b

a

a

b

bb

1

10

a reached with “a”

0

a

1 2

3

a,b

a

a

b

bb

-1-1

1

1

0

a

0

a

1 2

3

a,b

a

a

b

bb

-1-1

1

10

a

1-1

-1

0

a

1 2

3

a,b

a

a

b

bb

0

a

1 2

3

a,b

a

a

b

bb

1

1

01

a b

reached with “b”

-1-1

1

101

a b

0

a

1 2

3

a,b

a

a

b

bb

-1-1

1

101

a b

0

a

1 2

3

a,b

a

a

b

bb2

-1-1

1

101

a b

0

a

1 2

3

a,b

a

a

b

bb2

a

reached with “aa”

-1-1

1

1

0

a

1 2

3

a,b

a

a

b

bb

-1-1

0

Cluster ConflictDifferentiating suffix (of states 0,1) is the empty word.

Check empty word (state 0) and “a" (state 1).RNN agrees with L* on empty word and on “a”,

ao partitioning is refined

Cluster Conflict Classification ConflictRNN disagrees with L* on “aa".

A counterexample is returned to L*.

Counterexample: aa

github.com/tech-srl/lstar_extraction contains also link to a Google Colaboratory notebookTry it yourself: