SwitchLoRA: Switched Low-Rank Adaptation Can Learn Full-Rank Information

Kaiye Zhou, Shucheng Wang, Jun Xu
6/3/2024
cs.LGcs.AIcs.CL

No official code found. Best implementation: asfsdsf/SwitchLoRA (0 stars, Apache-2.0, last commit 2025-01-07).

Abstract

In the training of large language models, parameter-efficient techniques such as LoRA optimize memory usage and reduce communication overhead and memory usage during the fine-tuning phase. However, applying such techniques directly during the pre-training phase results in poor performance, primarily because the premature implementation of low-rank training significantly reduces model accuracy. Existing methods like ReLoRA and GaLore have attempted to address this challenge by updating the low-rank subspace. However, they still fall short of achieving the accuracy of full-rank training. Specifically, ReLoRA restricts the frequency of updates to preserve optimizer states consistency, hindering its ability to closely approximate full-rank training behavior. Meanwhile, GaLore relies on Singular Value Decomposition (SVD) to approximate the full-rank space, which introduces accuracy loss during the approximation process. In this paper, we introduce SwitchLoRA, a parameter-efficient training technique that frequently and smoothly replaces the trainable parameters of LoRA adapters with alternative parameters. SwitchLoRA updates the low-rank subspace incrementally, targeting only a few dimensions at a time to minimize the impact on optimizer states. This allows a higher update frequency, thereby enhancing accuracy by enabling the updated parameters to more closely mimic full-rank behavior during the pre-training phase. Our results demonstrate that SwitchLoRA actually surpasses full-rank training, reducing perplexity from 15.23 to 15.01 on the LLaMA 1.3B model, while also cutting communication overhead by 54\% and memory usage by 13\%. Furthermore, after full fine-tuning the SwitchLoRA pre-trained model and the full-rank pre-trained model on the GLUE benchmark, the SwitchLoRA pre-trained model showed an average accuracy gain of about 1\% over the full-rank pre-trained model.

View on arXivView PDF

Code Implementations(1)

asfsdsf/SwitchLoRACommunity60%
Apache-2.0

Official implementation of paper SwitchLoRA: Switched Low-Rank Adaptation Can Learn Full-Rank Information

00Shell, PythonJan 7, 20251 years agoApache-2.0

Similar Papers

Cite this paper

@article{zhou2024switchlora,
  title  = {SwitchLoRA: Switched Low-Rank Adaptation Can Learn Full-Rank Information},
  author = {Kaiye Zhou and Shucheng Wang and Jun Xu},
  year   = {2024},
  eprint = {2406.06564},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.06564v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.06564.svg)](https://codeofpaper.com/paper/2406.06564)

Discussion