Greed is Good if Randomized: New Inference for Dependency - - PowerPoint PPT Presentation

greed is good if randomized new inference for dependency
SMART_READER_LITE
LIVE PREVIEW

Greed is Good if Randomized: New Inference for Dependency - - PowerPoint PPT Presentation

Greed is Good if Randomized: New Inference for Dependency Parsing Yuan Zhang CSAIL, MIT Joint work with Tao Lei, Regina Barzilay, and Tommi Jaakkola 1 Inference vs. Scoring Exact Inference


slide-1
SLIDE 1

Greed ¡is ¡Good ¡if ¡Randomized: ¡New ¡Inference ¡ for ¡Dependency ¡Parsing ¡

1 ¡

Yuan Zhang CSAIL, MIT

Joint work with Tao Lei, Regina Barzilay, and Tommi Jaakkola

slide-2
SLIDE 2

Inference vs. Scoring

2 ¡

Inference ¡ Scoring ¡ Func.on ¡ Approximate ¡ Exact ¡ Limited ¡ Expressive ¡

slide-3
SLIDE 3

Inference vs. Scoring

3 ¡

Inference ¡ Scoring ¡ Func.on ¡ Approximate ¡ Exact ¡ Limited ¡ Expressive ¡ Minimum ¡ Spanning ¡Tree ¡

slide-4
SLIDE 4

Inference vs. Scoring

4 ¡

Inference ¡ Scoring ¡ Func.on ¡ Approximate ¡ Exact ¡ Limited ¡ Expressive ¡ Minimum ¡ Spanning ¡Tree ¡ Reranking ¡

  • Reranking: ¡incorporate ¡arbitrary ¡features ¡
slide-5
SLIDE 5

Inference vs. Scoring

5 ¡

Inference ¡ Scoring ¡ Func.on ¡ Approximate ¡ Exact ¡ Limited ¡ Expressive ¡ Minimum ¡ Spanning ¡Tree ¡ Reranking ¡ Dual ¡ DecomposiKon ¡

  • Reranking: ¡incorporate ¡arbitrary ¡features ¡
  • Dual ¡DecomposiKon: ¡search ¡in ¡full ¡space ¡
slide-6
SLIDE 6

Parsing Complexity

  • High-­‑order ¡parsing ¡is ¡NP-­‑hard ¡(McDonald ¡et ¡al., ¡2006) ¡
  • Hypothesis: ¡parsing ¡is ¡easy ¡on ¡average ¡
  • Many ¡NP-­‑hard ¡problems ¡are ¡easy ¡on ¡average ¡
  • MAX-­‑SAT ¡(Resende ¡et ¡al., ¡1997) ¡
  • Set ¡cover ¡(Hochbaum, ¡1982) ¡

6 ¡

slide-7
SLIDE 7

Parsing Complexity

  • High-­‑order ¡parsing ¡is ¡NP-­‑hard ¡(McDonald ¡et ¡al., ¡2006) ¡
  • Hypothesis: ¡parsing ¡is ¡easy ¡on ¡average ¡
  • Many ¡NP-­‑hard ¡problems ¡are ¡easy ¡on ¡average ¡
  • MAX-­‑SAT ¡(Resende ¡et ¡al., ¡1997) ¡
  • Set ¡cover ¡(Hochbaum, ¡1982) ¡

7 ¡

We ¡show ¡

  • Analysis ¡on ¡average ¡parsing ¡complexity ¡
  • A ¡simple ¡inference ¡algorithm ¡based ¡on ¡the ¡analysis ¡
slide-8
SLIDE 8

Our Approach

8 ¡

Our ¡ ¡ ¡ ¡ ¡ ¡ Approach ¡ Inference ¡ Scoring ¡ Func.on ¡ Approximate ¡ Exact ¡ Limited ¡ Expressive ¡ Minimum ¡ Spanning ¡Tree ¡ Reranking ¡ Dual ¡ DecomposiKon ¡

  • Reranking: ¡incorporate ¡arbitrary ¡features ¡
  • Dual ¡DecomposiKon: ¡search ¡in ¡full ¡space ¡
slide-9
SLIDE 9

Core Idea

  • Climb ¡to ¡the ¡opKmal ¡tree ¡in ¡a ¡few ¡small ¡greedy ¡steps ¡

9 ¡

1) Randomly ¡sample ¡a ¡dependency ¡tree ¡ 2) Greedily ¡improve ¡the ¡tree ¡one ¡edge ¡at ¡a ¡Kme ¡ 3) Repeat ¡(2) ¡unKl ¡converge ¡ Randomized ¡Hill-­‑climbing ¡ For ¡k ¡= ¡1 ¡to ¡K ¡ Select ¡the ¡tree ¡with ¡the ¡highest ¡score ¡ ¡

slide-10
SLIDE 10

Core Idea

  • Climb ¡to ¡the ¡opKmal ¡tree ¡in ¡a ¡few ¡small ¡greedy ¡steps ¡

10 ¡

1) Randomly ¡sample ¡a ¡dependency ¡tree ¡ 2) Greedily ¡improve ¡the ¡tree ¡one ¡edge ¡at ¡a ¡Kme ¡ 3) Repeat ¡(2) ¡unKl ¡converge ¡ Randomized ¡Hill-­‑climbing ¡

That’s ¡it! ¡

For ¡k ¡= ¡1 ¡to ¡K ¡ Select ¡the ¡tree ¡with ¡the ¡highest ¡score ¡ ¡

slide-11
SLIDE 11

It Works!

11 ¡

89.44% ¡ 88.73% ¡

Our ¡Full ¡ Turbo ¡ Parsing ¡Performance ¡on ¡CoNLL ¡Dataset ¡ Dual ¡ Decomposi;on ¡

slide-12
SLIDE 12

12 ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

Example

slide-13
SLIDE 13

13 ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

Initial tree

Example

slide-14
SLIDE 14

14 ¡ today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

Target tree Initial tree

Example

slide-15
SLIDE 15

15 ¡ today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple

Target tree Initial tree

Example

slide-16
SLIDE 16

16 ¡ today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple

Target tree

Example

slide-17
SLIDE 17

17 ¡ today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple

Target tree

Example

slide-18
SLIDE 18

18 ¡ today apple I ate ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple an

Target tree

Example

slide-19
SLIDE 19

19 ¡ today apple I ate ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple an

Target tree

Example

slide-20
SLIDE 20

20 ¡ today apple ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple an I ate

Target tree

Example

slide-21
SLIDE 21

21 ¡ today apple ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple an I ate

Target tree

Example

slide-22
SLIDE 22

22 ¡ today apple ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple an I ate

Target tree

Example

slide-23
SLIDE 23

23 ¡ today apple ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple an I ate

Target tree

Example

slide-24
SLIDE 24

24 ¡ today ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I an ate today apple I ate apple an

Target tree

Example

slide-25
SLIDE 25

25 ¡ today ROOT ¡ today apple I ate an ROOT ¡

“ ¡I ¡ate ¡an ¡apple ¡today” ¡

I ate apple an

Target tree

Example

slide-26
SLIDE 26

26 ¡

Reachability: ¡transforming ¡any ¡tree ¡to ¡any ¡other ¡tree ¡

  • maintaining ¡the ¡structure ¡a ¡valid ¡tree ¡at ¡any ¡point ¡
  • using ¡as ¡few ¡as ¡d ¡steps ¡(d ¡: ¡head ¡differences/hamming ¡distance) ¡

…… ¡

today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

y(0) y(T )

Why Greedy Has a Chance to Work

slide-27
SLIDE 27

27 ¡ …… ¡

today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

y(0) y(T )

increase ¡S(x, y(t))

Greedy Hill-climbing

slide-28
SLIDE 28

28 ¡ …… ¡

today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

y(0) y(T )

increase ¡S(x, y(t))

Greedy Hill-climbing

Arbitrary ¡features ¡in ¡the ¡scoring ¡func;on ¡

slide-29
SLIDE 29

29 ¡ …… ¡

today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

y(0) y(T )

tree ¡y score ¡S

local ¡opKmum ¡ global ¡opKmum ¡

increase ¡S(x, y(t))

Challenge: Local Optimum

slide-30
SLIDE 30

tree ¡y score ¡S

Hill-climbing with Restarts

30 ¡

Overcome ¡local ¡opKma ¡via ¡restarts ¡

…… ¡

today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

slide-31
SLIDE 31

31 ¡

Hill-climbing with Restarts

Random ¡ iniKalizaKon ¡ (e.g. ¡uniform) ¡

…… ¡

max ¡

…… ¡

Overcome ¡local ¡opKma ¡via ¡restarts ¡

…… ¡

today apple I ate an ROOT ¡ today apple I ate an ROOT ¡

y(0) y(0) y(0) y(T ) y(T ) y(T )

Hill-­‑climbing ¡

slide-32
SLIDE 32

Learning Algorithm

  • Follow ¡common ¡max-­‑margin ¡framework ¡

32 ¡

∀y ∈ T(x)

S(x, ˆ y) ≥ S(x, y)+ | ˆ y − y |−ξ

§ ¡ ¡ ¡ ¡ ¡is ¡the ¡gold ¡tree ¡

ˆ y

slide-33
SLIDE 33

Learning Algorithm

  • Follow ¡common ¡max-­‑margin ¡framework ¡
  • Adopt ¡passive-­‑aggressive ¡online ¡learning ¡framework ¡(Crammer ¡et ¡
  • al. ¡2006) ¡ ¡
  • Decode ¡with ¡our ¡randomized ¡greedy ¡algorithm ¡ ¡

33 ¡

∀y ∈ T(x)

S(x, ˆ y) ≥ S(x, y)+ | ˆ y − y |−ξ

§ ¡ ¡ ¡ ¡ ¡is ¡the ¡gold ¡tree ¡

ˆ y

slide-34
SLIDE 34

Analysis

34 ¡

slide-35
SLIDE 35

Analysis

35 ¡

TheoreKcal ¡ Empirical ¡ First-­‑order ¡

slide-36
SLIDE 36

Analysis

36 ¡

TheoreKcal ¡ Empirical ¡ First-­‑order ¡ High-­‑order ¡

?

slide-37
SLIDE 37

Analysis

37 ¡

TheoreKcal ¡ Empirical ¡ First-­‑order ¡ High-­‑order ¡

?

slide-38
SLIDE 38

38 ¡

Search Space Complexity: First-order

10 ¡words ¡

slide-39
SLIDE 39

39 ¡

Search Space Complexity: First-order

10 ¡words ¡ ≈ ¡2 ¡billion ¡trees ¡

slide-40
SLIDE 40

40 ¡

Search Space Complexity: First-order

10 ¡words ¡ ≈ ¡2 ¡billion ¡trees ¡ < ¡512 ¡local ¡opKma ¡

slide-41
SLIDE 41

41 ¡

Search Space Complexity: First-order

Theorem: ¡For ¡any ¡first-­‑order ¡scoring ¡funcKon: ¡

  • there ¡are ¡at ¡most ¡2n-­‑1 ¡locally ¡opKmal ¡trees ¡
  • this ¡upper ¡bound ¡is ¡.ght ¡
slide-42
SLIDE 42

42 ¡

Search Space Complexity: First-order

Theorem: ¡For ¡any ¡first-­‑order ¡scoring ¡funcKon: ¡

  • there ¡are ¡at ¡most ¡2n-­‑1 ¡locally ¡opKmal ¡trees ¡
  • this ¡upper ¡bound ¡is ¡.ght ¡

2n-­‑1 ¡is ¡sKll ¡a ¡lot, ¡but ¡it ¡is ¡the ¡worst ¡case ¡

slide-43
SLIDE 43

43 ¡

Search Space Complexity: First-order

Theorem: ¡For ¡any ¡first-­‑order ¡scoring ¡funcKon: ¡

  • there ¡are ¡at ¡most ¡2n-­‑1 ¡locally ¡opKmal ¡trees ¡
  • this ¡upper ¡bound ¡is ¡.ght ¡

2n-­‑1 ¡is ¡sKll ¡a ¡lot, ¡but ¡it ¡is ¡the ¡worst ¡case ¡ What ¡about ¡the ¡average ¡case? ¡

slide-44
SLIDE 44

44 ¡

Algorithm for Counting Local Optima

root John saw Mary

10 9 20 30 30 9

slide-45
SLIDE 45

45 ¡

Algorithm for Counting Local Optima

The ¡method ¡is ¡based ¡on ¡Chu-­‑Liu-­‑Edmonds ¡algorithm ¡ ¡

root John saw Mary

10 9 20 30 30 9

  • Select ¡the ¡best ¡heads ¡independently ¡
slide-46
SLIDE 46

46 ¡

Algorithm for Counting Local Optima

root John saw Mary

10 9 20 30 30 9

  • Contract ¡the ¡cycle ¡and ¡recursively ¡count ¡the ¡local ¡opKma ¡

Ø ¡ ¡Any ¡local ¡opKmum ¡exactly ¡reassigns ¡one ¡edge ¡in ¡the ¡cycle ¡

root John saw Mary

9 30 9

root John saw Mary

10 30 9

+ ¡

slide-47
SLIDE 47

47 ¡

Empirical Results: First-order How ¡many ¡local ¡opKma ¡in ¡real ¡data? ¡

# ¡Op.ma ¡on ¡English ¡Dataset ¡ % ¡sentences ¡

slide-48
SLIDE 48

48 ¡

Empirical Results: First-order

50% ¡ 21 ¡

How ¡many ¡local ¡opKma ¡in ¡real ¡data? ¡

# ¡Op.ma ¡on ¡English ¡Dataset ¡ % ¡sentences ¡

slide-49
SLIDE 49

49 ¡

Empirical Results: First-order

50% ¡ 70% ¡ 21 ¡ 121 ¡

How ¡many ¡local ¡opKma ¡in ¡real ¡data? ¡

# ¡Op.ma ¡on ¡English ¡Dataset ¡ % ¡sentences ¡

slide-50
SLIDE 50

50 ¡

Empirical Results: First-order

50% ¡ 70% ¡ 90% ¡ 21 ¡ 121 ¡ 2000 ¡

How ¡many ¡local ¡opKma ¡in ¡real ¡data? ¡

# ¡Op.ma ¡on ¡English ¡Dataset ¡ % ¡sentences ¡

slide-51
SLIDE 51

51 ¡

Empirical Results: First-order Does ¡the ¡hill-­‑climbing ¡find ¡the ¡argmax? ¡

Finding ¡Global ¡Op.mum ¡on ¡English ¡

slide-52
SLIDE 52

52 ¡

Empirical Results: First-order Does ¡the ¡hill-­‑climbing ¡find ¡the ¡argmax? ¡

  • Len. ¡≤ ¡15 ¡

100% ¡

  • Len. ¡> ¡15 ¡

99.3% ¡

Easy ¡search ¡space ¡leads ¡to ¡successful ¡decoding ¡

Finding ¡Global ¡Op.mum ¡on ¡English ¡

slide-53
SLIDE 53

Empirical Results: High-order

% ¡Cer.ficate ¡ 94.5% ¡ Dual ¡decomposiKon ¡ (Koo ¡et ¡al., ¡2010) ¡ SDD ¡= ¡SHC ¡ 99.8% ¡ Given ¡a ¡cerKficate ¡ by ¡DD ¡ Comparison ¡on ¡English ¡Given ¡DD ¡Cert. ¡

Does ¡the ¡hill-­‑climbing ¡find ¡the ¡argmax? ¡

slide-54
SLIDE 54

Empirical Results: High-order

Overall ¡Comparison ¡on ¡English ¡

Does ¡the ¡hill-­‑climbing ¡find ¡the ¡argmax? ¡

slide-55
SLIDE 55

Empirical Results: High-order

SDD ¡= ¡SHC ¡ 98.7% ¡ Overall ¡Comparison ¡on ¡English ¡

Does ¡the ¡hill-­‑climbing ¡find ¡the ¡argmax? ¡

slide-56
SLIDE 56

Empirical Results: High-order

SDD ¡= ¡SHC ¡ 98.7% ¡ SDD ¡< ¡SHC ¡ 1.0% ¡ SDD ¡> ¡SHC ¡ 0.3% ¡ Overall ¡Comparison ¡on ¡English ¡

Does ¡the ¡hill-­‑climbing ¡find ¡the ¡argmax? ¡

slide-57
SLIDE 57

Experimental Setup

57 ¡

Implementa;on ¡ § AdapKve ¡restarKng ¡strategy ¡with ¡ ¡ Datasets ¡ § 14 ¡languages ¡in ¡CoNLL ¡2006 ¡& ¡2008 ¡shared ¡tasks ¡ Features ¡ § Up ¡to ¡3rd-­‑order ¡(three ¡arcs) ¡features ¡used ¡in ¡MST/ Turbo ¡parsers ¡ § Global ¡features ¡used ¡in ¡re-­‑ranking ¡

K = 300

slide-58
SLIDE 58

Baselines and Evaluation Measure

58 ¡

Baselines: ¡ § Turbo ¡Parser: ¡Dual ¡DecomposiKon ¡with ¡3rd-­‑order ¡ features ¡(MarKns ¡et ¡al., ¡2013) ¡ § Sampling-­‑based ¡Parser: ¡MCMC ¡sampling ¡with ¡global ¡ features ¡(Zhang ¡et ¡al., ¡2014) ¡ Evalua;on ¡Measure: ¡ § Unlabeled ¡Amachment ¡Score ¡(UAS), ¡without ¡punctuaKons ¡

slide-59
SLIDE 59

Comparing with Baselines

59 ¡

89.24% ¡ 89.23% ¡ 88.66% ¡ 88.73% ¡

Our ¡Full ¡ Sampling-­‑based ¡ Our ¡3rd ¡ Turbo ¡(DD) ¡ Our ¡Full ¡ w/o ¡Tensor ¡ Sampling-­‑based ¡ (MCMC) ¡ Our ¡Full ¡ w/o ¡Tensor ¡

slide-60
SLIDE 60

Comparing with Baselines

60 ¡

89.24% ¡ 89.23% ¡ 88.66% ¡ 88.73% ¡

Our ¡Full ¡ Sampling-­‑based ¡ Our ¡3rd ¡ Turbo ¡(DD) ¡ Our ¡Full ¡ w/o ¡Tensor ¡ Sampling-­‑based ¡ (MCMC) ¡

slide-61
SLIDE 61

Comparing with Baselines

61 ¡

89.24% ¡ 89.23% ¡ 88.66% ¡ 88.73% ¡

Our ¡Full ¡ Sampling-­‑based ¡ Our ¡3rd ¡ Turbo ¡(DD) ¡ Our ¡Full ¡ w/o ¡Tensor ¡ Sampling-­‑based ¡ (MCMC) ¡ Global ¡ Features ¡

slide-62
SLIDE 62

Impact of Initialization

62 ¡ 88.0 ¡ 88.1 ¡ 84.0 ¡ 85.0 ¡ 86.0 ¡ 87.0 ¡ 88.0 ¡ 89.0 ¡ Uniform ¡ Rnd-­‑1st ¡ UAS(%) ¡

slide-63
SLIDE 63

Impact of Restarts

63 ¡ 85.4 ¡ 88.1 ¡ 84.0 ¡ 85.0 ¡ 86.0 ¡ 87.0 ¡ 88.0 ¡ 89.0 ¡ No ¡Restart ¡ 300 ¡Restarts ¡ UAS(%) ¡

slide-64
SLIDE 64

Convergence Property

64 ¡

  • Score ¡normalized ¡by ¡the ¡highest ¡score ¡in ¡3000 ¡restarts ¡ ¡

100 200 300 400 500 0.994 0.996 0.998 1 # Restarts Score Len ≤ 15 Len > 15 Convergence ¡Analysis ¡on ¡English ¡

slide-65
SLIDE 65

Trade-off between Speed and Performance

65 ¡ Decoding ¡Speed ¡on ¡English ¡ 2 4 6 8 10 x 10

−3

88 90 92 94 Sec/Tok UAS 3rd−order Model Full Model

Fast ¡ Slow ¡

slide-66
SLIDE 66

Conclusion

  • Analysis: ¡we ¡invesKgate ¡average ¡case ¡complexity ¡of ¡parsing ¡

¡

  • Algorithm: ¡we ¡introduce ¡a ¡simple ¡randomized ¡greedy ¡

inference ¡algorithm ¡ ¡ ¡Source ¡code ¡available ¡at: ¡ hSps://github.com/taolei87/RBGParser ¡

66 ¡

slide-67
SLIDE 67

Thank ¡You! ¡

67 ¡