Low-rank Attention Side-Tuning for Parameter-Efficient Fine-Tuning

Ningyuan Tang, Minghao Fu, Ke Zhu, Jianxin WuarXiv 2024

Abstract

In finetuning a large pretrained model to downstream tasks, parameter-efficient fine-tuning (PEFT) methods can effectively finetune pretrained models with few trainable parameters, but suffer from high GPU memory consumption and slow training speed. Because learnable parameters from these methods are entangled with the pretrained model, gradients related to the frozen pretrained model's parameters have to be computed and stored during finetuning. We propose Low-rank Attention Side-Tuning (LAST), which disentangles the trainable module from the pretrained model by freezing not only parameters but also outputs of the pretrained network. LAST trains a side-network composed of only low-rank self-attention modules. By viewing the pretrained model as a frozen feature extractor, the side-network takes intermediate output from the pretrained model and focus on learning task-specific knowledge. We also show that LAST can be highly parallel across multiple optimization objectives, making it very efficient in downstream task adaptation, for example, in finding optimal hyperparameters. LAST outperforms previous state-of-the-art methods on VTAB-1K and other visual adaptation tasks with roughly only 30% of GPU memory footprint and 60% of training time compared to existing PEFT methods, but achieves significantly higher accuracy.

Introduction

Fine-tuning massive pretrained models like Vision Transformers (ViTs) is the gold standard for task-specific adaptation, yet it remains incredibly resource-intensive. While Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA or Adapters reduce the number of trainable parameters, they often fail to significantly lower GPU memory consumption.

This discrepancy arises from "entanglement": because learnable parameters are woven into the existing model architecture, the system must still compute and store gradients for the frozen parts of the network during training. This "memory tax" makes it difficult for researchers without massive server clusters to work with the latest, largest models. LAST (Low-rank Attention Side-Tuning) addresses this by decoupling a lightweight side-network from the massive frozen backbone.

Methods

LAST utilizes a side-tuning strategy where the pretrained backbone is treated as a completely frozen, standalone feature extractor. By disentangling the trainable modules, LAST bypasses the need to store intermediate activation maps for the frozen model, leading to massive memory savings.

The LAST architecture (left) showing how the side-network samples from the backbone, and the internal Low-rank Self-Attention (LSA) block (right).

Key technical innovations include:

  • The Side-Network: A separate network that runs alongside the backbone. It takes intermediate features as input but never sends information back into the backbone, ensuring no gradients are cached for the frozen layers.
  • Low-rank Self-Attention (LSA): The authors discovered that massive Feed-Forward Networks (FFNs) are largely unnecessary in a side-tuning context. LAST consists only of low-rank attention modules (with ranks as low as 4 or 8), making the side-network incredibly small.
  • Bias Correction: To prevent the side-network from accumulating redundant information from the backbone through residual connections, the authors introduced a mathematical correction to subtract this bias, forcing the network to focus purely on task-specific knowledge.
  • Parallel Optimization: Because the backbone is frozen, its outputs can be pre-computed. This allows researchers to train multiple side-networks with different hyperparameters simultaneously on the same GPU.

Experimental Results

The researchers evaluated LAST across a wide range of computer vision benchmarks, including VTAB-1K (19 diverse datasets) and Fine-Grained Visual Classification (FGVC) tasks. They tested backbones ranging from ViT-Base to the massive ViT-giant (1.1 billion parameters).

Efficiency and Accuracy

LAST achieved a state-of-the-art mean accuracy of 76.5% on VTAB-1K, outperforming previous methods like FacT (75.6%) and LoRA (74.5%).

Comparison of accuracy vs. GPU memory (left) and training throughput (right) across various PEFT methods. LAST (red diamond) achieves the best balance of performance and efficiency.

Beyond accuracy, the efficiency gains are substantial:

  • Memory: LAST uses roughly 30% of the GPU memory compared to standard PEFT methods.
  • Speed: It requires only 60% of the training time.
  • Hardware Accessibility: The authors successfully fine-tuned a ViT-giant (1.1B parameters) on a single NVIDIA TITAN Xp (12GB memory) from 2017—a feat that would cause out-of-memory errors for most other PEFT methods.

Limitations and Future Work

Currently, LAST is optimized for Vision Transformers (ViTs), and transferring it to other architectures like ResNets is not yet straightforward. While the theory should apply to Large Language Models (LLMs), this study focused exclusively on computer vision due to resource constraints. Future work will explore applying LAST to the language domain and further refining hyperparameter selection strategies.

Summary updated

BibTeX
@misc{tang2024low,
  author = {Ningyuan Tang and Minghao Fu and Ke Zhu and Jianxin Wu},
  title = {{Low-rank Attention Side-Tuning for Parameter-Efficient Fine-Tuning}},
  year = {2024},
  eprint = {2402.04009},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.04009},
}
Figure