Scaling Neural Machine Translation
Paper · 2018 · Myle Ott, Sergey Edunov, David Grangier et al.
Summary
Training a neural translator can take days on a single machine, even when it has several graphics processors. That wait matters each time researchers want to test a change to the training data or to the way the system learns. Scaling Neural Machine Translation asks how much of that time can be saved while preserving translation quality. The authors use the large configuration of the Transformer in fairseq and study translation from English into German and French. They start by changing how training runs on one machine, then distribute the work across machines, and finally use the faster setup to investigate whether a much larger source of bilingual text improves the results. Machine translation
On a single machine with 8 GPUs, the authors get nearly a 5x speedup. They use half-precision arithmetic for the forward and backward passes and keep the weight updates in full precision. A dynamically adjusted loss scale keeps gradients within the usable numerical range. They also accumulate gradients from several portions of the training data before updating the weights. This lets a machine use a large effective batch without processing all of it at once. A higher learning rate helps the system make faster progress with these larger batches. When the authors move to multiple machines, workers still contribute to a shared update, but communication for some gradients starts while the remaining gradients are being calculated.
On the English–German task, training reaches the earlier Transformer accuracy in under 5 hours on 8 GPUs and in 32 minutes on 128 GPUs. The longer runs answer a different question: how good are the translations when training is carried through to convergence? On newstest14, the paper reports 29.3 BLEU for English–German after 85 minutes and 43.2 BLEU for English–French after 8.5 hours, both on 128 GPUs. The authors report these as the best results under the benchmark conditions they compare, excluding systems trained with additional data. BLEU score
The larger training runs also make it practical to try Paracrawl, a vast collection of candidate translations drawn from the web. The authors remove obvious mismatches, score the remaining pairs with a translator trained on cleaner material, and mix the selected pairs with WMT data. English–German improves to 29.8 BLEU on newstest14. English–French falls to 42.1 BLEU on the same test split for that language pair. The training recipe therefore has two distinct uses. It makes experiments quicker on the hardware a researcher already has, and it makes experiments with much more data feasible when more hardware is available. The value of that extra data still has to be established for each translation task.
Deep dive: Scaling Neural Machine Translation
Scaling Neural Machine Translation shows how lower precision, larger batches and multiple GPUs cut training time and affect translation quality. · about 33 minutes to read
The problem and its context
Why faster training matters
A translator learns from paired sentences. During training, the system reads the source sentence, assigns probabilities to the words or pieces of words in the target sentence, and uses those predictions to determine how its weights should change. This happens repeatedly over a large collection of translations. A run can be expensive even when a single pass through a small portion of the data feels quick. The paper describes training competitive neural translators on a well-equipped machine as a job that can take several days.
That turnaround constrains the kinds of questions a researcher can ask. A comparison of training settings requires time for each setting to make enough progress to judge it. An experiment with additional data asks the system to process more material before the researcher can tell whether the material is worth using. These costs make the time taken to reach a meaningful validation target important alongside the quality of final translations. A technique that only processes batches faster could still be a poor bargain if it requires many more passes through the data to reach that target.
The architectural context is a sequence-to-sequence task. A sentence arrives as a sequence of tokens, and the translator produces a new sequence in the target language. The paper places its work after advances in attention-based translation, convolutional sequence processing, and the Transformer. It also notes the use of sequence-to-sequence systems in abstractive summarization and dialogue. These applications explain the broader interest in training such systems efficiently. The experiments themselves concern translation. Neural Machine Translation by Jointly Learning to Align and Translate · Convolutional Sequence to Sequence Learning · Attention Is All You Need
The paper takes a working architecture as its starting point. Its central question concerns all the activity around that architecture during training. How should the system represent intermediate values? How much text should contribute to a weight update? What should a processor do while another processor is finishing its work? These questions interact. A choice that saves memory may make it possible to give each processor more examples at once. A choice that reduces the number of updates may also reduce the number of times processors need to exchange information. A change to the update frequency can, in turn, make the learning rate worth revisiting.
Why adding processors changes the training problem
The paper describes two established ways to distribute a neural network. In layer-based parallelism, different workers carry out different parts of the network. In data parallelism, each worker has a copy of the complete network and carries out the same kind of computation on a different portion of the training batch. The authors choose data parallelism. A worker can process its own portion independently for much of the update, which makes the scheme a natural fit when each processor can hold a complete copy. GPU & parallel computing
The authors keep updates synchronous. Each worker calculates a gradient, meaning the information the optimizer uses to change the weights. The workers combine their contributions before the optimizer moves to the next version of the weights. The advantage for the experiment is that the portion processed by each worker contributes to a well-defined common batch. The cost is a dependency between workers. A processor that finishes early can still be waiting on the contribution of a processor with a slower portion of the batch. The paper calls these slow workers stragglers and examines how the shape of the data creates them.
Earlier large translation systems had already used synchronous training. The authors also describe work on distributing next-token prediction over many processors. They single out a difference in the work assigned to the devices. Translation uses paired sequences whose lengths vary on both the source and target sides. Groups of sentence pairs with similar token counts can still have different processing costs. The paper also distinguishes the learning-rate behavior in its translation runs from the earlier work, which started with a high rate. In the translation setup, the rate ramps up at the beginning of training.
Another approach described in the related work is to arrange data redundantly across workers so a synchronized update can proceed even when a worker falls behind. The paper’s approach keeps every worker’s contribution. It uses accumulation to give each worker a sequence of tasks between synchronization points, and it starts communication early enough to run alongside some of the remaining computation. In this design, the problem is how to fit the contributions together with less waiting.
Why precision and batch size belong in the same study
Earlier research had examined lower-precision arithmetic for neural networks, both during training and when a trained system is used to make predictions. The distinction matters because training has to represent intermediate quantities used to calculate gradients and update the weights. A number format that works for a forward prediction can still lose information during the backward pass. The authors follow prior mixed-precision work in adjusting the scale of the loss to make the backward calculation usable in half precision.
Batch size brings a different issue. A large batch needs more work before each update and gives the optimizer a gradient drawn from more examples. In synchronous training, the global batch includes the contributions of all workers. The authors thus need to know how a translator learns with large batches before interpreting a move to many machines. They relate the question to earlier research on large-batch optimization and on the interplay between batch size and the learning rate. The translation experiments examine both the number of examples processed and the number of weight updates, since these are different ways of measuring learning progress. Accurate, Large Minibatch SGD · Train Longer, Generalize Better
One machine is enough to study that optimization question. Several portions of a batch can be processed in succession, with their gradients saved until it is time to update. This lets the authors explore an update based on a great deal of text before bringing a network of machines into the experiment. It also gives the single-machine results practical importance in their own right. A researcher with limited hardware can change the batch seen by the optimizer even if the device’s memory would never hold all the data for that update at the same time.
The method, step by step
From a sentence pair to a training signal
Each training example is a source sentence and its target translation. The authors use byte pair encoding, or BPE, to split the text into units from a fixed vocabulary. A token can be a whole word or a piece of one. This representation lets the system handle words through their constituent pieces and makes the token count depend on how the text is segmented. For each translation task the authors build a joint vocabulary from the source and target WMT text. English–German uses 32K vocabulary symbols and English–French uses 40K. When using Paracrawl, the authors keep the WMT vocabulary for the corresponding language pair. Subword tokenization
The translator has an encoder that builds representations of the source tokens and a decoder that predicts the target sequence. Both the encoder and the decoder have 6 blocks. In an encoder block, self-attention lets the representation of a source token draw on other positions in the source sentence. A feed-forward part then transforms the resulting representations. It has a pair of fully connected layers with a ReLU operation between them. The ReLU supplies the nonlinearity between the two learned transformations.
The decoder also uses self-attention, so its predictions can use the target context available at that position. An additional attention operation reads the encoder’s representations. This gives the decoder access to the source when it makes its predictions. The decoder block then applies its feed-forward transformation. After each attention operation and after the feed-forward pair, a residual connection adds the input of that part back into its output. Layer normalization follows each such addition and adjusts the scale of the resulting representation. Deep Residual Learning for Image Recognition · Layer Normalization
The representation width is 1024, the inner feed-forward dimension is 4,096, and attention uses 16 heads. Each head performs an attention calculation as part of the larger operation. Dropout, which randomly suppresses some activations during training, has probability 0.3 for English–German and 0.1 for English–French. The English–German system has 210M trainable parameters and the English–French system has 222M. The authors implement their training procedure in the PyTorch version of fairseq. Dropout
The output for a target position is a distribution over the vocabulary. The loss is the numerical training signal that measures the discrepancy between the predictions and the targets. The authors use label smoothing with weight 0.1 on a uniform distribution over vocabulary entries. This gives some training weight to the uniform distribution alongside the observed target and discourages concentrating all probability on the target token during training. The loss supplies the starting point for the backward pass, which calculates how the parameters contributed to that error. Regularizing Neural Networks by Penalizing Confident Output Distributions
The flow below follows one update in distributed mixed-precision training. It begins at the level of a worker’s assigned sentence pairs and ends where workers can start computing with the refreshed weights.
A mixed-precision training update
The steps in order.
Which quantities use half precision
The forward pass calculates the network’s predictions. The backward pass works from the loss toward the inputs and determines how to adjust the adjustable weights. These passes dominate the arithmetic in training and are performed in FP16, the half-precision floating-point format. Volta GPUs have Tensor Cores that perform half-precision arithmetic efficiently. The workers also exchange gradients in FP16 during synchronization. The loss, the full-precision copy of the weights, and the optimizer calculations use FP32. That separation lets the system use faster arithmetic for much of the work while keeping sensitive parts of the update in a format with more numerical range and precision.
Floating-point formats can represent values only within a certain range. A result too large for the format can overflow. A result that is very small can underflow, so the exact gradient the optimizer needs may effectively vanish. Converting a value to full precision after the backward pass cannot restore information already lost during that pass. The authors act before gradients are formed by multiplying the loss by a scale after the forward calculation. Since differentiation carries that multiplier through to the gradients, the backward pass operates on gradients at the adjusted scale.
After synchronization, the gradients are converted to FP32 and the scale is undone before the optimizer uses them. The operation changes the sizes of intermediate values during computation while preserving their intended scale for the update. The full-precision copy also gives the optimizer a place to apply small weight changes. The next forward pass can then use the low-precision representation of the updated weights.
The scale changes over the course of training. When the implementation detects an overflow, it reduces the scale. When 2,000 updates have gone by without a detected overflow, it increases the scale. Overflow supplies a direct signal that the current scale is too large for some value. The paper explains that underflow cannot be detected in the same way, so the interval without overflows is used as a reason to try a larger scale. The authors describe the early stages as needing protection from overflow and the later stages, when the loss is smaller, as needing protection from underflow. The rule adjusts to what the backward calculation actually produces.
How much text goes into an update
The portion of the data processed in a forward and backward pass on a worker is a sub-batch. The authors group sentences of similar lengths and pad shorter sequences where necessary, so the corresponding operations can be carried out together. A token budget limits how much a worker takes on at once. The general notation in the straggler analysis gives the following example for a sub-batch:
N = 3.5k tokens
Here N is the maximum token count used to form a sub-batch. The equality sign assigns the example budget to N, and 3.5k tokens is the count in token units. This budget is local to the worker. In the batch-size comparison, the authors count target tokens without the padding when reporting the size of an effective batch.
A training update can draw on many sub-batches. With several workers, each contributes gradients from its own data. With accumulation, the same worker can process multiple sub-batches in sequence and hold onto their gradient contributions. Its weights stay fixed while it does that work, so the gradients belong to the same point in training. The global update uses contributions from the workers and from all the sub-batches assigned to that update. This is how the authors study a move from 25k to over 400k tokens per batch without requiring the whole batch to fit in memory.
The paper describes an accumulation setting of 16 backward computations for each weight update. On one machine, this lets the experiment emulate the batch used when work is spread across 16 nodes. There is still a difference in how that batch is delivered. Accumulation on one machine runs a series of calculations on the same devices, whereas distributing the work allows more of those calculations to run at the same time. The shared feature is how much data the update summarizes. In a separate change made possible by the lower memory use of half precision, the authors raise the local cap from 3.5k tokens per GPU to 5k tokens per GPU.
Accumulation also changes when processors need to wait for each other. When every sub-batch ends at a synchronization point, a worker that gets a quick sub-batch can repeatedly find itself idle. With several sub-batches between synchronization points, it can move on to another forward and backward pass. Individual sub-batches still vary in their processing times. A worker’s total work before the update now reflects a series of such assignments, so the timing of one unusually slow assignment is less likely to determine when everyone waits.
How the weights are updated
The optimizer is Adam. It uses running information about gradients to determine the update to each weight. The paper gives the following settings for its averaging and numerical-stability parameters. Adam
β₁ = 0.9
β₁ is Adam’s decay coefficient for the running average of gradients. The subscript identifies the coefficient used for that first moment, and = gives it the value 0.9. This coefficient controls how strongly the average retains past gradient information.
β₂ = 0.98
β₂ is the decay coefficient for the running average of squared gradients. Its subscript distinguishes that second-moment setting from the gradient average, and = assigns the value 0.98. The squared-gradient average helps set the scale of parameter changes.
ε = 1e−8
ε is Adam’s small numerical-stability constant. The sign = assigns it the value 1e−8, where e is the marker for decimal exponent notation and −8 is the exponent. The constant keeps the denominator used in the update away from zero.
The learning rate governs the overall size of the changes the optimizer makes. It rises linearly for 4,000 steps. The regular setting reaches 5e−4, and the setting identified as 2x lr reaches 1e−3. Both values are learning rates at the end of warmup, with e again marking the decimal exponent. The higher-rate experiments retain the warmup. After it, the rule described in the paper can be written as follows:
η ∝ 1/√t
η is the learning rate after warmup and t is the number of optimization steps. The proportionality sign ∝ expresses that the rate falls in proportion to the reciprocal of the square root of that step count. √ takes the square root, and 1/ denotes the reciprocal. The schedule is tied to weight updates. When more text goes into each update, the same point on the step schedule can represent a different amount of text processed.
How machines communicate during the backward pass
The experiments use DGX-1 nodes, each with 8 NVIDIA V100 GPUs, linked by Infiniband. The authors use NCCL2 and torch.distributed for communication. The operation that combines gradients across workers is an all-reduce. Each participant contributes its local values and receives the combined result. This lets the workers use the same gradient information for the synchronized update.
The gradient buffers that move between machines are large. The paper attributes buffers of 400MB to translators with over 200M parameters. Waiting until the entire backward pass ends before moving any of that information places the whole exchange after the computation. The implementation instead takes advantage of the order in which the backward pass produces gradients. Layers nearer the output finish their gradient calculations while layers closer to the input still have work ahead.
As each layer’s gradients become available for synchronization, they go into a buffer. The implementation uses a threshold of 150MB. When the buffered gradients reach that threshold, a background thread starts synchronizing them. Meanwhile, the backward pass continues through the remaining layers. The update still depends on receiving all required contributions. The purpose of overlap is to move part of the communication into time the worker would already spend computing.
Accumulation and overlap address different parts of the same update. Accumulation determines how often the workers need to synchronize. Overlap changes when communication for a given synchronization starts. Neither changes the fact that the workers must come together before they commit the next set of weights. The distributed run works by reducing the frequency and visible duration of these waits within a synchronous design.
Preparing a larger training corpus
For the data experiment, the authors begin with sentence pairs from Paracrawl. A candidate may look like a pair of translations because the mining procedure placed the sentences together, yet its contents can still be unsuitable for training. The authors first check properties that are cheap to compute. They reject pairs whose source-to-target length ratio exceeds 1.5, remove sentences exceeding 250 words, and remove pairs where the source and target are copies of one another.
Those checks leave many more pairs than the authors ultimately use. On English–German, they reduce 4.6B candidate pairs to 700M. The authors then train an English–German translator on WMT'14 news commentary and use it to score those 700M pairs. The score for a pair is the average token log-likelihood assigned to the target translation. Averaging over tokens makes the comparison depend on the probability per token. The scoring translator supplies a more selective judgment than the length and copy rules because it evaluates the paired text through a system trained on cleaner translations. Analyzing Uncertainty in Neural Machine Translation
The English–German run retains the 140M highest-scoring pairs. Applying the same procedure to English–French leaves 129M pairs. The authors then choose how frequently training draws from WMT and how frequently it draws from filtered Paracrawl. This is a separate choice from filtering. A corpus may supply a large pool of acceptable pairs while still receiving relatively little weight in the training stream. For instance, the paper uses 1:4 to describe a setting in which training draws 4 Paracrawl sentences per WMT sentence. Validation loss guides the comparison of sampling ratios.
Experiments and results
The benchmarks and the two measures of progress
English–German training uses the filtered WMT'16 setup associated with the earlier Transformer, with 4.5M sentence pairs. The held-out validation split is newstest13, and the test split is newstest14. English–French training uses the WMT'14 setup from the earlier convolutional translation work, with 36M sentence pairs. Its validation split is newstest12+13, and its test split is newstest14. The year in the German test name and the year attached to the German training data refer to different parts of the experiment. The paper’s references to the WMT'14 English–German benchmark concern the test, while its own German translator learns from WMT'16 training data.
The training-speed comparisons track how long it takes to hit a given loss on held-out English–German data. The paper gives a target of 4.32 perplexity on newstest13 and reports the associated negative log-likelihood, or NLL, as 2.11. NLL penalizes the system for assigning low probability to the observed target tokens. Perplexity expresses the same underlying prediction quality on another scale, with a lower value indicating better predictions of the held-out targets. The timing benchmark averages over 3 random seeds and excludes time spent running validation and saving checkpoints.
Test BLEU assesses generated translations by comparing their text with reference translations. The authors report case-sensitive tokenized BLEU with the multi-bleu script, and they also measure BLEU on detokenized output with SacreBLEU. The distinction matters because the handling of token boundaries is part of the evaluation procedure. They generate translations by beam search, which keeps several candidate continuations during decoding. The beam width is 4 and the length penalty is 0.6 in the reported experiments. The length penalty influences how the search ranks candidates of different lengths. A Call for Clarity in Reporting BLEU Scores
Validation perplexity can be measured by checking how much probability the system assigns to known target tokens. BLEU requires generating translations and comparing them with references. Time to a fixed perplexity is therefore suited to comparing the speed of training configurations under a shared criterion. Final test BLEU answers how well the resulting translator performs under the decoding and scoring setup. The benchmark for how quickly training reaches an earlier level of quality and the benchmark for the quality at convergence need to be read with their respective stopping conditions.
Time to the English–German validation target
The earliest baseline in the timing series is the authors’ own full-precision reimplementation on 8 GPUs. The half-precision comparison keeps batch size and the remaining training parameters fixed. It reaches 4.32 validation perplexity in 495 minutes, compared with 1,429 minutes for full precision. The paper describes the change as a 2.9x speedup and reports a 65% reduction in training time with no effect on accuracy in this comparison.
The subsequent single-machine settings add accumulation, the higher learning rate, and the larger local token budget. The paper attributes a further 40% reduction in training time on one machine to large batches together with the higher learning rate. The full single-machine recipe takes 294 minutes to reach the validation target. The paper gives a 4.9x speedup over the original full-precision run on the same 8 NVIDIA V100 GPUs. It also reports reaching the earlier Transformer accuracy in under 5 hours on the single machine.
Time to reach 4.32 perplexity on WMT English–German newstest13
Mixing lower precision with larger updates cuts training time further, and overlapping communication gives the fastest distributed run.
The numbers
| System or setting | minutes |
|---|---|
| One node, full precision | 1,429 |
| One node, half precision | 495 |
| One node, half precision with accumulation | 447 |
| One node, accumulation and higher learning rate | 311 |
| One node, higher learning rate and larger local sub-batches | 294 |
| Sixteen nodes, synchronous training | 37 |
| Sixteen nodes, overlapping communication and backpropagation (this paper) | 32 |
The paper compares the 37-minute distributed run to the 311-minute single-node setting with the higher learning rate. The 294-minute figure belongs to the single-node experiment with the larger local sub-batches. The change from 37 minutes to 32 minutes compares the distributed configurations with and without overlapping communication during back-propagation. The paper gives a 15% reduction for this change. Its account of the main result also reports matching the earlier Transformer’s English–German accuracy in 32 minutes with 128 GPUs.
The timing curves for English–German show negative log-likelihood on newstest13 as a function of elapsed time. The authors use the curves to illustrate the difference between training on one machine and training on 16. The curves concern progress on validation data. The longer WMT results have a different role in the paper because the authors let those runs continue beyond the point needed for the speed comparison.
Test translation quality at convergence
The WMT runs for final translation quality use the large Transformer on 16 nodes. The authors average the parameters from the last 10 saved checkpoints to produce the translator they test. A checkpoint is a saved set of weights. Parameter averaging combines those weights before decoding, so the stated scores refer to translations generated with the averaged parameters. The paper uses checkpoint averaging where it specifies it and gives this setting explicitly for the converged WMT runs.
The English–German WMT result is 29.3 BLEU on newstest14 in 1h 25min, also reported as 85 minutes. The earlier relative-position attention result cited for the same setup is 29.2 BLEU. With the larger training corpus that incorporates filtered Paracrawl, the score on the same test split is 29.8 BLEU. The paper describes that English–German run as taking less than 10 hours on a combined corpus of roughly 150M sentence pairs. Self-Attention with Relative Position Representations
Test BLEU on WMT English–German newstest14
The WMT-only run is close to the earlier relative-position result, and adding filtered Paracrawl yields the highest score.
The numbers
| System or setting | BLEU |
|---|---|
| Earlier Transformer with relative-position attention | 29.2 |
| Authors’ Transformer with WMT training | 29.3 |
| Authors’ Transformer with WMT and filtered Paracrawl (this paper) | 29.8 |
For English–French, WMT-only training reaches 43.2 BLEU on newstest14 in 8h 32min, reported as 8.5 hours in the abstract. The comparison in the conclusion gives 41.5 BLEU for the earlier relative-position approach. In this language pair, the paper’s WMT-only result is also the better of its two data settings. The run that mixes in filtered Paracrawl obtains 42.1 BLEU on newstest14.
Test BLEU on WMT English–French newstest14
The WMT-only run gives the highest score, with the mixed-corpus run falling below it.
The numbers
| System or setting | BLEU |
|---|---|
| Earlier Transformer with relative-position attention | 41.5 |
| Authors’ Transformer with WMT training (this paper) | 43.2 |
| Authors’ Transformer with WMT and filtered Paracrawl | 42.1 |
The authors describe the WMT results as state of the art within the benchmark comparison that excludes additional training data. The German chart includes the mixed-corpus run to show what happens when that data condition changes. The French chart makes the same distinction and shows why it matters. More available training text gives the authors another condition to test and yields different outcomes on the two translation directions.
Tuning the mixture of WMT and Paracrawl
In the English–German mixture experiment, validation loss on newstest13 gives the authors a way to compare how much weight to give the two sources. The 1:1 WMT-to-Paracrawl ratio produces the best validation result among the mixtures they compare and improves on WMT-only training on that validation split. Under the selected mixture, the German test set also improves in BLEU. The paper thus reports evidence at both stages of evaluation for adding the selected English–German pairs.
For English–French, the best mixture the authors find uses 3:1 WMT to Paracrawl. The resulting 42.1 BLEU on newstest14 stays below the WMT-only result of 43.2. The sampling ratio is evidence about how to weight corpora within the settings explored. The comparison with WMT alone is the evidence for whether the added corpus helps the final task. This separates a successful choice among mixtures from a successful decision to use a mixture at all.
What the ablations show
The largest single change comes from precision
The full-precision and mixed-precision runs give the clearest controlled comparison in the paper. They use the same batch size and keep the other training settings equal. The time to the English–German validation target falls from 1,429 to 495 minutes. Because the comparison happens before the authors increase the amount of data per update or raise the learning rate, the gain can be assigned to the mixed-precision training implementation as a whole. That implementation includes the low-precision computation, full-precision updates, and dynamic scaling needed to make the combination work.
The experiment also helps interpret the memory-related improvement later in the sequence. In the initial precision comparison, the authors hold the batch size fixed. Later they exploit lower memory use to raise the number of tokens that can be processed on a GPU in a pass. In the single-node setting with accumulated gradients and the higher learning rate, raising the local cap from 3.5k to 5k tokens per GPU takes the time to the English–German validation target from 311 to 294 minutes. The paper describes this as an additional 5% speedup. Keeping these comparisons distinct shows what happens first when arithmetic changes and then when the workload is allowed to use the memory savings.
Batch size looks different in epochs and in steps
The paper plots English–German newstest13 validation loss against both optimization steps and epochs. An optimization step is a weight update. An epoch is a pass through the training data. With larger batches, more examples contribute to each step, so the axes reflect different amounts of training work. A system can show more progress at a given step count and less progress at a given epoch count. The paper observes exactly that pattern early in training. Large batches bring the loss down faster in terms of steps, and their initial progress takes more passes through the data.
This distinction explains why a batch that is less efficient in its use of examples can still be attractive for distributed training. Every synchronized update introduces a point where worker contributions must come together. Progress in fewer steps can reduce the frequency of that cost for a given amount of learning. At the same time, a large cluster can carry out work on more examples in parallel. The two loss plots identify a tradeoff that an elapsed-time comparison alone could obscure.
On one node, accumulation raises throughput by 36% in tokens per second in the comparison reported by the authors. The time to 4.32 perplexity on newstest13 becomes 447 minutes. Throughput counts how fast the training system processes text, while the fixed-target timing includes how effectively those tokens move the translator towards the target. Reporting both helps show why a throughput gain and a training-time gain have different sizes.
Raising the learning rate in the accumulated setting brings the fixed-target time down to 311 minutes. The relevant comparison is with the preceding large-batch setting. That is evidence for changing the rate once the authors have changed how much data contributes to each step. The higher peak still follows a warmup. Since the result comes from a particular batch regime and training schedule, its practical meaning is that batch size and learning rate have to be considered together when assessing time to a validation goal.
What the straggler measurements reveal
To examine how much the work varies between assignments, the authors measure the processing time of 44K English–German training sub-batches. The forward and backward passes on these sub-batches take 0.11 seconds on average. The fastest measured sub-batch takes 0.049 seconds and the slowest takes 0.228 seconds. The groups consist of similarly sized sentences and use a maximum of 3.5k tokens, so the spread occurs even with a common policy for limiting the amount of text assigned to each device.
There are several ways for sub-batches to differ under that policy. They can contain different numbers of sentences. The longest source sentence and the longest target sentence can differ from one sub-batch to another. Padding depends on these lengths, which helps explain why the token budget is an incomplete predictor of work. The paper describes one group of similar shapes with this shorthand:
23 ≤ src len ≈ tgt len ≤ 27
src len and tgt len denote the source and target lengths used to characterize the sub-batch shape. The ≤ signs put the endpoints at 23 and 27, and ≈ indicates that the source and target lengths are approximately equal. The lengths describe token sequences. In this subset with similar shapes, the variation in processing time is much smaller.
That observation suggests grouping similar shapes across workers in each update. It gives the devices assignments that tend to finish at similar times. The authors try this and find that training fails to reach the target perplexity of 4.32 on newstest13. Their explanation is that making the worker assignments alike within an update increases the variability of gradients across updates. A synchronized batch drawn from similar shapes can give the optimizer a less representative snapshot of the training data. The trial shows that balancing the computational workload alone is an insufficient criterion for choosing the contents of a batch.
The authors also test a method that balances predicted processing time without requiring all workers to receive the same shapes. They choose a target duration, giving the 90th percentile of the measured sub-batch times as an example, and hold the target fixed through training. A lookup table estimates time from the sentence count and the maximum lengths on the source and target sides. When constructing a sub-batch, they adjust the sentence count until the estimated duration is near the target.
On one node, the time-based method raises throughput from 143k to 150k tokens per second and cuts the time to 4.32 perplexity on newstest13 from 495 to 479 minutes. Accumulation reaches that target in 447 minutes. The two strategies use different levers. The time-based method tries to make an individual assignment predictable. Accumulation lets assignments differ and gives devices more work to do between synchronization points. In the measured single-node setting, the latter yields a larger gain and also provides the large effective batch used in the higher-learning-rate experiment.
Overlap produces a gain even after training is distributed
The communication comparison uses the same move to synchronous training across 16 nodes and asks what happens when gradients can begin moving before back-propagation completes. The time falls from 37 to 32 minutes for the English–German newstest13 target. In this comparison, the authors already have enough hardware to distribute the gradient calculation. The remaining gain comes from how they schedule work on that hardware.
The result also puts the straggler tests in context. A worker can spend time waiting because another device is still computing, or because the already-computed contributions still have to travel between machines. Changing batch construction helps with the first kind of delay. Starting communication during the backward pass helps with the second. Both matter even in a design where all workers participate in every update.
The data comparison qualifies the benefit of scale
The Paracrawl experiments hold onto the broad WMT training setup and change the availability and sampling of additional data. The English–German validation comparison shows a preference for 1:1 among the tested sampling ratios. The corresponding test score rises to 29.8 BLEU on newstest14. The English–French experiment favors 3:1 among its mixtures, yet its final test score of 42.1 BLEU is below the WMT-only score. These are controlled comparisons of training data settings alongside the systems experiments.
The English–German result establishes that the selected additional data can be useful under the paper’s procedure. The French result establishes that filtering and ratio selection can still leave a mixture that performs worse than the clean baseline. The experiments report the effect of the package of choices used for each language pair, including how the pairs were filtered and how frequently they were sampled. They give a direct measurement of the outcome the authors ultimately care about: translation quality after training.
Limitations
Limits identified by the authors
The authors explicitly call out the overhead of scaling across machines. They summarize 16-node training as approximately 10x faster than single-node training. That is a substantial reduction in elapsed time, with a considerable gap between the hardware increase and the speedup reported. Workers still have to communicate a large set of gradients and synchronize their updates. Overlap recovers some time within that design, while the paper leaves better batching and communication techniques open to further study.
The paper also identifies a narrow source of stragglers for detailed analysis. It measures the time taken to process different kinds of sub-batches and acknowledges that workers can fall behind for other reasons. The histogram and shape comparisons describe the variation introduced by the data and its grouping. The conclusion that time-based batching helps applies to that source of variation and to the hardware on which the timings were measured.
The authors give a qualified account of the larger-batch learning curves. Validation loss improves more slowly at first when progress is expressed in passes through the data. Faster progress in weight updates can pay off in a synchronous implementation, where updates incur a communication cost. The evidence supports large batches as a way to reduce elapsed time under these conditions while recording a cost in how efficiently the training examples advance early learning.
The authors also report that the Paracrawl mixture harms English–French test BLEU in their setup, even though it helps English–German. Their strongest quality claim on WMT is limited to comparison with systems trained without extra data. The results with WMT plus Paracrawl answer a different benchmark question and are presented on that basis.
Limits visible in the experimental setup
The central timing study uses English–German newstest13 and a particular target of 4.32 perplexity. Averaging over 3 random seeds makes the reported time less dependent on a single run, but the stated timings still summarize one translation setup, one target, and one measurement convention. In particular, validation and checkpoint saving are excluded. The average is a measure of the training work the authors chose to time. A researcher budgeting a complete series of experiments would also account for the work outside that measurement.
The fixed target supplies a consistent finish line for the speed comparisons. It does not show how every setting behaves after reaching that line. The final WMT test results show the quality achieved by the authors’ selected large-scale runs, with averaged checkpoints. Taken together, these experiments demonstrate a fast route to the target and strong final results for the chosen recipe. They leave less direct evidence about how each precision, batching, and optimizer change individually affects final test BLEU.
The experiments use a particular architecture, accelerator, and communication setup. Half-precision speed depends in part on the Volta Tensor Cores. The measured value of overlap depends on the costs of computing gradients and exchanging them over the hardware in the experiment. The buffer threshold and the time estimates used for sub-batches are settings measured or chosen in that environment. The mechanisms can be understood independently of the hardware, but the reported times and speedups are specific to the setup in the paper.
The precision comparison changes the arithmetic together with the care taken to handle that arithmetic. It demonstrates that half precision with the stated full-precision operations and dynamic scaling trains effectively in this experiment. It gives no independent measurement of how the same run would behave with a fixed loss scale, a different criterion for increasing the scale, or a full-precision gradient exchange. Similarly, the learning-rate result comes from a sequence of changes in a large-batch configuration. The paper supplies evidence for the tested schedule and peak settings and leaves the best settings for other batch sizes undetermined.
The Paracrawl experiments combine length and duplicate screening, likelihood-based selection, and a tuned mixture. The final test scores show what that full process yields. The comparisons described in the paper do not isolate the effect of each filtering rule or show what would happen under a different scoring direction, cutoff, or mixture. A high token likelihood under a translator trained on news commentary is a ranking criterion for the candidate pairs. It is not a direct assessment of how well each retained pair will contribute to translation quality on newstest14.
English–German starts with a smaller WMT corpus than English–French. The language pair, the amount of WMT data, the retained Paracrawl set, and the selected sampling ratio all differ. The experiments do not establish which of those differences explains the opposite test outcomes. They support treating the value of the added corpus as an empirical question for each language pair under the training conditions used.
Finally, elapsed time measures how long the researcher waits for a run to reach its target. The paper gives the device counts and elapsed times, with no energy measurements. Its results support a claim about turnaround and the feasibility of larger training runs. Conclusions about energy use or the cost of running an equivalent experiment on a different cluster would require other measurements.
What came after
Training infrastructure and Transformer research
The later citations show the range of questions for which Scaling Neural Machine Translation became relevant. The clearest continuity is fairseq. The translation paper uses its PyTorch implementation to bring together the architecture, optimizer, batch formation, and distributed execution. The later fairseq paper takes the toolkit for sequence learning as its subject. The connection is concrete because the earlier experiment already identifies fairseq as the implementation behind its results. The toolkit paper has a broader object of study than the particular recipe for English–German and English–French training.
Learning Deep Transformers for Machine Translation addresses depth in the same family of translation systems. The earlier work holds the large Transformer architecture fixed for its main training comparisons and changes how quickly it can be trained. The later title points to another dimension of the training problem, learning with deeper Transformers. The citation connects work on executing a fixed architecture efficiently with work concerned with how the architecture can be made deeper. It does not specify which precision or batch settings the later authors used.
Reformer also cites the paper and takes Transformer efficiency as its stated subject. The earlier study makes clear that efficiency can depend on several parts of a training run, from the representation of a gradient to the time spent waiting for communication. The later work frames efficiency around a named Transformer design. The connection is a shared concern with practical efficiency, with the later title giving no basis for attributing the earlier training recipe to it.
RoBERTa brings the citation into BERT pretraining. Its stated focus on optimizing the pretraining approach has a parallel in the translation paper’s treatment of training settings as choices that materially affect the result. In the earlier experiment, batch size, learning rate, and the implementation of the update each change what can be achieved in a given time. The citation places that experiment alongside a later investigation of how training itself is configured in a different task setting. Language pretraining
Scaling the data and reducing numerical precision
Massively Multilingual Neural Machine Translation brings another meaning of scale to machine translation. In the earlier paper, the authors run English–German and English–French as separate tasks, with separate data settings and validation choices. The later paper’s stated subject is translation across many languages. That extends the scope of the research question from how efficiently a translator can learn on a given language pair to the multilingual setting. The citation establishes the link between the studies, while the exact training choices of the later study remain unspecified here. Multilingual and cross-lingual NLP
Margin-based Parallel Corpus Mining deals with obtaining bilingual sentence pairs through multilingual sentence representations. This addresses an earlier stage of the data problem than the Paracrawl experiment. Scaling Neural Machine Translation begins with candidate pairs and uses rules and translation likelihood to rank them for training. The later title identifies parallel-corpus mining itself as the focus. The two studies meet at the need for usable bilingual text, with the earlier work testing the value of a filtered corpus in a translator and the later work taking the selection of pairs as the research question.
8-bit Optimizers via Block-wise Quantization returns to numerical precision and directs attention to the optimizer. In the translation paper, the division of precision is deliberate. Forward and backward computations and gradient exchange use FP16, while optimization uses FP32. The later work’s title identifies optimizer precision and block-wise quantization as its subject. The connection is the question of which parts of training can use a narrower representation, with the later work directed at a part that the translation paper kept in full precision.
These citations connect the paper to work on training infrastructure, architectural efficiency, multilingual translation, corpus construction, and numerical representation. They establish those relationships and identify the later papers’ stated subjects. Apart from the direct connection through the fairseq toolkit, they do not establish which later experiments reused the paper’s loss scaling, batch accumulation, or communication schedule.
Institutions
Fields, topics and concepts
Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 works
Topics 1Research subjects and languages the work is about.Machine translation · 1,109 works
Cite
Cite as Myle Ott, Sergey Edunov, David Grangier and Michael Auli. 2018. Scaling Neural Machine Translation. Proceedings of the Third Conference on Machine Translation: Research Papers.
@inproceedings{ott2018scaling,
title = {{Scaling Neural Machine Translation}},
author = {Myle Ott, Sergey Edunov, David Grangier and Michael Auli},
booktitle = {Proceedings of the Third Conference on Machine Translation: Research Papers},
year = {2018},
doi = {10.18653/v1/w18-6301},
eprint = {1806.00187},
archivePrefix = {arXiv},
url = {https://doi.org/10.18653/v1/w18-6301}
}References
- Karim Ahmed, Nitish Shirish Keskar, and Richard Socher. 2017. Weighted transformer network for machine translation. arxiv, 1711.02132. OpenAlex ↗ · Scholar ↗
- Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. 2016. Layer normalization. arXiv preprint arXiv:1607.06450. OpenAlex ↗ · Scholar ↗
- Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In Proc. of ICLR. our card
- Jianmin Chen, Rajat Monga, Samy Bengio, and Rafal Józefowicz. 2016. Revisiting distributed synchronous sgd. Arxiv, 1604.00981. OpenAlex ↗ · Scholar ↗
- Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin Johnson, Wolfgang Macherey, George Foster, Llion Jones, Niki Parmar, Mike Schuster, Zhifeng Chen, Yonghui Wu, and Macduff Hughes. 2018. The best of both worlds: Combining recent advances in neural machine translation. arxiv, 1804.09849. our card
- Adam Coates, Brody Huval, Tao Wang, David J. Wu, Bryan Catanzaro, and Andrew Y. Ng. 2013. Deep learning with cots hpc systems. In Proc. of ICML. OpenAlex ↗ · Scholar ↗
- Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. 2015. Training deep neural networks with low precision multiplications. OpenAlex ↗ · Scholar ↗
- Jeff Dean. 2017. Machine learning for systems and systems for machine learning. In Proc. of NIPS Workshop on ML Systems. OpenAlex ↗ · Scholar ↗
- Jeffrey Dean, Gregory S. Corrado, Rajat Monga, Kai Chen, Matthieu Devin, Quoc V. Le, Mark Z. Mao, Marc'Aurelio Ranzato, Andrew W. Senior, Paul A. Tucker, Ke Yang, and Andrew Y. Ng. 2012. Large scale distributed deep networks. In Proc. of NIPS. OpenAlex ↗ · Scholar ↗
- Ondrej Dusek and Filip Jurcícek. 2016. Sequence-to-sequence generation for spoken dialogue via deep syntax trees and strings. In Proc. of ACL. our card
- Sergey Edunov, Myle Ott, and Sam Gross. 2017. Fairseq. https://github.com/pytorch/fairseq. OpenAlex ↗ · Scholar ↗
- Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. 2017. Convolutional Sequence to Sequence Learning. In Proc. of ICML. our card
- Priya Goyal, Piotr Dollár, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. 2017. Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour. In Proc. of CVPR. our card
- Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. 2015. Deep Residual Learning for Image Recognition. In Proc. of CVPR. our card
- Elad Hoffer, Itay Hubara, and Daniel Soudry. 2017. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. In Proc. of NIPS, pages 1729–1739. our card
- Diederik P. Kingma and Jimmy Ba. 2015. Adam: A Method for Stochastic Optimization. In Proc. of ICLR. our card
- Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondrej Bojar, Alexandra Constantin, and Evan Herbst. 2007. Moses: Open source toolkit for statistical machine translation. In ACL Demo Session. OpenAlex ↗ · Scholar ↗
- Jaroslaw Kutylowski. 2018. Deepl press information. https://www.deepl.com/press.html. OpenAlex ↗ · Scholar ↗
- Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory F. Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, and Hao Wu. 2018. Mixed Precision Training. In Proc. of ICLR. OpenAlex ↗ · Scholar ↗
- Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. 2018. Analyzing uncertainty in neural machine translation. In International Conference on Machine Learning (ICML). our card
- ParaCrawl. 2018. ParaCrawl. http://paracrawl.eu/download.html. OpenAlex ↗ · Scholar ↗
- Romain Paulus, Caiming Xiong, and Richard Socher. 2018. A deep reinforced model for abstractive summarization. In Proc. of ICLR. our card
- Gabriel Pereyra, George Tucker, Jan Chorowski, Lukasz Kaiser, and Geoffrey E. Hinton. 2017. Regularizing neural networks by penalizing confident output distributions. In Proc. of ICLR Workshop. our card
- Matt Post. 2018. A call for clarity in reporting bleu scores. arXiv, 1804.08771. our card
- Raul Puri, Robert Kirby, Nikolai Yakovenko, and Bryan Catanzaro. 2018. Large scale language modeling: Converging on 40gb of text in four hours. arXiv preprint arXiv:1808.01371. OpenAlex ↗ · Scholar ↗
- Jerry Quinn and Miguel Ballesteros. 2018. Pieces of eight: 8-bit neural machine translation. In Proc. of NAACL. OpenAlex ↗ · Scholar ↗
- Christopher De Sa, Megan Leszczynski, Jian Zhang, Alana Marzoev, Christopher R. Aberger, Kunle Olukotun, and Christopher Ré. 2018. High-accuracy low-precision training. Arxiv, 1803.03383. OpenAlex ↗ · Scholar ↗
- Abigail See, Peter J Liu, and Christopher D Manning. 2017. Get to the point: Summarization with pointer-generator networks. In Proc. of ACL. OpenAlex ↗ · Scholar ↗
- Rico Sennrich, Barry Haddow, and Alexandra Birch. 2016. Neural machine translation of rare words with subword units. In Proc. of ACL. our card
- Iulian Serban, Alessandro Sordoni, Ryan Joseph Lowe, Laurent Charlin, Joelle Pineau, Aaron C. Courville, and Yoshua Bengio. 2017. A hierarchical latent variable encoder-decoder model for generating dialogues. In Proc. of AAAI. our card
- Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. 2018. Self-attention with relative position representations. In Proc. of NAACL. our card
- Patrice Y. Simard and Hans Peter Graf. 1993. Backpropagation without multiplication. In Proc. of NIPS. OpenAlex ↗ · Scholar ↗
- Samuel L. Smith, Pieter-Jan Kindermans, and Quoc V. Le. 2018. Don't decay the learning rate, increase the batch size. In Proc. of ICLR. OpenAlex ↗ · Scholar ↗
- Alessandro Sordoni, Michel Galley2, Michael Auli, Chris Brockett, Yangfeng Ji, Margaret Mitchell, Jian-Yun Nie, Jianfeng Gao, and Bill Dolan. 2015. A neural network approach to context-sensitive generation of conversational responses. In Proc. of ACL. our card
- Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. 2014. Dropout: a simple way to prevent neural networks from overfitting. The Journal of Machine Learning Research, 15(1):1929–1958. our card
- Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. 2015. Rethinking the Inception Architecture for Computer Vision. arXiv preprint arXiv:1512.00567. OpenAlex ↗ · Scholar ↗
- Rashish Tandon, Qi Lei, Alexandros G. Dimakis, and Nikos Karampatziakis. 2017. Gradient Coding: Avoiding Stragglers in Distributed Learning. In Proc. of ICML. OpenAlex ↗ · Scholar ↗
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention Is All You Need. In Proc. of NIPS. our card
- Hainan Xu and Philipp Koehn. 2017. Zipporah: a fast and scalable data cleaning system for noisy web-crawled parallel corpora. In Proc. of EMNLP. OpenAlex ↗ · Scholar ↗
- Min Ye and Emmanuel Abbe. 2018. Communication-Computation Efficient Gradient Coding. In Proc. of ICML. OpenAlex ↗ · Scholar ↗
This page in Markdown https://md.research.elamur.ai/free/en/papers/ott-2018-scaling-neural-machine-translation/