arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2203.06211cs.CL
收藏

Transformer语言模型的分阶段训练

Staged Training for Transformer Language Models

University of California, Berkeley(加州大学伯克利分校);Allen Institute for AI(艾伦人工智能研究所)

Sheng Shen, Pete Walsh, Kurt Keutzer, Jesse Dodge, Matthew Peters, Iz Beltagy

摘要:

缩放Transformer语言模型的当前标准方法从不同的随机初始化训练每个模型大小。作为一种替代方案,我们考虑一个分阶段的训练设置,从一个小模型开始,通过应用“增长算子”来增加模型的深度和宽度,逐步增加用于训练的计算量。通过使用前一个阶段的输出初始化每个阶段,训练过程有效地重用了前一个阶段的计算,并且变得更加高效。我们的每个增长算子都将整个训练状态(包括模型参数、优化器状态、学习率调度等)作为输入。并输出训练从其继续的新训练状态。我们确定了这些增长算子的两个重要属性,即它们保留了应用该算子后的损失和“训练动态”。虽然之前已经讨论了损失保持属性,但据我们所知,这项工作是第一次确定保持训练动态(训练期间损失减少的速率)的重要性。为了找到阶段的最佳时间表,我们使用来自(Kaplan et al.,2020年)找到一个精确的时间表,当训练效率开始下降时,通过开始一个新的阶段来节省最多的计算。我们根据经验验证了我们的增长算子和自回归语言模型的阶段训练,与从头开始训练的强大基线相比,计算节省高达22%。我们的代码可在https://github.com/allenai/staged-training上获得。

英文摘要:

The current standard approach to scaling transformer language models trains each model size from a different random initialization. As an alternative, we consider a staged training setup that begins with a small model and incrementally increases the amount of compute used for training by applying a "growth operator" to increase the model depth and width. By initializing each stage with the output of the previous one, the training process effectively re-uses the compute from prior stages and becomes more efficient. Our growth operators each take as input the entire training state (including model parameters, optimizer state, learning rate schedule, etc.) and output a new training state from which training continues. We identify two important properties of these growth operators, namely that they preserve both the loss and the "training dynamics" after applying the operator. While the loss-preserving property has been discussed previously, to the best of our knowledge this work is the first to identify the importance of preserving the training dynamics (the rate of decrease of the loss during training). To find the optimal schedule for stages, we use the scaling laws from (Kaplan et al., 2020) to find a precise schedule that gives the most compute saving by starting a new stage when training efficiency starts decreasing. We empirically validate our growth operators and staged training for autoregressive language models, showing up to 22% compute savings compared to a strong baseline trained from scratch. Our code is available at https://github.com/allenai/staged-training.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑