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

通过大线性层的存储高效反向传播

Memory-Efficient Backpropagation through Large Linear Layers

Skoltech(斯科尔科沃科技学院);AIRI(人工智能研究院)

Daniel Bershatsky, Aleksandr Mikhalev, Alexandr Katrutsa, Julia Gusak, Daniil Merkulov, Ivan Oseledets

摘要:

在像Transformers这样的现代神经网络中,线性层需要大量的内存来存储反向传递期间的激活。这项研究提出了一种内存减少的方法来执行反向传播通过线性层。由于线性层的梯度计算矩阵乘法,我们认为随机矩阵乘法的方法,并证明他们需要较少的内存与适度降低的测试精度。此外,我们还研究了随机矩阵乘法引起的梯度估计的方差。我们将此方差与基于该批样本的梯度估计的方差进行比较。我们证明了所提出的方法在GLUE任务上对预训练的RoBERTa模型进行微调的好处。

英文摘要:

In modern neural networks like Transformers, linear layers require significant memory to store activations during backward pass. This study proposes a memory reduction approach to perform backpropagation through linear layers. Since the gradients of linear layers are computed by matrix multiplications, we consider methods for randomized matrix multiplications and demonstrate that they require less memory with a moderate decrease of the test accuracy. Also, we investigate the variance of the gradient estimate induced by the randomized matrix multiplication. We compare this variance with the variance coming from gradient estimation based on the batch of samples. We demonstrate the benefits of the proposed method on the fine-tuning of the pre-trained RoBERTa model on GLUE tasks.

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

↑