提出适用于各类大模型的最优超参数缩放规律,大幅降低训练调参难度。
Predictable Scale: Part I, Step Law -- Optimal Hyperparameter Scaling Law in Large Language Model Pretraining
- 通过3700个模型实验发现超参数具凸性,存在宽泛最优区域
- 学习率与模型/数据规模呈幂律关系,批量大小主要依赖数据量
- 可适配专家混合与密集变换器,适合大规模高效训练场景
大语言模型在多种任务中表现优异,但其有效部署需精细超参数调优。尽管已有研究探讨超参数对性能的影响,但跨模型架构与数据配方的普适性框架仍缺失。本研究在100万亿token数据上从头训练超过3700个大模型,耗时近百万小时NVIDIA H800 GPU,首次建立通用的超参数缩放规律——步长定律(Step Law)。在固定模型规模(N)和数据规模(D)下,超参数空间呈现凸性且存在宽泛最优区,显著降低调参复杂度。我们形式化定义并实证验证:最优学习率遵循与N、D的幂律关系,而最优批量大小主要受D影响,基本不受N变化干扰。所估最优值相较穷举搜索全局最优仅差0.094%测试误差。据我们所知,这是首个统一适配混合专家模型与密集Transformer结构,并覆盖多样数据配方的最优超参数缩放规律。我们公开提供即插即用的通用最优超参数工具,助力大规模高效训练。所有实验代码、数据与检查点已开源至https://github.com/step-law/steplaw。
原文摘要 · Abstract (English)
The impressive capabilities of Large Language Models (LLMs) across diverse tasks are now well established, yet their effective deployment necessitates careful hyperparameter optimization. Although existing methods have explored the influence of hyperparameters on model performance, a principled and generalizable framework across model architectures and data recipes remains absent. In this study, we conduct an unprecedented empirical investigation training over 3,700 LLMs from scratch across 100 trillion tokens, consuming nearly one million NVIDIA H800 GPU hours to establish a universal Scaling Law for hyperparameter optimization in LLM Pre-training, called Step Law. We empirically observe that, under fixed model size ($N$) and dataset size ($D$), the hyperparameter landscape exhibits convexity with a broad optimum, substantially reducing the complexity of hyperparameter search. Building on this insight, we formally define and empirically validate the Step Law: The optimal learning rate follows a power-law relationship with $N$ and $D$, while the optimal batch size is primarily influenced by $D$ and remains largely invariant to $N$.Notably, our estimated optima deviate from the global best performance found via exhaustive search by merely 0.094\% on the test set. To our best known, Step Law is the first that unifies different model shapes and structures, such as Mixture-of-Experts models and dense transformers, as well as establishes optimal hyperparameter scaling laws across diverse data recipes. We contribute a universal, plug-and-play optimal hyperparameter tool for the community, which is expected to advance efficient LLM training at scale. All experimental code, data and checkpoints are publicly available at https://github.com/step-law/steplaw
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。