Group and Shuffle: Efficient Structured Orthogonal Parametrization

Mikhail Gorbunov, Nikolay Yudin, Vera Soboleva, Aibek Alanov, Alexey Naumov, Maxim Rakhuba

Introduction

As neural networks scale to billions of parameters, full fine-tuning has become computationally prohibitive for most researchers. Parameter-Efficient Fine-Tuning (PEFT) methods, such as LoRA, have become the standard workaround. However, these methods can sometimes suffer from training instabilities.

Orthogonal Fine-Tuning (OFT) has recently emerged as a more stable alternative. OFT uses orthogonal matrices to adapt weights, which preserves the "geometry" (angles and distances) of the original feature space. Despite its benefits, OFT faces a structural dilemma:

  1. Simple structures (like block-diagonal matrices) are fast to compute but lack the expressiveness needed for complex tasks.
  2. Complex structures (like the "butterfly" matrices used in BOFT) are highly expressive but require multiplying many sparse matrices (often 5 or 6), leading to significant memory and time overhead.

To bridge this gap, this paper introduces Group-and-Shuffle (GS) matrices, a new class of structured matrices that makes orthogonal fine-tuning significantly more efficient. By alternating small group transforms with clever shuffles, the authors achieve dense orthogonal representations with fewer parameters and less computational overhead.

Methodology: The Group-and-Shuffle Approach

The core innovation of this work is the GS-matrix class. The structure is conceptually simple and operates in three steps:

  1. Group: Divide the input into small groups and apply independent linear transforms (represented by a block-diagonal matrix $R$).
  2. Shuffle: Rearrange the elements so that every group can interact with every other group (represented by a permutation matrix $P$).
  3. Group Again: Apply another set of independent transforms (represented by a block-diagonal matrix $L$).

Mathematically, this is represented as $A = P_L(LPR)P_R$.

Visual representation of the Group and Shuffle operations (L, P, R) forming the GS-matrix structure.

The authors prove a vital theoretical result: if the small blocks within $L$ and $R$ are orthogonal, the entire GS-matrix is guaranteed to be orthogonal.

They extend this foundation into GSOFT (Group-and-Shuffle Orthogonal Fine-Tuning). While previous methods like BOFT required $\log_2(r)$ layers to become "dense" (where every input affects every output), GS-matrices only require $\log_b(r)$ layers (where $b$ is the block size). In practice, this means GS-matrices can become dense in just 2 layers, whereas BOFT might need 6.

The paper also introduces Double GSOFT, which applies these transforms to both sides of a weight matrix (adapting both left and right singular vectors), and GS Orthogonal Convolutions for building 1-Lipschitz networks.

Experimental Setup

The researchers validated their approach across three distinct domains:

  • Natural Language Understanding: Evaluated on the GLUE benchmark using a RoBERTa-base model.
  • Subject-Driven Image Generation: Used the DreamBooth dataset with Stable Diffusion v2 to generate specific objects in new contexts.
  • Certified Robustness: Trained LipConvnet-15 on CIFAR-100 to test orthogonal convolutions in 1-Lipschitz networks.

Key Findings and Results

  • Efficiency through Density: By choosing the right permutation (shuffle), the model achieves a dense matrix much faster than butterfly-based methods. This reduces the number of matrix multiplications from 6 down to 2, saving both time and memory.
  • Language Modeling: GSOFT achieved an average score of 86.67 on GLUE, outperforming BOFT (85.84) and slightly edging out LoRA (86.53).
  • Image Generation: In DreamBooth experiments, GSOFT showed better alignment with text prompts. It achieved a CLIP-T score of 0.256, compared to BOFT’s 0.244, indicating that the model followed instructions better without losing the identity of the subject.
  • Speedup in Convolutions: In orthogonal convolution tasks, the GS-SOC method provided a 1.64x speedup over the standard SOC baseline while slightly improving accuracy (43.48% vs 43.15%).

Limitations and Future Work

While GSOFT is significantly faster than previous orthogonal methods like BOFT, the authors acknowledge it is still slower than LoRA during training. This is because orthogonal parametrizations (like the Cayley transform used in this work) involve matrix inversions or more complex operations than LoRA's simple additive low-rank updates.

Future work could explore applying GS-matrices to tasks beyond fine-tuning, such as training large models from scratch with orthogonal constraints, or exploring GS-matrices without the orthogonality requirement for general model compression.

Summary updated

BibTeX
@inproceedings{gorbunov2024group,
  author = {Mikhail Gorbunov and Nikolay Yudin and Vera Soboleva and Aibek Alanov and Alexey Naumov and Maxim Rakhuba},
  title = {{Group and Shuffle: Efficient Structured Orthogonal Parametrization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=7EQx56YSB2},
}
Figure