paper-with-me

홈 › Papers

Mesa: A Memory-saving Training Framework for Transformers

2021-11-22 · Zizheng Pan, Peng Chen, Haoyu He, Jing Liu, Jianfei Cai, Bohan Zhuang

There has been an explosion of interest in designing high-performance Transformers. While Transformers have delivered significant performance improvements, training such networks is extremely memory intensive owing to storing all intermediate activations that are needed for gradient computation during backpropagation, especially for long sequences. To this end, we present Mesa, a memory-saving training framework for Transformers. Specifically, Mesa uses exact activations during forward pass while storing a low-precision version of activations to reduce memory consumption during training. The low-precision activations are then dequantized during back-propagation to compute gradients. Besides, to address the heterogeneous activation distributions in the multi-head self-attention layers, we propose a head-wise activation quantization strategy, which quantizes activations based on the statistics of each head to minimize the approximation error. To further boost training efficiency, we learn quantization parameters by running estimates. More importantly, by re-investing the saved memory in employing a larger batch size or scaling up model size, we may further improve the performance under constrained computational resources. Extensive experiments on ImageNet, CIFAR-100 and ADE20K demonstrate that Mesa can achieve flexible memory-savings (up to 50%) during training while achieving comparable or even better performance. Code is available at https://github.com/ziplab/Mesa.

📄 PDF Abstract BibTeX arXiv:2111.11124

Code (3)

zhuang-group/mesa 공식 구현 pytorch
zip-group/mesa 공식 구현 pytorch
ziplab/mesa 공식 구현 pytorch

Tasks

Quantization

Similar Papers 제목 키워드 기반

On Mesa-Optimization in Autoregressively Trained Transformers: Emergence and Capability

2024-05-27 · Chenyu Zheng, Wei Huang, Rongzhen Wang, Guoqiang Wu 외

Autoregressively trained transformers have brought a profound revolution to the world, especially with their in-context learning (ICL) ability to address downstream tasks. Recently, several studies suggest that transform…

In-Context Learning

PARMESAN: Parameter-Free Memory Search and Transduction for Dense Prediction Tasks

2024-03-18 · Philip Matthias Winter, Maria Wimmer, David Major, Dimitrios Lenis 외

This work addresses flexibility in deep learning by means of transductive reasoning. For adaptation to new data and tasks, e.g., in continual learning, existing methods typically involve tuning learnable parameters or co…

Continual LearningFew-Shot Learning

MesaNet: Sequence Modeling by Locally Optimal Test-Time Training

2025-06-05 · Johannes von Oswald, Nino Scherrer, Seijin Kobayashi, Luca Versari 외

Sequence modeling is currently dominated by causal transformer architectures that use softmax self-attention. Although widely adopted, transformers require scaling memory and compute linearly during inference. A recent s…

Language ModelingLanguage ModellingLong-Context UnderstandingMamba

MESA: Boost Ensemble Imbalanced Learning with MEta-SAmpler

2020-10-17 · NeurIPS 2020 12 · Zhining Liu, Pengfei Wei, Jing Jiang, Wei Cao 외

Imbalanced learning (IL), i.e., learning unbiased models from class-imbalanced data, is a challenging problem. Typical IL methods including resampling and reweighting were designed based on some heuristic assumptions. Th…

imbalanced classificationMeta-Learning

Improving Model Representation and Reducing KV Cache via Skip Connections with First Value Heads

2025-10-19 · Zhoutong Wu, Yuan Zhang, Yiming Dong, Chenheng Zhang 외 arxiv

Transformer models have driven breakthroughs across various language tasks by their strong capability to learn rich contextual representations. Scaling them to improve representation, however, often demands substantial m…