MixLoRA: Enhancing Large Language Models Fine-Tuning with LoRA-based Mixture of Experts

Dengchun Li, Yingzi Ma, Naizheng Wang, Zhengmao Ye, Zhiyuan Cheng +6 more
4/22/2024
cs.CLcs.AI

No official code found. Best implementation: TUDB-Labs/MixLoRA (208 stars, Apache-2.0, last commit 2024-08-22). 1 more below.

Abstract

Fine-tuning Large Language Models (LLMs) is a common practice to adapt pre-trained models for specific applications. While methods like LoRA have effectively addressed GPU memory constraints during fine-tuning, their performance often falls short, especially in multi-task scenarios. In contrast, Mixture-of-Expert (MoE) models, such as Mixtral 8x7B, demonstrate remarkable performance in multi-task learning scenarios while maintaining a reduced parameter count. However, the resource requirements of these MoEs remain challenging, particularly for consumer-grade GPUs with less than 24GB memory. To tackle these challenges, we propose MixLoRA, an approach to construct a resource-efficient sparse MoE model based on LoRA. MixLoRA inserts multiple LoRA-based experts within the feed-forward network block of a frozen pre-trained dense model and employs a commonly used top-k router. Unlike other LoRA-based MoE methods, MixLoRA enhances model performance by utilizing independent attention-layer LoRA adapters. Additionally, an auxiliary load balance loss is employed to address the imbalance problem of the router. Our evaluations show that MixLoRA improves about 9% accuracy compared to state-of-the-art PEFT methods in multi-task learning scenarios. We also propose a new high-throughput framework to alleviate the computation and memory bottlenecks during the training and inference of MOE models. This framework reduces GPU memory consumption by 40% and token computation latency by 30% during both training and inference.

View on arXivView PDF

Code Implementations(2)

TUDB-Labs/MixLoRACommunity100%
Apache-2.0

State-of-the-art Parameter-Efficient MoE Fine-tuning Method

20820Shell, PythonApr 12, 20242 years agoApache-2.0
mixloramlora
mikecovlee/mLoRACommunity100%
Apache-2.0

This repository has transferred to https://github.com/TUDB-Labs/MoE-PEFT

225Shell, PythonDec 18, 20232 years agoApache-2.0
mixloramlora

Similar Papers

Cite this paper

@article{li2024mixlora,
  title  = {MixLoRA: Enhancing Large Language Models Fine-Tuning with LoRA-based Mixture of Experts},
  author = {Dengchun Li and Yingzi Ma and Naizheng Wang and Zhengmao Ye and Zhiyuan Cheng and Yinghao Tang and Yan Zhang and Lei Duan and Jie Zuo and Cal Yang and Mingjie Tang},
  year   = {2024},
  eprint = {2404.15159},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2404.15159v3}
}

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/2404.15159.svg)](https://codeofpaper.com/paper/2404.15159)

Discussion