Hostname: page-component-74656f9884-skzmx Total loading time: 0 Render date: 2026-11-06T00:45:31.354Z Has data issue: false hasContentIssue false

An empirical study of cyclical learning rate on neural machine translation

Published online by Cambridge University Press:  09 February 2022

Weixuan Wang
Affiliation:
Artificial Intelligence Application Research Center, Huawei Technologies, Co., Ltd., Shenzhen, People’s Republic of China
Choon Meng Lee
Affiliation:
Artificial Intelligence Application Research Center, Huawei Technologies, Co., Ltd., Shenzhen, People’s Republic of China
Jianfeng Liu
Affiliation:
Artificial Intelligence Application Research Center, Huawei Technologies, Co., Ltd., Shenzhen, People’s Republic of China
Talha Colakoglu
Affiliation:
Artificial Intelligence Application Research Center, Huawei Technologies, Co., Ltd., Shenzhen, People’s Republic of China
Wei Peng*
Affiliation:
Artificial Intelligence Application Research Center, Huawei Technologies, Co., Ltd., Shenzhen, People’s Republic of China
*
*Corresponding author. E-mail: peng.wei1@huawei.com
Rights & Permissions [Opens in a new window]

Abstract

In training deep learning networks, the optimizer and related learning rate are often used without much thought or with minimal tuning, even though it is crucial in ensuring a fast convergence to a good quality minimum of the loss function that can also generalize well on the test dataset. Drawing inspiration from the successful application of cyclical learning rate policy to computer vision tasks, we explore how cyclical learning rate can be applied to train transformer-based neural networks for neural machine translation. From our carefully designed experiments, we show that the choice of optimizers and the associated cyclical learning rate policy can have a significant impact on the performance. In addition, we establish guidelines when applying cyclical learning rates to neural machine translation tasks.

Information

Type
Article
Copyright
© The Author(s), 2022. Published by Cambridge University Press
Figure 0

Figure 1. The learning rate decay used in our experiments.

Figure 1

Algorithm 1 CLR-based NMT

Figure 2

Figure 2. Range test curve for the IWSLT2014-de-en dataset, showing the chosen base and maximum learning rate for the triangular policy.

Figure 3

Figure 3. Range test curve for the CV CIFAR-100 dataset.

Figure 4

Table 1. Datasets used for the experiment

Figure 5

Table 2. Hyperparameters for the experiments

Figure 6

Table 3. Learning rate boundary for CLR

Figure 7

Figure 4. A comparison study of training NMT models on IWSLT2014-de-en using CLR and INV with a range of initial learning rate on Adam. The learning rate policy “adam_cyc_nshink_5e-4” denotes the optimizer Adam is trained under CLR with the no shrink option and a maximum learning rate of $5e^{-4}$.

Figure 8

Figure 5. A comparison study of training NMT models on IWSLT2014-de-en using CLR and INV with a range of initial learning rates on SGD. The learning rate policy “sgd_cyc_yshink_5e-4” denotes the optimizer SGD that is trained under CLR with the shrink option and a maximum learning rate of $5e^{-4}$.

Figure 9

Table 4. The best BLEU for various learning rate policies when training NMT models on IWSLT2014-de-en, IWSLT2017-de-en and IWSLT2014-fr-en. The total number of training epochs for all the experiments is 50. The table is sorted by the best BLEU in descending order

Figure 10

Figure 6. A view of effects of applying CLR to Adam and SGD when training the NMT on IWSLT2014-de-en.

Figure 11

Figure 7. Effects of various batch sizes when training the NMT on IWSLT2014-de-en corpus with CLR.

Figure 12

Figure 8. Effects of various batch sizes when training the NMT on IWSLT2014-de-en corpus with TRI, COS, SINE, and INV under different learning rates. The validation loss shown in this figure is the minimal validation loss when training each model with a different batch size and learning rate configuration. The training was run for a fixed number of epochs (50).

Figure 13

Figure 9. The first $\eta_{\max}$ (MLR1) with “nshrink” is a preferable option for SGD when applying CLR to train NMT models on IWSLT2014-de-en.

Figure 14

Figure 10. The first $\eta_{\max}$ (MLR1) is a preferable option for Adam when applying CLR to train NMT models on IWSLT2014-de-en.

Figure 15

Figure 11. Comparison of the base learning rate with values of $1e^{-5}$ and $1e^{-8}$ for the IWSLT2014-de-en dataset.

Figure 16

Table 5. WMT 2014 DE2EN dataset used for the experiment

Figure 17

Table 6. The best BLEU scores for training NMT models on WMT14-de-en dataset using TRI and INV learning rate schedulers

Figure 18

Figure 12. Comparison of the validation loss with a maximum learning rate of $1e^{-3}$ for the WMT2014-de-en dataset.

Figure 19

Figure 13. Loss surface, optimizer trajectory, and learning rates visualization for training NMT models on IWSLT2014-de-en.

Figure 20

Figure A1. Range test curve of SGD for the IWSLT2014-de-en dataset.

Figure 21

Table A1. The comparison results of one GPU and four GPUs with a batch size of 4096

Figure 22

Figure A2. Effects of applying CLR to training NMT on IWSLT2017-de-en.

Figure 23

Figure A3. Effects of applying CLR to training NMT on IWSLT2014-fr-en.