arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2503.04715cs.LGcs.AI
收藏

可预测的规模:第一部分,Step Law——大语言模型预训练中的最优超参数缩放定律

Predictable Scale: Part I, Step Law -- Optimal Hyperparameter Scaling Law in Large Language Model Pretraining

Fudan University(复旦大学);Xi’an Jiaotong University(西安交通大学);Megvii Technology(地平线科技)

Houyi Li, Wenzhen Zheng, Qiufeng Wang, Hanshan Zhang, Zili Wang, Shijie Xuyang, Yuantao Fan, Zhenyu Ding, Haoying Wang, Ning Ding, Shuigeng Zhou, Xiangyu Zhang, Daxin Jiang

AI总结:

本文通过训练超3700个LLMs提出Step Law,揭示最优学习率与模型及数据规模呈幂律关系、最优批量大小主要取决于数据规模,为LLM预训练提供了通用超参数优化工具。

摘要:

大语言模型(LLMs)在各类任务中展现出的强大能力现已得到充分证实,然而其有效部署仍需要细致的超参数优化。尽管现有方法已探索了超参数对模型性能的影响,但一个适用于不同模型架构和数据配方的、具有原则性且可推广的框架仍然缺失。在本研究中,我们开展了一项前所未有的实证调查,从头训练了超过3,700个LLMs,覆盖100万亿token,消耗近一百万NVIDIA H800 GPU小时,以建立LLM预训练中超参数优化的通用缩放定律,称为Step Law。我们通过实验观察到,在固定模型规模($N$)和数据集规模($D$)的条件下,超参数景观呈现凸性且具有宽阔的最优区域,这显著降低了超参数搜索的复杂度。基于这一洞察,我们正式定义并通过实验验证了Step Law:最优学习率与$N$和$D$呈幂律关系,而最优批量大小主要受$D$影响,并且对$N$基本保持不变。值得注意的是,我们估计的最优值与通过穷举搜索找到的全局最佳性能在测试集上仅相差0.094%。据我们所知,Step Law是首个统一不同模型形状和结构(如Mixture-of-Experts模型和稠密Transformer)的定律,同时也在多样化数据配方上建立了最优超参数缩放定律。我们为社区贡献了一个通用的、即插即用的最优超参数工具,有望推动大规模高效LLM训练的发展。所有实验代码、数据和检查点均已在https://github.com/step-law/steplaw公开。

英文摘要:

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

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑