Presentationx - b

Download Report

Transcript Presentationx - b

Automatic Rule Extraction
From LSTMs
Jamie Murdoch
Collaboration with Arthur Szlam, Facebook AI Research
ICLR paper under review
Problem
• LSTMs are now state of the art across a wide range of NLP problems
• We have very little idea how they actually work
• I present a technique for approximating a fitted LSTM using a simple
pattern-based classifier
WikiMovies
• Recently published dataset (Miller et al., 2016)
• Question-answer directly from Wikipedia text
• 100,000 question-answer pairs
• 12 classes of questions
• E.g. Who starred in King Kong? (Movie->Actor)
LSTM Model
• Bidirectional LSTM over document
• Condition on question via augmented word embeddings, 𝑥𝑡′ = 𝑥𝑡 |𝑞, q
is output of LSTM run over question
• Predict 𝑝𝑡 = 𝑠𝑜𝑓𝑡𝑚𝑎𝑥(𝑊𝑝 ℎ𝑡 ) - binary prediction for whether word t
is an answer
Importance scores
• Can decompose numerator of softmax output
𝑝𝑡 =
𝑡
𝑗=1 𝑒𝑗,𝑡
𝐶
• 𝑒𝑗,𝑡 denotes the contribution of word j to word t being identified as
the answer
• Identify sequences of important words – those with 𝑒𝑗,𝑡 above some
threshold
Importance Score Example
Extracting patterns
• Identify sequences of important words – those with 𝑒𝑡,𝑗 above some
threshold
Pattern Matching classifier
• Given list of patterns, search for match
• Pattern is matched if the pattern words occur, in order, within the
document, with no more than 3 words between any pair
• Following a pattern match, return first entity within 5 words of
pattern
Pattern Matching Example
Results
• KV-MemNN is state of
the art
• LSTM is my model
• Automatic/Gradient
pattern matching is
different variants of
importance measures
• Manual pattern
matching is hand-picked
patterns
Results
Conclusion
• Introduced variable importance scores for LSTM
• Construct white-box, pattern matching, approximation to black-box
LSTM
• Provides interpretability, speedup, opportunities for feature
engineering