arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.21676cs.LGcs.AImath.OCstat.ML
收藏

临界批量大小在预训练中如何扩展?

How Does Critical Batch Size Scale in Pre-training?

Harvard University(哈佛大学);Kempner Institute at Harvard University(哈佛大学凯普勒研究所);University of California, Berkeley(加州大学伯克利分校);The University of Hong Kong(香港大学);Amazon(亚马逊公司)

Hanlin Zhang, Depen Morwani, Nikhil Vyas, Jingfeng Wu, Difan Zou, Udaya Ghai, Dean Foster, Sham Kakade

AI总结:

本研究提出临界批量大小(CBS)的度量方法,通过预训练85M至1.2B参数的语言模型,发现CBS主要随数据规模而非模型规模扩展,并给出理论解释。

摘要:

在给定资源下训练大规模模型需要仔细设计并行策略。特别是,临界批量大小(CBS)的效率概念,涉及时间与计算之间的权衡,标志着超过该阈值后,更大的数据并行性将导致收益递减。为了将其操作化,我们提出了一种CBS的度量方法,并在C4数据集上预训练了一系列自回归语言模型,参数规模从8500万到12亿不等。通过广泛的超参数扫描和对批量大小、动量、学习率及其调度等因素的仔细控制,我们系统地研究了规模对CBS的影响。然后,我们拟合了关于模型和数据规模的缩放定律,以解耦它们的影响。总体而言,我们的结果表明,CBS主要随数据规模而非模型规模扩展,这一发现我们通过神经网络无限宽度极限和无限维最小二乘回归的理论分析加以论证。独立而言,我们强调了常见超参数选择和策略对于研究固定训练时长之外的大规模预训练的重要性。

英文摘要:

Training large-scale models under given resources requires careful design of parallelism strategies. In particular, the efficiency notion of critical batch size (CBS), concerning the compromise between time and compute, marks the threshold beyond which greater data parallelism leads to diminishing returns. To operationalize it, we propose a measure of CBS and pre-train a series of auto-regressive language models, ranging from 85 million to 1.2 billion parameters, on the C4 dataset. Through extensive hyper-parameter sweeps and careful control of factors such as batch size, momentum, and learning rate along with its scheduling, we systematically investigate the impact of scale on CBS. Then we fit scaling laws with respect to model and data sizes to decouple their effects. Overall, our results demonstrate that CBS scales primarily with data size rather than model size, a finding we justify theoretically through the analysis of infinite-width limits of neural networks and infinite-dimensional least squares regression. Of independent interest, we highlight the importance of common hyper-parameter choices and strategies for studying large-scale pre-training beyond fixed training durations.

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

↑