1
Lattice and Hypergraph MERT
Lattice and Hypergraph MERT
Graham Neubig Nara Institute of Science and Technology (NAIST)
12/20/2012
Lattice and Hypergraph MERT Graham Neubig Nara Institute of Science - - PowerPoint PPT Presentation
Lattice and Hypergraph MERT Lattice and Hypergraph MERT Graham Neubig Nara Institute of Science and Technology (NAIST) 12/20/2012 1 Lattice and Hypergraph MERT Papers Introduced: Lattice-based Minimum Error Rate Training for
1
Lattice and Hypergraph MERT
Graham Neubig Nara Institute of Science and Technology (NAIST)
12/20/2012
2
Lattice and Hypergraph MERT
Machine Translation” Wolfgang Macherey, Franz Josef Och, Ignacio Thayer, Jakob Uszkoreit (Google) EMNLP 2008
Bayes-Risk Decoding for Translation Hypergraphs and Lattices” Shankar Kumar, Wolfgang Macherey, Chris Dyer, Franz Och (Google/University of Maryland) ACL-IJCNLP 2009
3
Lattice and Hypergraph MERT
parameters for machine translation
→ unstable training & large accuracy fluctuations
4
Lattice and Hypergraph MERT
Lattice and Hypergraph MERT
○ Taro visited Hanako ☓ the Taro visited the Hanako ☓ Hanako visited Taro LM TM RM
Best Score ☓ LM TM RM
Best Score ○ 0.2* 0.2* 0.2* 0.3* 0.3* 0.3* 0.5* 0.5* 0.5* ○ Taro visited Hanako ☓ the Taro visited the Hanako ☓ Hanako visited Taro
Lattice and Hypergraph MERT
[Och 03]
Weights Model
太郎が花子を訪問した
Decode the Taro visited the Hanako Hanako visited Taro Taro visited Hanako ... Taro visited Hanako Find better weights
source (dev) n-best (dev) reference (dev)
Lattice and Hypergraph MERT
[Och 03]
Weights Model
太郎が花子を訪問した
Decode the Taro visited the Hanako Hanako visited Taro Taro visited Hanako ... Taro visited Hanako Find better weights
source (dev) n-best (dev) reference (dev)
8
Lattice and Hypergraph MERT
Weights wLM wTM Initial: 0.1 0.1 0.1 Score 0.20 Optimize wLM: 0.4 0.1 0.1 0.32 Optimize wTM: 0.4 0.1 0.1 0.32 Optimize wRM: 0.4 0.1 0.3 0.4 Optimize wLM: 0.35 0.1 0.3 0.41 Optimize wTM: wRM
Lattice and Hypergraph MERT
n-best list fixed weights: weight to be adjusted:
f1 φLM φTM φRM BLEU* e1,1 1
e1,2 0 1 1 e1,3 1 1 wLM=-1, wTM=1 f2 φLM φTM φRM BLEU* e2,1 1
e2,2 3 1 e2,3 2 1 2 1 wRM=???
* Calculating BLEU for one sentence is a bit simplified, usually we compute for the whole corpus
Lattice and Hypergraph MERT
Lattice and Hypergraph MERT
wLM=-1, wTM=1, wRM=??? f1 φLM φTM φRM e1,1 1
e1,2 0 1 e1,3 1 1
a1,1=-1 a1,2=0 a1,3=1 b1,1=-1 b1,2=1 b1,3=-1
Lattice and Hypergraph MERT
2 4
2 4
2 4
2 4
f1 hypotheses f2 hypotheses
e1,1 e1,2 e1,3 e2,1 e2,2 e2,3
a1,1=-1 a1,2=0 a1,3=1 b1,1=-1 b1,2=1 b1,3=-1 a2,1=-2 a2,2=1 a2,3=-2 b2,1=-1 b2,2=-3 b2,3=1
BLEU=1 BLEU=0
Lattice and Hypergraph MERT
2 4
2 4
2 4
2 4
f1 hypotheses f2 hypotheses
e1,1 e1,2 e1,3 e2,1 e2,2 e2,3
Lattice and Hypergraph MERT
2 4
2 4
2 4
2 4 e1,1 e1,2 e1,3 e2,1 e2,2 e2,3
2 4 1
2 4 1
BLEU
f1 f2
Lattice and Hypergraph MERT
2 4 1
2 4 1
BLEU
f1 f2
2 4 1
total accuracy
BLEU
Lattice and Hypergraph MERT
2 4 1
wRM ←1.0
total accuracy
BLEU
Lattice and Hypergraph MERT
Lattice and Hypergraph MERT
Problem! (not enough diversity)
Lattice and Hypergraph MERT
Traditional MERT in Green
[Macherey 08]
20
Lattice and Hypergraph MERT
Lattice and Hypergraph MERT
Taro the Taro met visited Hanako the Hanako
8 hypotheses in only 6 edges
Lattice and Hypergraph MERT
Taro the Taro met visited Hanako the Hanako
φLM=1, φTM=1, φRM=2 φLM=-2, φTM=-1, φRM=-1 φLM=2, φTM=0, φRM=1 φLM=1, φTM=1, φRM=-1 φLM=2, φTM=0, φRM=0 φLM=0, φTM=-1, φRM=-1
Taro met Hanako
φLM=1, φTM=1, φRM=2 φLM=1, φTM=1, φRM=-1 φLM=0, φTM=-1, φRM=-1
φLM=2, φTM=1, φRM=0
Lattice and Hypergraph MERT
Only different part!!
Lattice and Hypergraph MERT
Taro the Taro met visited Hanako the Hanako
φLM=1, φTM=1, φRM=2 φLM=-2, φTM=-1, φRM=-1 φLM=2, φTM=0, φRM=1 φLM=1, φTM=1, φRM=-1 φLM=2, φTM=0, φRM=0 φLM=0, φTM=-1, φRM=-1
Taro the Taro met visited Hanako the Hanako
a=2, b=0
wLM=-1, wTM=1, wRM=???
a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0
Lattice and Hypergraph MERT
previous nodes
Lattice and Hypergraph MERT
2 4
2 4
y=a x+b
a=0 b=0 “”
Taro the Taro met visited Hanako the Hanako
a=2, b=0 a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0
Lattice and Hypergraph MERT
2 4
2 4
2 4
2 4
y=a x+b
a=0 b=0 “”
Taro the Taro met visited Hanako the Hanako
a=2, b=0 a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0 a=2 b=0 “Taro” a=1 b=-2 “the Taro”
Lattice and Hypergraph MERT
2 4
2 4
y=a x+b
Taro the Taro met visited Hanako the Hanako
a=2, b=0 a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0 a=2 b=0 “Taro” a=1 b=-2 “the Taro”
2 4
2 4
a=1 b=-1 “Taro met” a=0 b=-3 “the Taro met” a=1 b=1 “Taro visited” a=0 b=-1 “the Taro visited”
Lattice and Hypergraph MERT
2 4
2 4
y=a x+b
Taro the Taro met visited Hanako the Hanako
a=2, b=0 a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0 a=2 b=0 “Taro” a=1 b=-2 “the Taro”
2 4
2 4
a=1 b=-1 “Taro met” a=0 b=-3 “the Taro met” a=1 b=1 “Taro visited” a=0 b=-1 “the Taro visited”
Delete all lines not in upper envelope
Lattice and Hypergraph MERT
2 4
2 4
y=a x+b
Taro the Taro met visited Hanako the Hanako
a=2, b=0 a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0 a=2 b=0 “Taro” a=1 b=-2 “the Taro”
2 4
2 4
a=1 b=1 “Taro visited” a=0 b=-1 “the Taro visited”
Lattice and Hypergraph MERT
Taro the Taro met visited Hanako the Hanako
a=2, b=0 a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0
2 4
2 4
a=1 b=1 “Taro visited” a=0 b=-1 “the Taro visited”
y=a x+b
a=1 b=-1 “Taro visited the Hanako” a=-1 b=-1 “the Taro visited Hanako” a=0 b=1 “Taro visited Hanako” a=0 b=-3 “the Taro visited the Hanako”
2 4
2 4
Lattice and Hypergraph MERT
Taro the Taro met visited Hanako the Hanako
a=2, b=0 a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0
2 4
2 4
a=1 b=1 “Taro visited” a=0 b=-1 “the Taro visited”
y=a x+b
a=1 b=-1 “Taro visited the Hanako” a=-1 b=-1 “the Taro visited Hanako” a=0 b=1 “Taro visited Hanako” a=0 b=-3 “the Taro visited the Hanako”
2 4
2 4
Lattice and Hypergraph MERT
Taro the Taro met visited Hanako the Hanako
a=2, b=0 a=1, b=-2 a=-1, b=-1 a=-1, b=1 a=0, b=-2 a=-1, b=0
2 4
2 4
a=1 b=1 “Taro visited” a=0 b=-1 “the Taro visited”
y=a x+b
a=1 b=-1 “Taro visited the Hanako” a=-1 b=-1 “the Taro visited Hanako” a=0 b=1 “Taro visited Hanako”
2 4
2 4
Lattice and Hypergraph MERT
Traditional MERT in Green Lattice MERT in Red
35
Lattice and Hypergraph MERT
36
Lattice and Hypergraph MERT
VP0-5 VP2-5 N2 N0 VP4-5 x1 with x0: 0.56 friend: 0.12 my friend: 0.3 VP0-5 PP0-1 VP2-5 PP2-3 N2 P3 V4 N0 P1 友達 と ご飯 を 食べ た SUF5 VP4-5 x1 x0: 0.6 ate: 0.5 a meal: 0.5 rice: 0.3
37
Lattice and Hypergraph MERT
2 4
2 4
2 4
2 4
2 4
2 4
Taro the Taro
a=2, b=0 a=1, b=-2
VP0-5 VP2-5 N0
x1 with x0: a=2 b=0
Lattice MERT Hypergraph MERT
38
Lattice and Hypergraph MERT
39
Lattice and Hypergraph MERT
the n-best list
MERT
efficiently using dynamic programming