Table of Contents
Fetching ...

From PEFT to DEFT: Parameter Efficient Finetuning for Reducing Activation Density in Transformers

Bharat Runwal, Tejaswini Pedapati, Pin-Yu Chen

TL;DR

DEFT introduces a density loss to PEFT-based fine-tuning to actively promote activation sparsity in transformer MLP blocks, enabling sparse activations that hardware can exploit for energy-efficient inference. By freezing the base model and training small PEFT modules (Adapter, LoRA, QLoRA, Prefix/Prompt-Tuning) with a sparsity-regularized objective, DEFT achieves substantial reductions in activation density while maintaining task performance on GLUE and SQuAD. An adaptive variant, ADA-DEFT, adds layerwise learnable weights to selectively skip MLP blocks at inference, yielding runtime and memory savings. Experiments across RoBERTaLarge, BERTBase, T5/Flan-T5 models show density reductions up to ~44-90% depending on model and block, along with favorable energy and efficiency trade-offs, and DEFT can complement pruning and quantization techniques. The work provides a practical path toward density-efficient PEFT for large transformers with potential hardware-level benefits on sparsity-aware accelerators.

Abstract

Pretrained Language Models (PLMs) have become the de facto starting point for fine-tuning on downstream tasks. However, as model sizes continue to increase, traditional fine-tuning of all the parameters becomes challenging. To address this, parameter-efficient fine-tuning (PEFT) methods have gained popularity as a means to adapt PLMs effectively. In parallel, recent studies have revealed the presence of activation sparsity within the intermediate outputs of the multilayer perceptron (MLP) blocks in transformers. Low activation density enables efficient model inference on sparsity-aware hardware. Building upon this insight, in this work, we propose a novel density loss that encourages higher activation sparsity (equivalently, lower activation density) in the pre-trained models. We demonstrate the effectiveness of our approach by utilizing mainstream PEFT techniques, including QLoRA, LoRA, Adapter, and Prompt/Prefix Tuning, to facilitate efficient model adaptation across diverse downstream tasks. Experiments show that our proposed method, \textbf{DEFT} (Density-Efficient Fine-Tuning), can consistently reduce activation density by up to \textbf{44.94\%} on RoBERTa$_\mathrm{Large}$ and by \textbf{53.19\%} (encoder density) and \textbf{90.60\%} (decoder density) on Flan-T5$_\mathrm{XXL}$ (\textbf{11B}) compared to PEFT, using GLUE and QA (SQuAD) benchmarks respectively. We also introduce \textbf{ADA-DEFT}, an adaptive variant of our DEFT approach, which achieves significant memory and runtime savings during inference. For instance, ADA-DEFT reduces runtime by \textbf{8.79\%}and memory usage by \textbf{17.46\%} in Flan-T5$_\mathrm{XL}$, and by \textbf{2.79\%} and \textbf{2.54\%} respectively in Flan-T5$_\mathrm{XXL}$. Additionally, we showcase that DEFT works complementarily with quantized and pruned models.

From PEFT to DEFT: Parameter Efficient Finetuning for Reducing Activation Density in Transformers

TL;DR

DEFT introduces a density loss to PEFT-based fine-tuning to actively promote activation sparsity in transformer MLP blocks, enabling sparse activations that hardware can exploit for energy-efficient inference. By freezing the base model and training small PEFT modules (Adapter, LoRA, QLoRA, Prefix/Prompt-Tuning) with a sparsity-regularized objective, DEFT achieves substantial reductions in activation density while maintaining task performance on GLUE and SQuAD. An adaptive variant, ADA-DEFT, adds layerwise learnable weights to selectively skip MLP blocks at inference, yielding runtime and memory savings. Experiments across RoBERTaLarge, BERTBase, T5/Flan-T5 models show density reductions up to ~44-90% depending on model and block, along with favorable energy and efficiency trade-offs, and DEFT can complement pruning and quantization techniques. The work provides a practical path toward density-efficient PEFT for large transformers with potential hardware-level benefits on sparsity-aware accelerators.

Abstract

Pretrained Language Models (PLMs) have become the de facto starting point for fine-tuning on downstream tasks. However, as model sizes continue to increase, traditional fine-tuning of all the parameters becomes challenging. To address this, parameter-efficient fine-tuning (PEFT) methods have gained popularity as a means to adapt PLMs effectively. In parallel, recent studies have revealed the presence of activation sparsity within the intermediate outputs of the multilayer perceptron (MLP) blocks in transformers. Low activation density enables efficient model inference on sparsity-aware hardware. Building upon this insight, in this work, we propose a novel density loss that encourages higher activation sparsity (equivalently, lower activation density) in the pre-trained models. We demonstrate the effectiveness of our approach by utilizing mainstream PEFT techniques, including QLoRA, LoRA, Adapter, and Prompt/Prefix Tuning, to facilitate efficient model adaptation across diverse downstream tasks. Experiments show that our proposed method, \textbf{DEFT} (Density-Efficient Fine-Tuning), can consistently reduce activation density by up to \textbf{44.94\%} on RoBERTa and by \textbf{53.19\%} (encoder density) and \textbf{90.60\%} (decoder density) on Flan-T5 (\textbf{11B}) compared to PEFT, using GLUE and QA (SQuAD) benchmarks respectively. We also introduce \textbf{ADA-DEFT}, an adaptive variant of our DEFT approach, which achieves significant memory and runtime savings during inference. For instance, ADA-DEFT reduces runtime by \textbf{8.79\%}and memory usage by \textbf{17.46\%} in Flan-T5, and by \textbf{2.79\%} and \textbf{2.54\%} respectively in Flan-T5. Additionally, we showcase that DEFT works complementarily with quantized and pruned models.
Paper Structure (50 sections, 12 equations, 6 figures, 9 tables, 1 algorithm)

This paper contains 50 sections, 12 equations, 6 figures, 9 tables, 1 algorithm.

Figures (6)

  • Figure 1: (a) Comparison between the activation density (in the intermediate output of MLP) after adapting to downstream tasks with PEFT and our proposed DEFT method. Both methods use Adapter. (b) ADA-DEFT during inference: based on the learned adaptive layerwise weights, we skip MLP blocks in the ADA-DEFT model, resulting in runtime savings for Flan-T5 models.
  • Figure 2: Percentage of non-zeros (density). Layerwise non-zeros (%) for RoBERTa$_\mathrm{Large}$ (a,d), Flan-T5$_\mathrm{xl}$ (b,e) with Adapter, and Flan-T5$_\mathrm{XXL}$ (c.f) with QLoRA on the validation set of different tasks. The x-axis is the layer index.
  • Figure 3: Adaptive Layerwise Weights. Learned Adaptive layerwise weights for ADA-DEFT and ADA-PEFT on SQuAD dataset using Flan-T5 models
  • Figure 4: Metric v/s Sparsity. Performance of RoBERTa$_\mathrm{Large}$ with Adapter for different pruning thresholds for MLP block using WANDA metric on the validation set. (a) and (c): Accuracy and Density (%) on SST2 dataset. (b) and (d): Accuracy and Density (%) on MNLI dataset.
  • Figure 5: Ablation Study. Varying $\alpha$ and $\epsilon$ parameters using Adapter module with RoBERTa$_\mathrm{Large}$ on SST2 dataset.
  • ...and 1 more figures