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

语言模型的直接量化训练与随机舍入

Direct Quantized Training of Language Models with Stochastic Rounding

The University of Tokyo(东京大学);Fujitsu Limited(富士通有限公司)

Kaiyan Zhao, Tsuguchika Tabaru, Kenichi Kobayashi, Takumi Honda, Masafumi Yamazaki, Yoshimasa Tsuruoka

AI总结:

本文提出直接更新量化低精度权重并采用随机舍入,无需直通估计,在LLaMA模型上实现高效训练,8位性能媲美BitNet b1.58,且支持三值推理。

摘要:

尽管最近的量化大型语言模型(LLMs),如BitNet,通过使用二值或三值权重,为部署期间显著减少内存使用铺平了道路,但训练这些模型仍然需要大量的内存占用。部分原因在于,在整个训练过程中,必须维持用于直通估计的高精度(即未量化)权重。为了解决这个问题,我们探索在反向传播期间不依赖直通估计,直接更新量化的低精度权重,旨在节省训练期间的内存使用。具体而言,我们采用随机舍入技术,以最小化在整个训练过程中使用低位权重所导致的信息损失。在我们不同规模的LLaMA结构模型上的实验结果表明:(1)即使权重被限制为三值,仅使用低精度权重进行训练也是可行的;(2)将位宽扩展到8位,其性能可与BitNet b1.58相媲美;(3)我们的模型对精度缩放和内存缩减具有鲁棒性,在从FP32迁移到低内存环境(BF16/FP8)时,性能下降最小;(4)我们的模型还支持使用三值权重的推理,展示了其在部署中的灵活性。

英文摘要:

Although recent quantized Large Language Models (LLMs), such as BitNet, have paved the way for significant reduction in memory usage during deployment with binary or ternary weights, training these models still demands substantial memory footprints. This is partly because high-precision (i.e., unquantized) weights required for straight-through estimation must be maintained throughout the whole training process. To address this, we explore directly updating the quantized low-precision weights without relying on straight-through estimation during backpropagation, aiming to save memory usage during training. Specifically, we employ a stochastic rounding technique to minimize the information loss caused by the use of low-bit weights throughout training. Experimental results on our LLaMA-structured models of various sizes indicate that (1) training with only low-precision weights is feasible even when they are constrained to ternary values; (2) extending the bit width to 8 bits achieves performance on par with BitNet b1.58; (3) our models remain robust to precision scaling and memory reduction, showing minimal performance degradation when moving from FP32 to lower-memory environments (BF16/FP8); and (4) our models also support inference using ternary weights, showcasing their flexibility in deployment.

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

↑