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

用于内存高效训练的局部代理

Local proxies for memory-efficient training

EPFL(洛桑联邦理工学院);Machine Learning Research(机器学习研究院);TU Wien(维也纳技术大学)

Wu S. Zihan, Brian A. Yuan, Guillaume Bellec

AI总结:

本研究针对Transformer训练的内存瓶颈,提出训练局部代理网络通过蒸馏预测全局输出的方法,可实现更优的精度/内存权衡,在CIFAR-100及大语言模型微调场景中均表现良好。

摘要:

局部学习算法可重塑人工智能的资源需求。标准端到端反向传播的内存瓶颈在于需存储所有网络激活值,直至损失梯度反向传播完成;局部学习可避免此问题,但通常会以精度为代价。本研究探讨如何在Transformer中实现精准且内存高效的局部学习:针对每个Transformer块,训练局部代理网络通过蒸馏预测全局网络输出,可独立通过该局部代理传播梯度,同时能较好估计反向传播梯度。理论上,该方法对深度线性网络是精确的;在非线性残差模型中,使用合适的残差代理时梯度误差可被界定。我们通过数值验证此结论,证明优化蒸馏损失可改善梯度估计;在视觉Transformer的CIFAR-100数据集上评估代理传播性能,发现其相比其他局部算法能实现更优的精度/内存权衡。最后,该方法对小内存预算下的大语言模型微调也适用,且相比内存高效的零阶学习算法,在相当内存成本下训练更快、性能更高。

英文摘要:

Local learning algorithms can reshape resource requirements of artificial intelligence. The memory bottleneck of standard end-to-end backpropagation lies in the need to store all network activations until the loss gradient has been propagated back through. Local learning avoids this, but typically at a cost in accuracy. We study how to achieve accurate and memory efficient local learning in transformers. For each transformer block, we train a local proxy network to predict the global network output via distillation. Gradients can be independently propagated through this local proxy while estimating well the backpropagation gradients. In theory, this approach is exact for deep linear networks; in non-linear residual models, the gradient error can be bounded when using the appropriate residual proxy. We verify this numerically and demonstrate that optimizing the distillation loss improves gradient estimation. Evaluating the performance of proxy propagation on CIFAR-100 in vision transformers, we find that it achieves a better accuracy/memory trade-off compared to other local algorithms. Finally, we show that the method is further relevant for fine-tuning large language models on a small memory budget. Our method trains faster and achieves higher performance than memory-efficient zeroth-order learning algorithms with comparable memory cost.

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

↑