Long Exposure: Accelerating Parameter-Efficient Fine-Tuning for LLMs under Shadowy Sparsity

Tuowei Wang, Kun Li, Zixu Hao, Donglin Bai, Ju Ren, Yaoxue Zhang, Ting Cao, Mao Yang

Abstract

The adaptation of pre-trained large language models (LLMs) to diverse downstream tasks via fine-tuning is critical for numerous applications. However, the inefficiency of parameter-efficient fine-tuning (PEFT) techniques presents significant challenges in terms of time investments and operational costs. In this paper, we first introduce a nuanced form of sparsity, termed Shadowy Sparsity, which is distinctive in fine-tuning and has not been adequately addressed for acceleration. Under Shadowy Sparsity, we propose Long Exposure, an efficient system to accelerate PEFT for LLMs. Long Exposure comprises three key components: Shadowy-sparsity Exposer employs a prolonged sensing range to capture more sparsity details under shadowy sparsity; Sequence-oriented Predictor provides efficient yet accurate predictions to handle large sequence inputs and constantly-evolving parameters; and Dynamic-aware Operator facilitates more structured computational patterns and coalesced memory accesses, addressing dynamic sparse operations. Extensive evaluations show that Long Exposure outperforms state-of-the-arts with up to a $2.49\times$ speedup in end-to-end fine-tuning, offering promising advancements in accelerating PEFT for LLMs.

Introduction

Parameter-Efficient Fine-Tuning (PEFT) methods, such as LoRA (Low-Rank Adaptation), have transformed how we adapt Large Language Models (LLMs) by reducing trainable parameters to a tiny fraction of the original model. However, a significant gap remains: reducing parameters does not automatically lead to a proportional reduction in "wall-clock" training time. The primary bottleneck is the massive, frozen "backbone" of the LLM, which still requires full forward and backward passes. LONG EXPOSURE addresses this by uncovering and exploiting a phenomenon the authors call Shadowy Sparsity.

The Challenge: Shadowy Sparsity

While sparsity—skipping zero-value activations—is a common optimization for model inference, it is notoriously difficult to apply during fine-tuning. The authors identify "Shadowy Sparsity" as the culprit. When processing sequences of tokens, individual token-level sparsity is often masked. The "logical AND" combination of many tokens in a sequence makes the overall workload appear dense to standard operators, hiding potential computational savings.

Figure 1: Shadowy Sparsity in Multi-head Attention and MLP blocks. The sequence-level view (bottom) hides the fine-grained sparsity visible at the token or head level (top).

As illustrated in Figure 1, standard sequence-level processing creates a "shadow" that obscures skippable work. LONG EXPOSURE "shines a light" through these shadows by increasing granularity, identifying unique sparse patterns for individual attention heads and specific neurons within MLP blocks.

The LONG EXPOSURE System

To exploit this hidden sparsity, LONG EXPOSURE introduces three innovative components:

  1. Shadowy-sparsity Exposer: This module identifies sparsity at a higher resolution. In the Multi-head Attention mechanism, it tracks unique sparse patterns for each individual head. In MLP blocks, it employs a "neuron-filter" to identify and skip neurons that contribute negligibly to the final output.
  2. Sequence-oriented Predictor: To eliminate the overhead of calculating sparsity masks on the fly, the system uses lightweight, trainable neural networks. These predictors are designed to handle the "evolving parameters" problem inherent in fine-tuning, where model weights change slightly over time. They use robust loss metrics that prioritize high recall, ensuring that no active neurons are accidentally skipped.
  3. Dynamic-aware Operator: Standard sparse kernels often struggle with the rapidly changing patterns of fine-tuning. The authors developed custom GPU operators for SDD and DSD matrix multiplications. These kernels use a two-stage approach—pre-computing common "atomic" sparse layouts offline and combining them online—to minimize data conversion overhead and maximize memory coalescing.

The Sparsity Bridge

A critical theoretical insight of this work is the "Sparsity Bridge." The authors demonstrate a mathematical link between the forward and backward passes: if a parameter is inactive during the forward pass due to zero activations, it is effectively excluded from the gradient computation in the backward pass.

Figure 5: The Sparsity Bridge in PEFT. Inactive parameters in the forward pass allow for skipping gradient computations in the backward pass, sharing the computational savings across the entire training loop.

As shown in Figure 5, this bridge justifies using sparsity to accelerate the entire training loop. By skipping zero-activation paths, LONG EXPOSURE reduces the workload for both forward and backward propagation, which is essential for achieving true end-to-end training acceleration.

Key Results and Evaluation

The system was rigorously tested on OPT-1.3B and 2.7B models across various benchmarks, including Alpaca for instruction tuning and reasoning tasks like PIQA and RTE.

  • End-to-End Speedup: LONG EXPOSURE achieved up to a 2.49× speedup in total fine-tuning time on NVIDIA A100 and A6000 GPUs.
  • Memory Efficiency: The system reduced memory footprints by up to 2.77×. This was achieved by keeping the majority of frozen weights on the CPU and only transferring active weights to the GPU as needed.
  • Accuracy Preservation: Across all downstream tasks, the system maintained accuracy levels nearly identical to standard LoRA fine-tuning, typically within a 0.5%–1% margin.

Conclusion

LONG EXPOSURE effectively bridges the gap between parameter efficiency and computational efficiency in LLM fine-tuning. By exposing "Shadowy Sparsity" through granular modeling and predictive operators, it provides a scalable and practical solution for reducing the time and cost of adapting massive models to specialized tasks. Future work may explore extending these techniques to even more granular weight-level sparsity and broader activation function support.

Summary updated

BibTeX
@inproceedings{wang2024long,
  author = {Tuowei Wang and Kun Li and Zixu Hao and Donglin Bai and Ju Ren and Yaoxue Zhang and Ting Cao and Mao Yang},
  title = {{Long Exposure: Accelerating Parameter-Efficient Fine-Tuning for LLMs under Shadowy Sparsity}},
  booktitle = {SC},
  year = {2024},
  url = {https://openreview.net/forum?id=BjAMbpFmyR},
}
Figure