arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2505.10475cs.LGcs.CL
收藏

语言模型的并行缩放定律

Parallel Scaling Law for Language Models

Zhejiang University(浙江大学);Qwen Team, Alibaba Group(阿里巴巴集团Qwen团队)

Mouxiang Chen, Binyuan Hui, Zeyu Cui, Jiaxi Yang, Dayiheng Liu, Jianling Sun, Junyang Lin, Zhongxin Liu

AI总结:

本文提出 ParScale 并行缩放范式,通过 P 路可学习输入变换、并行前向与动态聚合复用参数,并建立新的缩放定律,以更低内存和延迟获得近 O(log P) 参数缩放收益。

摘要:

人们普遍认为,缩放语言模型必然会带来显著的空间或时间成本,方式是增加参数(参数缩放)或输出 token(推理时缩放)。我们引入第三种且推理效率更高的缩放范式:在训练和推理期间同时增加模型的并行计算。我们对输入应用 P 个多样且可学习的变换,并行执行模型的前向传播,并动态聚合这 P 个输出。该方法即并行缩放(ParScale),通过复用现有参数来扩展并行计算,并可应用于任何模型结构、优化过程、数据或任务。我们在理论上提出了一条新的缩放定律,并通过大规模预训练对其进行验证;结果表明,具有 P 个并行流的模型类似于将参数缩放 O(log P),同时表现出更优的推理效率。例如,与实现相同性能提升的参数缩放相比,ParScale 的内存增量最多可减少 22 倍,延迟增量最多可减少 6 倍。它还可以通过在少量 token 上进行后训练,将现成的预训练模型回收改造为并行缩放模型,从而进一步降低训练预算。我们发现的新缩放定律有望促进更强大模型在低资源场景中的部署,并为计算在机器学习中的作用提供另一种视角。

英文摘要:

It is commonly believed that scaling language models should commit a significant space or time cost, by increasing the parameters (parameter scaling) or output tokens (inference-time scaling). We introduce the third and more inference-efficient scaling paradigm: increasing the model's parallel computation during both training and inference time. We apply $P$ diverse and learnable transformations to the input, execute forward passes of the model in parallel, and dynamically aggregate the $P$ outputs. This method, namely parallel scaling (ParScale), scales parallel computation by reusing existing parameters and can be applied to any model structure, optimization procedure, data, or task. We theoretically propose a new scaling law and validate it through large-scale pre-training, which shows that a model with $P$ parallel streams is similar to scaling the parameters by $O(\log P)$ while showing superior inference efficiency. For example, ParScale can use up to 22$\times$ less memory increase and 6$\times$ less latency increase compared to parameter scaling that achieves the same performance improvement. It can also recycle an off-the-shelf pre-trained model into a parallelly scaled one by post-training on a small amount of tokens, further reducing the training budget. The new scaling law we discovered potentially facilitates the deployment of more powerful models in low-resource scenarios, and provides an alternative perspective for the role of computation in machine learning.

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

↑