6.1 Machine translation
The results: the Transformer against the best translation systems of 2017, on quality and on training cost, and how the paper decoded its translations.
| ByteNet | 23.75 | — |
|---|---|---|
| Deep-Att + PosUnk | — | — |
| GNMT + RL | 24.6 | 2.3 · 10¹⁹ |
| ConvS2S | 25.16 | 9.6 · 10¹⁸ |
| MoE | 26.03 | 2.0 · 10¹⁹ |
| Deep-Att + PosUnk Ensemble | — | — |
| GNMT + RL Ensemble | 26.30 | 1.8 · 10²⁰ |
| ConvS2S Ensemble | 26.36 | 7.7 · 10¹⁹ |
| Transformer (base model) | 27.3 | 3.3 · 10¹⁸ |
| Transformer (big) | 28.4 | 2.3 · 10¹⁹ |
BLEU EN-DE
BLEU on newstest2014, English to German: how many words and short phrases of each translation also appear in the human reference, from 0 to 100. Higher is better.
The paper gives one training cost for each Transformer, for both language pairs; a dash means the paper gives no value.
The paper's Table 2 redrawn: every system's BLEU score and training cost for English to German or English to French, the pair you pick, as bars, the Transformer's rows marked. Click a column's name to see what it measures.
What this section says
Table 2 sets the Transformer against the best systems of the time on the WMT 2014 test sets (newstest2014). The quality column is BLEU; the cost column estimates the floating-point operations spent on training: training time × number of GPUs × each GPU's sustained speed (footnote 5 gives the speeds).
English to German: the big Transformer scores 28.4, more than 2 BLEU above every earlier model, including ensembles that average several models. Even the base model, at 27.3, beats them all, at a fraction of their training cost. English to French: the abstract and Table 2 give the big model 41.8, a new best for a single model at less than a quarter of the cost of the previous best; the text of section 6.1 in arXiv version 7 says 41.0 at that point, a discrepancy in the paper itself.
How the translations were produced: the weights of the last 5 checkpoints (base) or 20 (big) averaged into one model, then beam search with a beam of 4 and a length penalty α = 0.6, chosen on the development set; the output may be up to 50 tokens longer than the input, but stops early when it can.
In the paper's words
“We used beam search with a beam size of \(4\) and length penalty \(\alpha=0.6\) [38].”
“Even our base model surpasses all previously published models and ensembles, at a fraction of the training cost of any of the competitive models.”
Quoted from Vaswani et al., Attention Is All You Need, arXiv:1706.03762v7(opens in a new tab). The figures on this page are redrawn, not copied.
The notation
| Symbol | Meaning | In the paper | Our miniature |
|---|---|---|---|
| \(\text{BLEU}\) | how closely a translation matches a human one, from 0 to 100 | 28.4 (EN-DE), 41.8 (EN-FR), big model | 99.95 on our 805 held-out sentences |
| \(\text{FLOPs}\) | floating-point operations spent on training | 3.3 · 10¹⁸ (base), 2.3 · 10¹⁹ (big) | not estimated: about four minutes on one processor |
| \(\text{beam size}\) | how many beginnings beam search keeps at every step | 4 | 4 |
| \(\alpha\) | the length penalty's strength: larger favours longer translations | 0.6 | 0.6 |
Try it
The BLEU calculator: type a German translation and a reference, and see the matching words and phrases highlighted, the four precisions, the brevity penalty and the score.
How our miniature differs
Our miniature decodes the same way, beam 4 and α = 0.6, without checkpoint averaging, and reaches BLEU 99.95 on our 805 held-out sentences. One finding the paper does not discuss: greedy search and beam search give different German for exactly one of them, “The old women see a car now .”, because our search, like the training script it copies, stops once four translations have finished, and four short, unlikely ones finished first (chapter 19).
Prepared in the Course by
Check yourself
Three questions a reader of this section should now be able to answer. The lab checks your answer against the paper and our models.
The base model
What BLEU score does the Transformer base model reach on English to German in Table 2?
The length penalty
The length penalty is ((5 + |Y|) / 6)^α. With α = 0.6, what is it for a translation of |Y| = 10 tokens? Give two decimals.