Layer-wise Importance Matters: Less Memory for Better Performance in Parameter-efficient Fine-tuning of Large Language Models

Kai Yao, Penglei Gao, Lichun Li, Yuan Zhao, Xiaofeng Wang, Wei Wang, Jianke Zhu

Introduction

Parameter-Efficient Fine-Tuning (PEFT) methods, such as LoRA and Adapters, have revolutionized the adaptation of Large Language Models (LLMs) to specific tasks. However, these methods typically follow a "one-size-fits-all" approach, applying trainable modules uniformly across all model layers. This strategy is inherently inefficient, as not all layers contribute equally to a given task. Redundant updates in unimportant layers not only waste memory but can also introduce noise that hinders convergence.

To address this, we introduce Importance-aware Sparse Tuning (IST), a "plug-and-play" technique that identifies and updates only the most critical layers during fine-tuning. IST leverages layer-wise sparsity to reduce memory consumption while simultaneously improving performance across diverse reasoning tasks.

Methodology: Importance-aware Sparse Tuning

IST operates through two interleaved loops designed to dynamically manage layer selection:

  1. The Fine-tuning Loop: This loop selects a subset of layers ($N_u$) to update based on current importance scores. A stochastic policy ensures exploration, primarily targeting important layers while occasionally sampling others to refine importance estimates.
  2. The Importance Updating Loop: This component measures layer importance using response suppression. By temporarily "mutes" a layer's PEFT module (multiplying its output by a small factor $\beta$) and observing the resulting change in loss, IST identifies critical layers. This process is modeled as a multi-armed bandit problem, utilizing reinforcement learning to update scores throughout training.

Theoretically, IST is supported by Vapnik–Chervonenkis (VC) theory, which suggests that updating a smaller subset of parameters can lead to tighter generalization bounds, explaining why sparse updates can outperform dense ones.

Experimental Results

The effectiveness of IST was evaluated across models ranging from GPT-2 to LLaMA3 8B on benchmarks for commonsense reasoning (e.g., BoolQ, HellaSwag) and arithmetic reasoning (e.g., GSM8K).

Memory and Performance Synergy

A primary advantage of IST is its ability to break the traditional trade-off between memory efficiency and model accuracy. For a LLaMA 7B model, IST reduced total training memory from above the 24GB threshold to approximately 20GB—contributing to an average reduction of 36% across different PEFT types.

Figure 1: Memory cost comparison and validation loss curves for different tuning methods.

As shown in Figure 1, IST (LoRA + IST) not only stays within the 24GB memory limit of consumer-grade GPUs but also achieves lower validation loss faster than standard LoRA. In terms of accuracy, LoRA + IST achieved an average score of 76.5 on commonsense tasks, outperforming vanilla LoRA (74.7) and even approaching ChatGPT's performance on specific sub-tasks.

Discussion: The Role of Layer Importance

The core premise of IST is that layer redundancy is pervasive in LLMs. Experimental analysis confirms that removing the least important layers has a negligible impact on performance, whereas removing the most important layers leads to a rapid decline in model quality.

Figure 6: Impact of layer selection on model perplexity, highlighting the significance of specific layers.

Figure 6 illustrates this phenomenon: greedily removing trained LoRA modules based on importance scores shows that the model is highly sensitive to specific "hotspot" layers. Furthermore, tuning only the most important layers leads to significantly better perplexity than tuning the least important ones, often matching or exceeding full fine-tuning performance with far fewer parameters.

Conclusion

IST demonstrates that "less is more" in the context of LLM fine-tuning. By focusing computational resources on task-specific important layers, IST achieves superior generalization and significant memory savings. Its plug-and-play nature makes it a versatile tool for various PEFT architectures, including LoRA, Adapters, and DoRA.

Summary updated

BibTeX
@inproceedings{yao2024layer,
  author = {Kai Yao and Penglei Gao and Lichun Li and Yuan Zhao and Xiaofeng Wang and Wei Wang and Jianke Zhu},
  title = {{Layer-wise Importance Matters: Less Memory for Better Performance in Parameter-efficient Fine-tuning of Large Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.109},
}
Figure