mikecovlee commited on
Commit
866a94c
1 Parent(s): eb06a94

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -7
README.md CHANGED
@@ -3,21 +3,36 @@ license: apache-2.0
3
  datasets:
4
  - yahma/alpaca-cleaned
5
  ---
6
- # MixLoRA: Enhancing Large Language Models Fine-Tuning with LoRA based Mixture of Experts
7
 
8
- <div align="left"><img src="https://huggingface.co/scu-kdde/alpaca-mixlora-7b/resolve/main/MixLoRA.png" width=60%"></div>
9
-
10
- GitHub: [mikecovlee/mlora](https://github.com/mikecovlee/mlora)
11
 
12
  Large Language Models (LLMs) have showcased exceptional performance across a wide array of Natural Language Processing (NLP) tasks. Fine-tuning techniques are commonly utilized to tailor pre-trained models to specific applications. While methods like LoRA have effectively tackled GPU memory constraints during fine-tuning, their applicability is often restricted. On the other hand, Mix-of-Expert (MoE) models, such as Mixtral 8x7B, demonstrate remarkable performance while maintaining a reduced parameter count. However, the resource requirements of these models pose challenges, particularly for consumer-grade GPUs.
13
 
14
  To address this challenge, we propose MixLoRA, an innovative approach aimed at constructing a resource-efficient sparse MoE model. MixLoRA inserts multiple LoRA-based experts within the feed-forward network block of a frozen pre-trained dense model through fine-tuning, employing a top-k routing strategy. Unlike other LoRA MoE methods, MixLoRA enhances model performance by utilizing independently configurable attention layer LoRA adapters, supporting LoRA and its variants for the construction of experts, and applying auxiliary load balance loss to address the imbalance problem of the router.
15
 
16
- In experiments, MixLoRA achieves commendable performance across all evaluation metrics in both single-task and multi-task learning scenarios. Implemented within the m-LoRA framework, MixLoRA enables parallel fine-tuning, inference, and evaluation of multiple mixture-of-experts models on a single 24GB consumer-grade GPU without quantization, thereby reducing GPU memory consumption by 41\% and latency during the training process by 17\%.
 
 
 
 
 
 
 
 
 
17
 
18
  ## Citation
19
- Please cite the repo if you use the code in this repo.
20
  ```bibtex
 
 
 
 
 
 
 
 
21
  @misc{alpaca-mixlora-7b,
22
  author = {Dengchun, Li and Yingzi, Ma and Naizheng, Wang and Lei, Duan and Jie, Zuo and Mingjie, Tang},
23
  title = {MixLoRA LoRA MoE adapter based on AlpacaCleaned dataset and LLaMA-2-7B base model},
@@ -30,7 +45,7 @@ Please cite the repo if you use the code in this repo.
30
  ## Copyright
31
  Copyright © 2023-2024 All Rights Reserved.
32
 
33
- This project is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
34
 
35
  ```
36
  Licensed under the Apache License, Version 2.0 (the "License");
 
3
  datasets:
4
  - yahma/alpaca-cleaned
5
  ---
6
+ # MixLoRA: Resource-Efficient Model with Mix-of-Experts Architecture for Enhanced LoRA Performance
7
 
8
+ <div align="left"><img src="./assets/MixLoRA.png" width=60%"></div>
 
 
9
 
10
  Large Language Models (LLMs) have showcased exceptional performance across a wide array of Natural Language Processing (NLP) tasks. Fine-tuning techniques are commonly utilized to tailor pre-trained models to specific applications. While methods like LoRA have effectively tackled GPU memory constraints during fine-tuning, their applicability is often restricted. On the other hand, Mix-of-Expert (MoE) models, such as Mixtral 8x7B, demonstrate remarkable performance while maintaining a reduced parameter count. However, the resource requirements of these models pose challenges, particularly for consumer-grade GPUs.
11
 
12
  To address this challenge, we propose MixLoRA, an innovative approach aimed at constructing a resource-efficient sparse MoE model. MixLoRA inserts multiple LoRA-based experts within the feed-forward network block of a frozen pre-trained dense model through fine-tuning, employing a top-k routing strategy. Unlike other LoRA MoE methods, MixLoRA enhances model performance by utilizing independently configurable attention layer LoRA adapters, supporting LoRA and its variants for the construction of experts, and applying auxiliary load balance loss to address the imbalance problem of the router.
13
 
14
+ In experiments, MixLoRA achieves commendable performance across all evaluation metrics in both single-task and multi-task learning scenarios. Implemented within the m-LoRA framework, MixLoRA enables parallel fine-tuning, inference, and evaluation of multiple mixture-of-experts models on a single 24GB consumer-grade GPU without quantization, thereby reducing GPU memory consumption by 41% and latency during the training process by 17%.
15
+
16
+ | PEFT Method | # Params (%) | ARC-e | ARC-c | BoolQ | OBQA | PIQA | AVG. |
17
+ |-------------|--------------|-------|-------|-------|------|------|------|
18
+ | LoRA | 2.6% | 73.8 | 50.9 | 62.2 | 80.4 | 69.9 | 67.4 |
19
+ | DoRA | 2.6% | 76.5 | 59.8 | 71.7 | 80.6 | 78.8 | 73.5 |
20
+ | **MixLoRA** | 2.6% | 76.5 | 58.1 | 73.8 | 84.4 | 82.6 | 75.1 |
21
+ | **MixDoRA** | 2.6% | 78.3 | 59.6 | 74.2 | 84.4 | 83.6 | 76.0 |
22
+
23
+ The table above presents the performance of MixLoRA and compares these results with outcomes obtained by employing LoRA and DoRA for fine-tuning. The results demonstrate that the language model with MixLoRA achieves commendable performance across all evaluation methods. All methods are fine-tuned and evaluated with [meta-llama/Llama-2-7b-hf](https://huggingface.co/meta-llama/Llama-2-7b-hf) on m-LoRA, with all metrics reported as accuracy.
24
 
25
  ## Citation
26
+ If MixLoRA has been useful for your work, please consider citing it using the appropriate citation format for your publication.
27
  ```bibtex
28
+ @misc{MixLoRA,
29
+ author = {Dengchun, Li and Yingzi, Ma and Naizheng, Wang and Lei, Duan and Jie, Zuo and Mingjie, Tang},
30
+ title = {MixLoRA: Enhancing Large Language Models Fine-Tuning with LoRA based Mixture of Experts},
31
+ year = {2024},
32
+ publisher = {GitHub},
33
+ howpublished = {\url{https://github.com/mikecovlee/mlora}},
34
+ }
35
+
36
  @misc{alpaca-mixlora-7b,
37
  author = {Dengchun, Li and Yingzi, Ma and Naizheng, Wang and Lei, Duan and Jie, Zuo and Mingjie, Tang},
38
  title = {MixLoRA LoRA MoE adapter based on AlpacaCleaned dataset and LLaMA-2-7B base model},
 
45
  ## Copyright
46
  Copyright © 2023-2024 All Rights Reserved.
47
 
48
+ m-LoRA and the weights of alpaca-mixlora-7b are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
49
 
50
  ```
51
  Licensed under the Apache License, Version 2.0 (the "License");