Power Lines: Scaling Laws for Weight Decay and Batch Size in LLM Pre-training

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Bergsma, Shane, Dey, Nolan, Gosal, Gurpreet, Gray, Gavia, Soboleva, Daria, Hestness, Joel
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866911281829642240
author Bergsma, Shane
Dey, Nolan
Gosal, Gurpreet
Gray, Gavia
Soboleva, Daria
Hestness, Joel
author_facet Bergsma, Shane
Dey, Nolan
Gosal, Gurpreet
Gray, Gavia
Soboleva, Daria
Hestness, Joel
contents Efficient LLM pre-training requires well-tuned hyperparameters (HPs), including learning rate $η$ and weight decay $λ$. We study scaling laws for HPs: formulas for how to scale HPs as we scale model size N, dataset size D, and batch size B. Recent work suggests the AdamW timescale, $τ= B/(ηλD)$, should remain constant across training settings, and we verify the implication that optimal $λ$ scales linearly with B, for a fixed N and D. However, as N and D scale, we show optimal $τ$ obeys a precise power law in the tokens-per-parameter ratio, D/N. This law thus provides a method to accurately predict $λ$opt in advance of large-scale training. We also study scaling laws for optimal batch size Bopt (the B enabling lowest loss at a given N,D) and critical batch size Bcrit (the B beyond which further data parallelism becomes ineffective). In contrast to prior work, we find both Bopt and Bcrit scale as power laws in D, independent of model size, N. Finally, we analyze how these findings inform the real-world selection of Pareto-optimal N and D under dual training time and compute objectives. All experiments were run on Cerebras CS-3 systems.
format Preprint
id arxiv_https___arxiv_org_abs_2505_13738
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Power Lines: Scaling Laws for Weight Decay and Batch Size in LLM Pre-training
Bergsma, Shane
Dey, Nolan
Gosal, Gurpreet
Gray, Gavia
Soboleva, Daria
Hestness, Joel
Machine Learning
Artificial Intelligence
Computation and Language
Efficient LLM pre-training requires well-tuned hyperparameters (HPs), including learning rate $η$ and weight decay $λ$. We study scaling laws for HPs: formulas for how to scale HPs as we scale model size N, dataset size D, and batch size B. Recent work suggests the AdamW timescale, $τ= B/(ηλD)$, should remain constant across training settings, and we verify the implication that optimal $λ$ scales linearly with B, for a fixed N and D. However, as N and D scale, we show optimal $τ$ obeys a precise power law in the tokens-per-parameter ratio, D/N. This law thus provides a method to accurately predict $λ$opt in advance of large-scale training. We also study scaling laws for optimal batch size Bopt (the B enabling lowest loss at a given N,D) and critical batch size Bcrit (the B beyond which further data parallelism becomes ineffective). In contrast to prior work, we find both Bopt and Bcrit scale as power laws in D, independent of model size, N. Finally, we analyze how these findings inform the real-world selection of Pareto-optimal N and D under dual training time and compute objectives. All experiments were run on Cerebras CS-3 systems.
title Power Lines: Scaling Laws for Weight Decay and Batch Size in LLM Pre-training
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2505.13738