Saliency-driven Word Alignment Interpretation for NMT Shuoyang Ding - - PowerPoint PPT Presentation

saliency driven word alignment interpretation for nmt
SMART_READER_LITE
LIVE PREVIEW

Saliency-driven Word Alignment Interpretation for NMT Shuoyang Ding - - PowerPoint PPT Presentation

Saliency-driven Word Alignment Interpretation for NMT Shuoyang Ding Hainan Xu Philipp Koehn The Fourth Conference on Machine Translation Florence, Italy August 1st, 2019 Revisiting Six Challenges poor out-of-domain performance


slide-1
SLIDE 1

Saliency-driven Word Alignment Interpretation for NMT

Shuoyang Ding Hainan Xu Philipp Koehn The Fourth Conference on Machine Translation Florence, Italy August 1st, 2019

slide-2
SLIDE 2

Saliency-driven Word Alignment Interpretation for NMT

Revisiting Six Challenges

  • poor out-of-domain performance
  • poor low-resource performance
  • low frequency words
  • long sentences
  • attention is not word alignment
  • large beam does not help

2

[Koehn and Knowles 2017]

slide-3
SLIDE 3

Saliency-driven Word Alignment Interpretation for NMT

Revisiting Six Challenges

  • poor out-of-domain performance
  • poor low-resource performance
  • low frequency words
  • long sentences
  • attention is not word alignment
  • large beam does not help

3

[Koehn and Knowles 2017]

slide-4
SLIDE 4

Saliency-driven Word Alignment Interpretation for NMT

A Model Interpretation Problem

4

slide-5
SLIDE 5

Saliency-driven Word Alignment Interpretation for NMT

A Model Interpretation Problem

5

slide-6
SLIDE 6

Saliency-driven Word Alignment Interpretation for NMT

Related Findings Outside MT

  • “Attention is not Explanation”


[Jain and Wallace NAACL 2019]

  • “Is Attention Interpretable?” (Spoiler: No)

[Serrano and Smith ACL 2019]

  • We also have empirical results that

corroborate these findings.

  • … and we have method that works better!

6

slide-7
SLIDE 7

Saliency: Identifying Important Features

slide-8
SLIDE 8

Saliency-driven Word Alignment Interpretation for NMT

Recap

8

slide-9
SLIDE 9

Saliency-driven Word Alignment Interpretation for NMT

Recap

9

slide-10
SLIDE 10

Saliency-driven Word Alignment Interpretation for NMT

Focus on solten

10

slide-11
SLIDE 11

Saliency-driven Word Alignment Interpretation for NMT

Perturbation

11

slide-12
SLIDE 12

Saliency-driven Word Alignment Interpretation for NMT

Perturbation

12

slide-13
SLIDE 13

Saliency-driven Word Alignment Interpretation for NMT

Assumption

13

The output score is more sensitive to perturbations in important features.

slide-14
SLIDE 14

Saliency-driven Word Alignment Interpretation for NMT

E.g.

14

slide-15
SLIDE 15

Saliency-driven Word Alignment Interpretation for NMT

E.g.

15

slide-16
SLIDE 16

Saliency-driven Word Alignment Interpretation for NMT

E.g.

16

slide-17
SLIDE 17

Saliency-driven Word Alignment Interpretation for NMT

Saliency

17

slide-18
SLIDE 18

Saliency-driven Word Alignment Interpretation for NMT

Saliency

18

when :

slide-19
SLIDE 19

Saliency-driven Word Alignment Interpretation for NMT

Saliency

19

slide-20
SLIDE 20

Saliency-driven Word Alignment Interpretation for NMT

What’s good about this?

  • 1. Derivatives are easy to obtain for any DL toolkit
  • 2. Model-agnostic
  • 3. Adapts with the choice of output words

20

slide-21
SLIDE 21

Saliency-driven Word Alignment Interpretation for NMT

Prior Work on Saliency

  • Widely used and studied in Computer Vision!

[Simonyan et al. 2013][Springenberg et al. 2014]
 [Smilkov et al. 2017]

  • Also in a few NLP work for qualitative analysis


[Aubakirova and Bansal 2016][Li et al. 2016][Ding et al. 2017] [Arras et al. 2016;2017][Mudrakarta et al. 2018]

21

slide-22
SLIDE 22

Saliency-driven Word Alignment Interpretation for NMT

SmoothGrad

  • Gradients are very local measure of sensitivity.
  • Highly non-linear models may have pathological

points where the gradients are noisy.

  • Solution: calculate saliency for multiple copies of

the same input corrupted with gaussian noise, and average the saliency of copies.


22

[Smilkov et al. 2017]

slide-23
SLIDE 23

Establishing Saliency for Words

slide-24
SLIDE 24

Saliency-driven Word Alignment Interpretation for NMT

“Feature” in Computer Vision

24

Photo Credit: Hainan Xu

slide-25
SLIDE 25

Saliency-driven Word Alignment Interpretation for NMT

“Feature” in NLP

25

It’s straight-forward to compute saliency for 
 a single dimension of the word embedding.

slide-26
SLIDE 26

Saliency-driven Word Alignment Interpretation for NMT

“Feature” in NLP

26

But how to compose the saliency of each dimension into the saliency of a word?

slide-27
SLIDE 27

Saliency-driven Word Alignment Interpretation for NMT

Our Proposal

27

Consider word embedding look-up as a dot product between the embedding matrix and an one-hot vector.

slide-28
SLIDE 28

Saliency-driven Word Alignment Interpretation for NMT

Our Proposal

28

The 1 in the one-hot vector denotes the identity of the input word.

slide-29
SLIDE 29

Saliency-driven Word Alignment Interpretation for NMT

Our Proposal

29

Let’s perturb that 1 like a real value! i.e. take gradients with regard to the 1.

slide-30
SLIDE 30

Saliency-driven Word Alignment Interpretation for NMT

Our Proposal

30

i

ei ⋅ ∂y ∂ei (−∞, ∞) range:

slide-31
SLIDE 31

Experiment

slide-32
SLIDE 32

Saliency-driven Word Alignment Interpretation for NMT

Evaluation

  • Evaluation of interpretations is tricky!
  • Fortunately, there’s human judgments to rely on.
  • Need to do force decoding with NMT model.

32

slide-33
SLIDE 33

Saliency-driven Word Alignment Interpretation for NMT

Setup

  • Architecture: Convolutional S2S, LSTM,

Transformer (with fairseq default hyper- parameters)

  • Dataset: Following Zenkel et al. [2019], which

covers de-en, fr-en and ro-en.

  • SmoothGrad hyper-parameters: N=30 and σ=0.15

33

slide-34
SLIDE 34

Saliency-driven Word Alignment Interpretation for NMT

Baselines

  • Attention weights
  • Smoothed Attention: forward pass on multiple corrupted

input samples, then average the attention weights over samples

  • [Li et al. 2016]: compute element-wise absolute value of

embedding gradients, then average over embedding dimensions

  • [Li et al. 2016] + SmoothGrad

34

slide-35
SLIDE 35

Saliency-driven Word Alignment Interpretation for NMT

Convolutional S2S on de-en

AER 15 20 25 30 35 40 45

Attention Smoothed Attention Li+Grad Li+SmoothGrad Ours+Grad Ours+SmoothGrad fast-align Zenkel et al. [2019] GIZA++

35

slide-36
SLIDE 36

Saliency-driven Word Alignment Interpretation for NMT

Attention on de-en

36

AER 15 25 35 45 55 65

Conv LSTM Transformer fast-align Zenkel et al. [2019] GIZA++

slide-37
SLIDE 37

Saliency-driven Word Alignment Interpretation for NMT

Ours+SmoothGrad on de-en

37

AER 15 25 35 45 55 65

Conv LSTM Transformer fast-align Zenkel et al. [2019] GIZA++

slide-38
SLIDE 38

Saliency-driven Word Alignment Interpretation for NMT

Li vs. Ours

38

slide-39
SLIDE 39

Saliency-driven Word Alignment Interpretation for NMT

Li vs. Ours

39

slide-40
SLIDE 40

Conclusion

slide-41
SLIDE 41

Saliency-driven Word Alignment Interpretation for NMT

Conclusion

  • Saliency + proper word-level score formulation is a

better interpretation method than attention

  • NMT models do learn interpretable alignments. We

just need to properly uncover them!
 
 
 
 
 


41

Paper Code Slides

https://github.com/shuoyangd/meerkat