Sparse High Rank Adapters

Kartikeya Bhardwaj, Nilesh Prasad Pandey, Sweta Priyadarshi, Viswanath Ganapathy, Shreya Kadambi, Rafael Esteves, Shubhankar Borse, Paul Whatmough, Risheek Garrepalli, Mart Van Baalen, Harris Teague, Markus Nagel

TL;DR

Researchers from Qualcomm AI Research have introduced Sparse High Rank Adapters (SHiRA), a new parameter-efficient fine-tuning (PEFT) method that challenges the dominance of LoRA. By fine-tuning a tiny, sparse subset (1–2%) of a model's original weights rather than adding low-rank matrices, SHiRA enables lightning-fast adapter switching on mobile devices and significantly reduces "concept loss" when using multiple adapters simultaneously.

What Problem Does This Paper Address?

While Low-Rank Adaptation (LoRA) is the industry standard for fine-tuning Large Language Models (LLMs) and Vision Models (LVMs), it hits a wall in mobile and edge deployment. Developers face a "lose-lose" choice:

  1. Fused Mode: Merge LoRA weights into the base model for zero inference overhead. However, because LoRA modifies the entire weight tensor, switching between different tasks (e.g., switching from a "painting style" to a "sketch style") requires reloading or re-calculating massive weight matrices, which is too slow for mobile DRAM.
  2. Unfused Mode: Keep LoRA separate to allow fast switching, but suffer up to a 30% latency penalty during inference.

Furthermore, LoRA often suffers from concept loss—when you try to combine two different LoRA adapters (like a "blue fire" effect and a "painting" style), they often interfere with each other, leading to artifacts or the disappearance of one style.

Methods

SHiRA takes a fundamentally different approach. Instead of adding new low-rank matrices, it identifies and updates a very small fraction (1–2%) of the existing weights in the pretrained model.

SHiRA Architecture

The authors propose several masking strategies to pick which weights to tune:

  • SHiRA-Struct: Updates specific rows, columns, and the diagonal (creating a "rank 1 + diagonal" structure).
  • SHiRA-WM (Weight Magnitude): Updates weights with the highest absolute values.
  • SHiRA-SNIP: Uses a saliency metric based on both weight magnitude and gradients.

At inference time, instead of performing matrix addition across the whole tensor, SHiRA uses a scatter operation. It simply overwrites the specific 1–2% of indices that were changed. This makes the "switching" process a matter of updating a few sparse values rather than re-fusing an entire model.

Datasets

The researchers evaluated SHiRA across both vision and language domains:

  • Vision: Stable Diffusion (v1.5 and XL) using custom datasets for style transfer: Bluefire (adding fire effects) and Paintings (artistic styles).
  • Language: LLaMA-7B and LLaMA2-7B evaluated on eight commonsense reasoning benchmarks, including HellaSwag, PIQA, BoolQ, and Arc-Challenge.
  • Generalization: Image classification on CIFAR-10/100, Food101, and DTD, as well as GLUE benchmarks for DeBERTa-V3.

Key Insights and Ideas

  • High Rank > Low Rank: Because SHiRA tunes weights within the original high-dimensional matrix, it maintains a "high rank" property. This provides more expressive power than the bottlenecked low-rank matrices used in LoRA.
  • Natural Orthogonality: This is the "aha moment" for multi-adapter fusion. If two adapters each only change 1% of the weights, the mathematical probability that they try to change the same weight is extremely low. This high sparsity means adapters naturally stay out of each other's way, preventing the interference (concept loss) seen in LoRA.
  • The Efficiency Paradox: Despite being more expressive, SHiRA is actually easier to train. Their PEFT-based implementation uses 16% less peak GPU memory than LoRA because it doesn't need to store gradients for additional adapter matrices.

Key Results

  • Performance: On LLaMA-7B, SHiRA-SNIP outperformed LoRA by an average of 2.7% across reasoning tasks while only modifying 1% of the base parameters.
  • Switching Speed: On a desktop CPU, loading a SHiRA adapter was 5x to 16x faster than fusing a LoRA adapter. For a model like LLaMA2-7B, SHiRA achieved a 5.71x speedup in end-to-end switching time.
  • Qualitative Superiority: In vision tasks, SHiRA successfully combined styles (e.g., a "blue fire fox" in a "painting" style) where LoRA failed, either losing the painting concept or producing broken images (e.g., elephants with extra tusks).
Multi-Adapter Fusion Comparison
  • Training: SHiRA trains at nearly the same speed as LoRA but with significantly lower memory overhead.

Limitations and Future Work

The authors acknowledge that while SHiRA is mathematically efficient, current hardware and software (like standard PyTorch kernels) aren't always optimized for sparse operations. To fully realize SHiRA's potential on mobile chips, hardware-software co-design (such as specialized lookup-table approaches) may be necessary.

Additionally, while they explored several masking strategies, the authors note that finding the optimal sparse mask for a given task remains an open research question. Future work will likely focus on more sophisticated ways to identify the most "tunable" 1% of a model's brain.

Summary updated

BibTeX
@inproceedings{bhardwaj2024sparse,
  author = {Kartikeya Bhardwaj and Nilesh Prasad Pandey and Sweta Priyadarshi and Viswanath Ganapathy and Shreya Kadambi and Rafael Esteves and Shubhankar Borse and Paul Whatmough and Risheek Garrepalli and Mart Van Baalen and Harris Teague and Markus Nagel},
  title = {{Sparse High Rank Adapters}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=6hY60tkiEK},
}
Figure