arXiv:2505.10475cs.LGcs.CL2025-05NeurIPS被引 31

通过并行计算提升语言模型性能,显著降低内存与延迟开销。

Parallel Scaling Law for Language Models

  • 对输入施加P个可学习变换,模型并行处理后动态融合输出。
  • 相比参数量扩展,相同性能提升下内存增长仅1/22,延迟增加仅1/6。
  • 可复用预训练模型,小规模微调即可实现并行化,适合资源受限场景。

普遍认为扩大语言模型需付出高昂的空间或时间成本,通过增加参数量(参数扩展)或输出长度(推理时扩展)。本文提出第三种更高效的扩展范式:在训练和推理阶段同时增加并行计算。具体地,对输入应用P个多样且可学习的变换,模型并行执行前向传播,并动态聚合P个输出。该方法称为并行扩展(ParScale),通过重用现有参数扩展并行计算能力,适用于任意模型结构、优化方法、数据或任务。我们理论推导出新的扩展规律,并通过大规模预训练验证:具有P个并行流的模型,其效果相当于参数量扩展至O(log P),但推理效率更高。例如,实现同等性能提升时,相比参数扩展,内存增长最多减少22倍,延迟增加减少6倍。此外,可通过少量令牌的后训练,将现成预训练模型转化为并行扩展版本,进一步降低训练成本。这一新扩展规律有望推动更强模型在低资源环境中的部署,并为计算在机器学习中的作用提供新视角。

原文摘要 · Abstract (English)

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.

模型扩展并行计算高效推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。