Early Weight Averaging meets High Learning Rates for LLM Pre-training

Sunny Sanyal, Atula Neerkaje, Jean Kaddour, Abhishek Kumar, Sujay Sanghavi
6/5/2023
cs.LGcs.AIcs.CL

No official code found. Best implementation: sanyalsunny111/Early_Weight_Avg (19 stars, last commit 2024-10-12).

Abstract

Training Large Language Models (LLMs) incurs significant cost; hence, any strategy that accelerates model convergence is helpful. In this paper, we investigate the ability of a simple idea checkpoint averaging along the trajectory of a training run to improve both convergence and generalization quite early on during training. Here we show that models trained with high learning rates observe higher gains due to checkpoint averaging. Furthermore, these gains are amplified when checkpoints are sampled with considerable spacing in training steps. Our training recipe outperforms conventional training and popular checkpoint averaging baselines such as exponential moving average (EMA) and stochastic moving average (SWA). We evaluate our training recipe by pre-training LLMs, where high learning rates are inherently preferred due to extremely large batch sizes. Specifically, we pre-trained nanoGPT-2 models of varying sizes, small (125M), medium (335M), and large (770M)on the OpenWebText dataset, comprised of 9B tokens. Additionally, we present results for publicly available Pythia LLMs, ranging from 1B to 12B, which were trained on the PILE-deduped dataset containing 207B tokens.

View on arXivView PDF

Code Implementations(1)

[COLM 2024] Early Weight Averaging meets High Learning Rates for LLM Pre-training

191PythonNov 27, 20232 years ago
gpt-2llmllm-training

Similar Papers

Cite this paper

@article{sanyal2023early,
  title  = {Early Weight Averaging meets High Learning Rates for LLM Pre-training},
  author = {Sunny Sanyal and Atula Neerkaje and Jean Kaddour and Abhishek Kumar and Sujay Sanghavi},
  year   = {2023},
  eprint = {2306.03241},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.03241v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.03241.svg)](https://codeofpaper.com/paper/2306.03241)

Discussion