ResLoRA: Identity Residual Mapping in Low-Rank Adaption

Shuhua Shi, Shaohan Huang, Minghui Song, Zhoujun Li, Zihan Zhang, Haizhen Huang, Furu Wei, Weiwei Deng, Feng Sun, Qi Zhang · DOI

Introduction

Fine-tuning Large Language Models (LLMs) is computationally demanding, leading to the widespread adoption of Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA (Low-Rank Adaptation). LoRA freezes the original model weights and trains small, low-rank matrices in parallel. However, in deep architectures, gradients must traverse a long chain of frozen layers and non-linearities to reach early-layer LoRA weights. This "long calculation path" often results in gradient vanishing or explosion, slowing convergence and limiting performance.

Methodology: Residual Shortcuts for LoRA

To address this bottleneck, the authors introduce ResLoRA, a framework that adds identity residual mappings between LoRA blocks. By creating direct paths for gradients, ResLoRA ensures that adapter weights in early layers are updated as effectively as those in later layers.

Comparison between standard LoRA and the proposed ResLoRA Input-shortcut structure.

The paper explores three primary structural variants:

  1. Input-shortcut (is): Adds the input vector of a previous LoRA block to the current one.
  2. Block-shortcut (bs): A dense-style connection allowing a layer to utilize weights from multiple previous blocks.
  3. Middle-shortcut (ms): Places shortcuts between the internal low-rank matrices ($A$ and $B$).

The Merging Advantage

A critical feature of ResLoRA is its merging approach. During inference, the residual training structure is mathematically "flattened" back into standard LoRA weights using Frobenius norm estimation. This allows the model to benefit from residual optimization during training while maintaining zero extra parameters and zero added latency during deployment.

Experimental Results

ResLoRA was evaluated across Natural Language Generation (NLG), Understanding (NLU), and Text-to-Image tasks. The results demonstrate significant improvements in both training efficiency and final model accuracy.

Training efficiency and performance comparison on the SVAMP dataset.

Key performance metrics include:

  • Convergence Speed: On the SVAMP math reasoning dataset, ResLoRA achieved a 2.5x faster convergence rate compared to standard LoRA.
  • Accuracy Gains: ResLoRA improved performance on SVAMP by 14.3% and on the HellaSwag benchmark by up to 36.85%.
  • Image Synthesis: In Stable Diffusion v2 fine-tuning, ResLoRA generated high-quality stylized images in roughly 200 steps, whereas standard LoRA required significantly more training to achieve comparable results.

Conclusion

ResLoRA effectively bridges the gap between complex training architectures and efficient inference. By introducing residual paths that can be merged post-training, it overcomes the optimization hurdles of standard LoRA. Future work will focus on minimizing the minor "merging loss" (currently ~1%) and integrating ResLoRA with other PEFT techniques like QLoRA.

Summary updated

BibTeX
@inproceedings{shi2024reslora,
  author = {Shuhua Shi and Shaohan Huang and Minghui Song and Zhoujun Li and Zihan Zhang and Haizhen Huang and Furu Wei and Weiwei Deng and Feng Sun and Qi Zhang},
  title = {{ResLoRA: Identity Residual Mapping in Low-Rank Adaption}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.525},
}
Figure