Scaling Laws and Compute-Optimal Training Beyond Fixed Training Durations

Scale has become a main ingredient in obtaining strong machine learning models. As a result, understanding a model's scaling properties is key to effectively designing both the right training setup as well as future generations of architectures. In this work, we argue that scale and training research has been needlessly complex due to reliance on the cosine schedule, which prevents training across different lengths for the same model size. We investigate the training behavior of a direct alternative -- constant learning rate and cooldowns -- and find that it scales predictably and reliably similar to cosine. Additionally, we show that stochastic weight averaging yields improved performance along the training trajectory, without additional training costs, across different scales. Importantly, with these findings we demonstrate that scaling experiments can be performed with significantly reduced compute and GPU hours by utilizing fewer but reusable training runs. Our code is available at \url{https://github.com/epfml/schedules-and-scaling/}.

Paper

References (72)

Scroll for more · 38 remaining

Similar papers

Peer review

Reviewer yzXN5/10 · confidence 4/52024-06-24

Summary

The authors present an empirical study on using constant learning rates (plus a short cooldown) instead of cosine schedules for training LLMs. The authors show that: - Constant LR + cooldown roughly matches cosine schedules. (Fig 3,4) - SWA of a long schedule almost matches the performance of shorter schedule given the same number of steps. (Fig 8). - Chinchilla-type scaling laws can be derived with constant LR schedules + cooldowns which will save compute. (Fig 10)

Strengths

- The potential impact of constant LR instead of cosine is high. - The paper is rather well written.

Weaknesses

- The experimental setup is unclear. But this should be very easy to fix in an updated version. - It is still unclear to me exactly how well the match between constant LR and cosine is, especially for longer training. - The results on SWA and constant LR seems almost orthogonal. - Higher performance is not reached, so the only upside is in doing scaling studies. This might only be relevant for a few well-funded labs.

Questions

1. Why plot perplexity instead of val loss? 2. Could you have a subsection called experimental setup? On line 104 you mention “. We follow our experimental setup and train a 210M model”, but I don’t think the details of this model is given earlier. 3. Based upon Figure 2, it seems like your schedule goes to 0 whereas cosine typically does not go to 0. Is this a confounder in your experiments? 4. Fig 4 shows constant LR beating cosine while Fig 3 shows them matching. Why this discrepancy? 5. Fig 6 (right) seems to show that there is still a small gap between constant (1-sqrt) and cosine – is this correct?

Rating

5

Confidence

4

Soundness

3

Presentation

2

Contribution

3

Limitations

na

Reviewer 5fmf9/10 · confidence 5/52024-07-10

Summary

Scaling Laws and Compute-Optimal Training without Fixed Training Duration Summary A major weakness of the cosine annealing learning rate schedule, one of the most prevalent learning rate schedules in LLM training, is that for optimal performance the cycle length must be adjusted based on the training duration. Intermediate checkpoints generally do not achieve optimal loss. This is inconvenient since achieving the optimal loss for various training durations requires individual runs for each duration. The authors investigative alternative scheduling methods for alleviating this difficulty. Namely, the authors seek solutions which allow provide near optimal intermediate checkpoints along one long training run, potentially with a relatively small overhead from applying cooldown or averaging. Such solutions are especially useful for computing scaling laws and hyperparameter tuning by reducing the computation cost significantly. Through careful experimentation the authors provide several insights about the following solutions (which have been proposed previously in the literature). 1. Trapezoidal LR schedule with warmup + constant lr + cooldown 2. Stochastic Weight Averaging 3. Schedule Free Optimizer from Defazio et al. [1] In particular it is demonstrated that the trapezoidal schedule is a simple and effective solution for provide near optimal checkpoints along a potentially infinitely long trajectory. [1] Defazio, A., Mehta, H., Mishchenko, K., Khaled, A., Cutkosky, A., & others. (2024). The road less scheduled. arXiv preprint arXiv:2405.15682.

Strengths

The paper discusses an important and practical topic of LLM training. Hyperparameter tuning has been established as an important aspect of LLM training but result in prohibitive costs especially when scaling. The paper discusses solutions for trying to "eliminate" the hyperparameter of training duration which is a worthy goal with a large benefit. The paper is also written and presented clearly with many experiments and interesting results.

Weaknesses

The technical novelty is a bit limited because all the approaches evaluated have been proposed before in the literature (modulo some small tweaks). However, I do not view this as a major weakness since a thorough, well-presented review of these approaches is still a strong contribution.

Questions

1. In figure 1 why are there no spikes? For example the n=8k curve is rewarmed every 8k iterations. Are the curves smoothed? 2. Can the SWA be clarified a bit? Is every evaluation done on the iterate average over all checkpoints in the last 500 steps? How many checkpoints does that include? 3. What about a cooldown function like (1-x^a) where a < 0.5? All the other cooldown functions tried seem to lie "above" 1 - sqrt(x).

Rating

9

Confidence

5

Soundness

4

Presentation

4

Contribution

3

Limitations

Yes.

Reviewer 5fmf2024-08-12

Thanks for the replies! 1. Maybe I'm missing something but I don't see any loss jumps in the left panel of Figure 1? All the curves are smoothly decreasing. 2. Got it, thanks for clarifying. 3. Great, looking forward to seeing what comes out. After reading the discussion with other reviewers and author responses I believe the final paper will be very nice so I will increase my confidence and maintain the high score.

Authorsrebuttal2024-08-13

Thank you for your reply and nice words! > Maybe I'm missing something but I don't see any loss jumps in the left panel of Figure 1? All the curves are smoothly decreasing. We think the submitted version of Figure 1 should contain the black dashed line for a cycled schedule ('Cycle n=8k'), which shows a loss jump at steps 8k and 16k -- is the Figure different for you? The line is partially hidden under the very light red one for n=8k, which might lead to the confusion.

Reviewer J2338/10 · confidence 5/52024-07-13

Summary

The paper focuses on learning rate schedules in scaling large language models (LLMs). Traditionally, LLMs are trained with a cosine learning rate schedule, which requires a pre-specified training duration for learning rate decay. This makes it difficult to dynamically adjust the training duration, as early stopping and continued training after the decay result in suboptimal model performance. To address this, the authors study an alternative schedule of constant learning rate with cooldown, which enables one to get the optimal model at any step during the training process. The authors systematically compare different choices of cool down duration and cool down schedule, and demonstrate that constant learning rate with 1 - sqrt cooldown schedule matches the performance of cosine schedule tuned for that duration. Beyond cooldown, the authors compare two different approaches of removing the need of learning rate schedule: stochastic weight averaging and schedule-free optimizer. The authors show that while they exhibit promising performance, the performance of models obtained in the middle of the training still cannot match the performance of the proposed constant learning rate with cooldown. Finally, the authors validate the proposed learning rate schedule in the scaling law study of compute optimal models, and demonstrate that the constant learning rate with cooldown schedule leads to the same results as cosine learning rate schedule, while saving half of the compute flops.

Strengths

The paper presents a simple approach to address a major limitation of cosine learning rate schedule, and demonstrates its effectiveness with solid experimentations. Overall I think the paper is of very high quality. The proposed method is simple and highly practical, which makes it relevant for a broad range of today’s scaling studies. It is widely known that scaling is the key to the success of LLMs, and it is important to establish compute optimal scaling laws as large scaling training is really expensive. The proposed learning rate schedule is able to halve the flops of the chinchilla compute optimal horizon study without adding extra implementation or tuning complexity, which I believe is a major contribution. The proposed method is supported with solid experimentations. The authors include comprehensive comparisons of different schedules of cooldown and hyperparameter choices, which convincingly establish the advantage of the proposed schedule and can also serve as tuning guide when adopting it. The authors also compare the proposed method to popular alternative approaches. The paper is well written. The main idea and the experiments are laid out in a logical way that makes it easy to follow. The experiment results are also presented in an intuitive way, making it easy to compare methods.

Weaknesses

While the experiment results are very solid, I do hope that the authors could expand the scale of experiments to larger models. Larger models are usually more sensitive to suboptimal hyperparameters, and therefore it would be great if the proposed method can also be verified in larger models, such as a 3B or 7B model which are common sizes for practical LLMs.

Questions

Another highly relevant use of training LLMs without fixed duration is continued pre-training, which is quite common in practice as people often continue the pre-training on specialized data for different use cases (such as turning general models into code specialized models). It would be great if the authors could include some discussions and experiments on how the proposed constant learning rate with cooldown can be applied in continued pre-training. For example, one question to ask would be would it be better to continue from the checkpoint before or after cooldown.

Rating

8

Confidence

5

Soundness

4

Presentation

4

Contribution

3

Limitations

The authors have sufficiently addressed the limitations and societal impacts.

Reviewer J2332024-08-10

Re: Rebuttal

I'd like to thank the authors for answering my questions and providing us with additional experiments. My concerns and questions have been fully addressed.

Program Chairsdecision2024-09-25

Decision

Accept (spotlight)

© 2026 NYSGPT2525 LLC