Parameter-Efficient Orthogonal Finetuning via Butterfly Factorization

Weiyang Liu, Zeju Qiu, Yao Feng, Yuliang Xiu, Yuxuan Xue, Longhui Yu, Haiwen Feng, Zhen Liu, Juyeon Heo, Songyou Peng, Yandong Wen, Michael J. Black, Adrian Weller, Bernhard Schölkopf · DOI

Introduction

Adapting massive foundation models, such as Llama-2 or Stable Diffusion, to specific downstream tasks is a significant computational challenge. Traditional Parameter-Efficient Finetuning (PEFT) methods, most notably LoRA, typically employ additive low-rank updates. While effective, these updates can disrupt the internal relational structure of pretrained weights, specifically the pairwise angles between neurons.

Orthogonal Finetuning (OFT) was introduced to mitigate this by applying an orthogonal transformation that preserves these angular relationships. However, OFT encounters a "Goldilocks" dilemma: a full dense orthogonal matrix requires $O(d^2)$ parameters, which is prohibitive, while the block-diagonal versions used to reduce parameter counts often lack sufficient expressivity. This paper introduces Orthogonal Butterfly (BOFT), a method that leverages "butterfly factorization" to generate dense, parameter-efficient orthogonal matrices.

Comparison of additive low-rank adaptation (LoRA) vs. multiplicative orthogonal finetuning (OFT/BOFT).

Methodology

The core innovation of BOFT is the parameterization of a dense orthogonal matrix $R$ as a product of sparse factors, inspired by the Cooley-Tukey Fast Fourier Transform (FFT).

Butterfly Factorization

BOFT represents the orthogonal matrix $R$ as a product of $m$ sparse "butterfly" matrices. Each factor is a block-diagonal matrix composed of small $2b \times 2b$ orthogonal blocks. This recursive structure allows a $d$-dimensional dense matrix to be parameterized with only $O(d \log d)$ parameters, providing a significant efficiency gain over dense matrices while maintaining global connectivity between input and output dimensions.

Information Transmission View

The authors frame the generation of a dense matrix as an information transmission problem through a grid-structured graph. The butterfly structure is chosen because it maximizes connectivity—allowing every input dimension to eventually interact with every output dimension—while minimizing the number of edges (parameters).

Implementation Details

To ensure that the matrices remain strictly orthogonal during training, the authors utilize the Cayley transform, which maps skew-symmetric matrices to the orthogonal group. Additionally, they introduce Multiplicative Dropout, a specialized regularization technique that randomly replaces butterfly blocks with identity matrices to prevent overfitting during the adaptation process.

Experimental Evaluation

BOFT was evaluated across a diverse set of benchmarks spanning natural language processing, computer vision, and generative AI.

  • Natural Language Processing: On the MATH benchmark using Llama-2, BOFT achieved a 10% relative improvement over LoRA while utilizing only half the trainable parameters. It also showed competitive performance on GLUE and MMLU.
  • Computer Vision: On the VTAB-1K benchmark with DINOv2, BOFT outperformed both full finetuning and LoRA, particularly in structured and specialized tasks. It also demonstrated high performance in image segmentation using SAM.
  • Generative AI: In controllable generation tasks (ControlNet) with Stable Diffusion, BOFT significantly reduced face landmark errors (5.667 vs. LoRA's 8.878), suggesting superior capture of spatial signals.

Key Insights

  1. Structural Advantage: Unlike block-diagonal OFT, which isolates groups of neurons, BOFT's butterfly pattern enables global information exchange through a series of sparse interactions.
  2. Generalization of OFT: BOFT serves as a generalized framework; when the number of factors $m=1$, it reduces to standard block-diagonal OFT.
  3. Training-Free Interpolation: Since BOFT factors are initialized to identity, the finetuning effect can be smoothly interpolated after training by setting specific factors back to identity, allowing for flexible model adjustment without retraining.
  4. Spectral Stability: By preserving the spectral norm of weight matrices, BOFT ensures more stable training and potentially better generalization compared to additive methods.

Conclusion and Future Work

BOFT provides a powerful alternative to additive PEFT methods by combining the structural benefits of orthogonal transformations with the efficiency of butterfly factorization. While it introduces a slight training overhead due to multiple sparse matrix multiplications, its performance gains and parameter efficiency are substantial. Future research may explore alternative network topologies from computer networking to identify even more efficient sparsity patterns for orthogonal adaptation.

Summary updated

BibTeX
@inproceedings{liu2024parameter,
  author = {Weiyang Liu and Zeju Qiu and Yao Feng and Yuliang Xiu and Yuxuan Xue and Longhui Yu and Haiwen Feng and Zhen Liu and Juyeon Heo and Songyou Peng and Yandong Wen and Michael J. Black and Adrian Weller and Bernhard Schölkopf},
  title = {{Parameter-Efficient Orthogonal Finetuning via Butterfly Factorization}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=7NzgkEdGyr},
}
Figure