Saved in:
Bibliographic Details
Main Authors: Liu, Zirui, Wang, Guanchu, Zhong, Shaochen, Xu, Zhaozhuo, Zha, Daochen, Tang, Ruixiang, Jiang, Zhimeng, Zhou, Kaixiong, Chaudhary, Vipin, Xu, Shuai, Hu, Xia
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2305.15265
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909379196878848
author Liu, Zirui
Wang, Guanchu
Zhong, Shaochen
Xu, Zhaozhuo
Zha, Daochen
Tang, Ruixiang
Jiang, Zhimeng
Zhou, Kaixiong
Chaudhary, Vipin
Xu, Shuai
Hu, Xia
author_facet Liu, Zirui
Wang, Guanchu
Zhong, Shaochen
Xu, Zhaozhuo
Zha, Daochen
Tang, Ruixiang
Jiang, Zhimeng
Zhou, Kaixiong
Chaudhary, Vipin
Xu, Shuai
Hu, Xia
contents With the rapid growth in model size, fine-tuning the large pre-trained language model has become increasingly difficult due to its extensive memory usage. Previous works usually focus on reducing the number of trainable parameters in the network. While the model parameters do contribute to memory usage, the primary memory bottleneck during training arises from storing feature maps, also known as activations, as they are crucial for gradient calculation. Notably, neural networks are usually trained using stochastic gradient descent. We argue that in stochastic optimization, models can handle noisy gradients as long as the gradient estimator is unbiased with reasonable variance. Following this motivation, we propose a new family of unbiased estimators called WTA-CRS, for matrix production with reduced variance, which only requires storing the sub-sampled activations for calculating the gradient. Our work provides both theoretical and experimental evidence that, in the context of tuning transformers, our proposed estimators exhibit lower variance compared to existing ones. By replacing the linear operation with our approximated one in transformers, we can achieve up to 2.7$\times$ peak memory reduction with almost no accuracy drop and enables up to $6.4\times$ larger batch size. Under the same hardware, WTA-CRS enables better down-streaming task performance by applying larger models and/or faster training speed with larger batch sizes.
format Preprint
id arxiv_https___arxiv_org_abs_2305_15265
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Winner-Take-All Column Row Sampling for Memory Efficient Adaptation of Language Model
Liu, Zirui
Wang, Guanchu
Zhong, Shaochen
Xu, Zhaozhuo
Zha, Daochen
Tang, Ruixiang
Jiang, Zhimeng
Zhou, Kaixiong
Chaudhary, Vipin
Xu, Shuai
Hu, Xia
Machine Learning
Computation and Language
With the rapid growth in model size, fine-tuning the large pre-trained language model has become increasingly difficult due to its extensive memory usage. Previous works usually focus on reducing the number of trainable parameters in the network. While the model parameters do contribute to memory usage, the primary memory bottleneck during training arises from storing feature maps, also known as activations, as they are crucial for gradient calculation. Notably, neural networks are usually trained using stochastic gradient descent. We argue that in stochastic optimization, models can handle noisy gradients as long as the gradient estimator is unbiased with reasonable variance. Following this motivation, we propose a new family of unbiased estimators called WTA-CRS, for matrix production with reduced variance, which only requires storing the sub-sampled activations for calculating the gradient. Our work provides both theoretical and experimental evidence that, in the context of tuning transformers, our proposed estimators exhibit lower variance compared to existing ones. By replacing the linear operation with our approximated one in transformers, we can achieve up to 2.7$\times$ peak memory reduction with almost no accuracy drop and enables up to $6.4\times$ larger batch size. Under the same hardware, WTA-CRS enables better down-streaming task performance by applying larger models and/or faster training speed with larger batch sizes.
title Winner-Take-All Column Row Sampling for Memory Efficient Adaptation of Language Model
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2305.15265