Skip to main content
QUICK REVIEW

[论文解读] One Epoch Is All You Need

Aran Komatsuzaki|arXiv (Cornell University)|Jun 16, 2019
Topic Modeling参考文献 16被引用 19
一句话总结

本文提出仅在一个更大规模的数据集上训练无监督Transformer语言模型一整个训练周期,同时通过所提出的启发式方法调整模型大小和训练迭代次数。该方法在不产生过拟合的情况下,实现了3.3–5.1倍的时钟时间加速,优于多周期训练,并为将BERT和GPT-2等模型的训练成本降低至原来的十分之一提供了可行路径。

ABSTRACT

In unsupervised learning, collecting more data is not always a costly process unlike the training. For example, it is not hard to enlarge the 40GB WebText used for training GPT-2 by modifying its sampling methodology considering how many webpages there are in the Internet. On the other hand, given that training on this dataset already costs tens of thousands of dollars, training on a larger dataset naively is not cost-wise feasible. In this paper, we suggest to train on a larger dataset for only one epoch unlike the current practice, in which the unsupervised models are trained for from tens to hundreds of epochs. Furthermore, we suggest to adjust the model size and the number of iterations to be performed appropriately. We show that the performance of Transformer language model becomes dramatically improved in this way, especially if the original number of epochs is greater. For example, by replacing the training for 10 epochs with the one epoch training, this translates to 1.9-3.3x speedup in wall-clock time in our settings and more if the original number of epochs is greater. Under one epoch training, no overfitting occurs, and regularization method does nothing but slows down the training. Also, the curve of test loss over iterations follows power-law extensively. We compare the wall-clock time of the training of models with different parameter budget under one epoch training, and we show that size/iteration adjustment based on our proposed heuristics leads to 1-2.7x speedup in our cases. With the two methods combined, we achieve 3.3-5.1x speedup. Finally, we speculate various implications of one epoch training and size/iteration adjustment. In particular, based on our analysis we believe that we can reduce the cost to train the state-of-the-art models as BERT and GPT-2 dramatically, maybe even by the factor of 10.

研究动机与目标

  • 为解决在大规模数据集上进行多周期训练时大型语言模型训练的高计算成本问题。
  • 探究在扩大数据集规模和模型容量的同时,将训练周期减少至一个,是否能够提升效率与性能。
  • 开发一种启发式方法,用于调整模型大小和迭代次数,以在单周期训练下保持或提升性能。
  • 挑战在数据充足的情况下,无监督学习中多周期训练对收敛是必要的传统观念。
  • 探索通过该方法将SOTA模型(如BERT和GPT-2)的训练成本降低至十分之一的可行性。

提出的方法

  • 扩大训练数据集规模——例如通过采用宽松策略从互联网中采样更多网页——以确保在一个周期内不重复使用样本。
  • 消除所有正则化技术,因为其在单周期设置下被证明会减慢训练速度,且无法防止过拟合。
  • 使用所提出的启发式方法调整模型大小和训练迭代次数,以在保持计算成本的前提下平衡参数预算与序列长度。
  • 在扩大后的数据集上精确训练一个周期,使用与传统多周期训练相同的总参数更新次数。
  • 通过在迭代过程中对测试损失进行幂律拟合,分析训练动态并验证单周期训练的稳定性。
  • 应用数据采样启发式方法,纳入更多来自互联网的网页,即使包含部分损坏样本,并探索过滤或减轻其影响的方法。

实验结果

研究问题

  • RQ1在更大的数据集上仅训练一个周期的Transformer语言模型,是否能在相同计算预算下实现优于多周期训练的性能?
  • RQ2当数据集足够大时,单周期训练是否会发生过拟合?正则化方法是否可安全移除?
  • RQ3在单周期训练下,模型大小与训练迭代次数之间最优权衡为何?如何最大化性能?
  • RQ4单周期训练中,测试损失曲线在迭代过程中的行为如何?是否遵循幂律分布?
  • RQ5能否通过该方法将BERT和GPT-2等SOTA模型的训练成本降低十倍?

主要发现

  • 通过扩大数据集并合理调整模型大小与迭代次数,单周期训练相比传统多周期训练可实现3.3–5.1倍的时钟时间加速。
  • 单周期训练中未发生过拟合,且正则化方法无效,仅会减慢训练速度而无实际益处。
  • 测试损失随迭代次数的变化广泛符合幂律分布,表明训练动态稳定且可预测。
  • 在单周期训练下,Transformer语言模型的性能显著提升,尤其当原始训练周期数较高(如10个或以上)时更为明显。
  • 所提出的模型大小与迭代次数调整启发式方法,单独应用时可实现1–2.7倍的加速;与单周期训练结合后,在作者实验中实现3.3–5.1倍的加速。
  • 作者推测,基于其对扩展性与效率的分析,该方法有望将BERT和GPT-2等模型的训练成本降低至十分之一。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。