# Poster 29358

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/29358

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Hey, my name is Johan Björk and today I'll be presenting our paper Scaling Optimal Learning Rate Across Token Horizons. As I said,
Perhaps known by most in the audience, large language models are powered by scaling. It's been observed in seminal paper of Kaplan et al. that large language models performance improves reliably as you scale the compute used, the model size, and the total training data set or token horizon used to train them. This has been demonstrated in neural scaling loss where model performance or validation loss decreases reliably as you scale model size, clusters, cluster size, or total FLOPs and training tokens.
Given this, it is no surprise that practitioners reliably scale all these three factors: model size, total flops or cluster size, and training tokens. Large language model training is sensitive to hyperparameters such as weight decay and learning rate, and at the very largest scales, it is simply too expensive to tune hyperparameters.
For this reason, practitioners need to infer the optimal hyperparameters at a large scale from small scale experiments.
This practice is known as hyperparameter transfer and perhaps the most well-known paper is the MyUPI paper by Yang et al. There they find a way to parameterize a model so the optimal learning rate will transfer from small scale to large scale. You can find the optimal learning rate by using an exhaustive sweep at a small scale and then simply use that at a large scale.
In this paper, we ask a similar question. How do you scale hyperparameters when you increase the training token budget or the total token horizon? So this is a pretty broad question and we need to narrow it a little bit to have enough computer run experiments. We will focus on learning rate, which is arguably the most important hyperparameter. We'll also focus on text-only LLMs and we will consider training budgets of up to 800 billion tokens.
For experimental setup, we'll generally follow the GBT3 paper and model architecture. We'll use refined web dataset, which is a common crawl-derived text-only dataset. We'll use the Megatron code base, a cosine learning rate schedule, where we simply change the maximum learning rate, and we'll infer the optimal learning rate with a polynomial fit to a discrete set of measurements.
The upshot of our paper is that longer training necessitates smaller learning rate. Below we see the validation loss for the same model trained with two different token horizons and for different learning rates. At the top we see the model trained with 25 billion tokens and we see that the optimal learning rate is somewhere between 2 to the minus 11 and 2 to the minus 10.
Below we see the same model trained for similar learning rates but with 400 billion tokens. We see there that the optimal learning rate is roughly 2 to the minus 12. So longer training or larger token horizon is a smaller learning rate.
We can dive into this a little bit more in detail. So here we see the discrete points and our polynomial fit for a 350 million parameter model. We see clearly that for larger token horizons the optimal learning rate decreases and here the optimal learning rate is denoted by a star.
We see the same trend clearly for models of different sizes. So here we have a 50 million parameter model, a 125 million parameter model, a 760 million parameter model and a 2.7 billion parameter model. For all of them we see a consistent trend. Longer training horizons, this is the smaller learning rate. So when we train longer we need to decrease the learning rate.
We see through our experiments that the optimal learning rate decreases reliably as a function of token horizon, and we find that this dependence follows a scaling law. The formula is given below, where the optimal learning rate for a dataset of size D scales as B, where B is a constant, times the dataset size D raised to a power of minus beta.
To the right we see this loss where the dashed line is our fit and the points correspond to real measurements. We see an excellent fit which demonstrates that this scaling loss hold reliably. At last we use our scaling law to infer what the optimal learning rate should be for Lama.
Specifically, we used the LAMA-1 model architecture and trained the model for some short horizons. From these, we used our scaling laws and extrapolated what the optimal learning rate should be. We find that the optimal learning rate is lower than what's used in the LAMA-1 paper. This highlights how hyperparameter transfer is an unappreciated part of training LLMs. Thank you.
