SPT: Fine-Tuning Transformer-based Language Models Efficiently with Sparsification
Not on the map. Why?
Abstract (arXiv)
Transformer-based large language models (e.g., BERT and GPT) achieve great success, and fine-tuning, which tunes a pre-trained model on a task-specific dataset, is the standard practice to utilize these models for downstream tasks. However, Transformer fine-tuning has long running time and high memory consumption due to the large size of the models. We propose the SPT system to fine-tune Transformer-based models efficiently by introducing sparsity. We observe that the memory consumption of Transformer mainly comes from storing attention weights for multi-head attention (MHA), and the majority of running time is spent on feed-forward network (FFN). Thus, we design the sparse MHA module, which computes and stores only large attention weights to reduce memory consumption, and the routed FFN module, which dynamically activates a subset of model parameters for each token to reduce computation cost. We implement SPT on PyTorch and customize CUDA kernels to run sparse MHA and routed FFN efficiently. Specifically, we use product quantization to identify the large attention weights and compute attention via sparse matrix multiplication for sparse MHA. For routed FFN, we batch the tokens according to their activated model parameters for efficient computation. We conduct extensive experiments to evaluate SPT on various model configurations. The results show that SPT consistently outperforms well-optimized baselines, reducing the peak memory consumption by up to 50% and accelerating fine-tuning by up to 2.2x.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 33 of its 45 references that are in the map. First posted on arXiv 16 Dec 2023.
Builds on
33 of 45 references.
References · 33
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
- 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
- 2023Adding Conditional Control to Text-to-Image Diffusion Modelscited by 5,466
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2019Parameter-Efficient Transfer Learning for NLPcited by 4,195
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,611
- 2017Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layercited by 3,413
- 2020Longformer: The Long-Document Transformercited by 3,362
21 more
- 2023QLoRA: Efficient Finetuning of Quantized LLMscited by 3,355
- 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
- 2016Pointer Sentinel Mixture Modelscited by 2,992
- 2017Billion-scale similarity search with GPUscited by 2,477
- 2020Reformer: The Efficient Transformercited by 1,658
- 2021BitFit: Simple Parameter-efficient Fine-tuning for Transformer-based Masked Language-modelscited by 1,234
- 2022Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learningcited by 886
- 2022LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scalecited by 881
- 2022AdaptFormer: Adapting Vision Transformers for Scalable Visual Recognitioncited by 714
- 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
- 2023PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallelcited by 641
- 2021Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LMcited by 621
- 2022Vision Transformer Adapter for Dense Predictionscited by 564
- 2023Sheared LLaMA: Accelerating Language Model Pre-training via Structured Pruningcited by 408
- 2016From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classificationcited by 337
- 2020TurboTransformers: An Efficient GPU Serving System For Transformer Modelscited by 71
- 2022Input-Tuning: Adapting Unfamiliar Inputs to Frozen Pretrained Modelscited by 34
- 2021DKM: Differentiable K-Means Clustering Layer for Neural Network Compressioncited by 31
- 2018Parallax: Sparsity-aware Data Parallel Training of Deep Neural Networkscited by 19
- 2018Accelerated Training for Massive Classification via Dynamic Class Selectioncited by 16
- 2022Faster Maximum Inner Product Search in High Dimensionscited by 3
Built on by
Citing papers per year: 2024: 2.
2 papers.