Accelerating Transformer Pre-training with 2: 4 Sparsity
Yuezhou Hu, Kang Zhao, Weiyu Huang, Jianfei Chen, Jun Zhu
Abstract
Training large transformers is slow, but recent innovations on GPU architecture give us an advantage. NVIDIA Ampere GPUs can execute a fine-grained 2:4 sparse matrix multiplication twice as fast as its dense equivalent. In the light of this property, we comprehensively investigate the feasibility of accelerating feed-forward networks (FFNs) of transformers in pre-training. First, we define a ``flip rate'' to monitor the stability of a 2:4 training process. Utilizing this metric, we propose three techniques to preserve accuracy: to modify the sparse-refined straight-through estimator by applying the masked decay term on gradients, to determine a feasible decay factor in warm-up stage, and to enhance the model's quality by a dense fine-tuning procedure near the end of pre-training. Besides, we devise two techniques to practically accelerate training: to calculate transposable 2:4 masks by convolution, and to accelerate gated activation functions by reducing GPU L2 cache miss. Experiments show that our 2:4 sparse training algorithm achieves similar convergence to dense training algorithms on several transformer pre-training tasks, while actual acceleration can be observed on different shapes of transformer block apparently. Our toolkit is available at https://github.com/huyz2023/2by4-pretrain.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f3adc14a-b20a-4bee-a2c0-9c0784728537Cited by top-tier papers7
- Pruning Large Language Models with Semi-Structural Adaptive Sparse TrainingWeiyu Huang, Yuezhou Hu, Guohao Jian, Jun Zhu et al.AAAI 2025 · 25 citations
- S-STE: Continuous Pruning Function for Efficient 2: 4 Sparse Pre-trainingYuezhou Hu, Jun Zhu, Jianfei ChenNeurIPS 2024 · 14 citations
- ARMOR: High-Performance Semi-Structured Pruning via Adaptive Matrix FactorizationLawrence Liu, Alexander Liu, Mengdi Wang, Tuo Zhao et al.ICLR 2026 · 3 citations
- SLoPe: Double-Pruned Sparse Plus Lazy Low-Rank Adapter Pretraining of LLMsMohammad Mozaffari, Amir Yazdanbakhsh, Zhao Zhang, Maryam Mehri DehnaviICLR 2025
- CoLA: Compute-Efficient Pre-Training of LLMs via Low-Rank ActivationZiyue Liu, Ruijie Zhang, Zhengyang Wang, Mingsong Yan et al.EMNLP 2025
Builds on12
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
- Rigging the Lottery: Making All Tickets WinnersUtku Evci, Trevor Gale, Jacob Menick, Pablo Samuel Castro et al.ICML 2020 · 723 citations
- The Lottery Ticket Hypothesis for Pre-trained BERT NetworksTianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu et al.NeurIPS 2020 · 428 citations
- Learning N: M Fine-grained Structured Sparse Neural Networks From ScratchAojun Zhou, Yukun Ma, Junnan Zhu, Jianbo Liu et al.ICLR 2021 · 301 citations
- LLM-Adapters: An Adapter Family for Parameter-Efficient Fine-Tuning of Large Language ModelsZhiqiang Hu, Lei Wang, Yihuai Lan, Wanyu Xu et al.EMNLP 2023 · 200 citations
Related papers
- Towards Fully Sparse Training: Information Restoration with Spatial SimilarityWeixiang Xu, Xiangyu He, Ke Cheng, Peisong Wang et al.AAAI 2022 · 7 citations
- Tempo: Accelerating Transformer-Based Model Training through Memory Footprint ReductionMuralidhar Andoorveedu, Zhanda Zhu, Bojian Zheng, Gennady PekhimenkoNeurIPS 2022 · 8 citations
- Dynamic N: M Fine-Grained Structured Sparse Attention MechanismZhaodong Chen, Zheng Qu, Yuying Quan, Liu Liu et al.PPoPP 2023 · 26 citations
- SlideSparse: Fast and Flexible (2N-2):2N Structured SparsityYingbo HAO, Hanyong Shao, Ting Song, Yan Xia et al.ICML 2026
- Training Transformers with 4-bit IntegersHaocheng Xi, Changhao Li, Jianfei Chen, Jun ZhuNeurIPS 2023 · 96 citations
