liuqidong07 / MOELoRA-peft

[SIGIR'24] The official implementation code of MOELoRA.
https://arxiv.org/abs/2310.18339
MIT License
115 stars 15 forks source link
chatglm large-language-models low-rank-adaptation mixture-of-experts multi-task multitask-learning parameter-efficient-fine-tuning peft peft-fine-tuning-llm

When MOE Meets LLMs: Parameter Efficient Fine-tuning for Multi-task Medical Applications

This is the implementation of the SIGIR'24 paper "When MOE Meets LLMs: Parameter Efficient Fine-tuning for Multi-task Medical Applications".

If any quetions, you can firstly refer to the issues in initial repo.

Running

You can implement our model according to the following steps:

  1. The handle dataset should be put into ./data/
  2. Put all files of ChatGLM-6B into the folder resources/chatglm-6b/ and replace the the modeling_chatglm.py by our modeling_chatglm.py in this folder.
  3. Install the necessary packages. Run the command:
    pip install -r requirements.txt
  4. To train the MOELoRA and generate the answers to test, please run the command:
    bash ./experiments/moelora.bash
  5. Finally, you can run and configure the results/evaluate.ipynb to get the evaluation scores

Requirements

To ease the configuration of the environment, I list versions of my hardware and software equipments:

You can also try the environment.yml to install the environment.

Citation

If the code and the paper are useful for you, it is appreciable to cite our paper:

@inproceedings{liu2024moe,
  title={When MOE Meets LLMs: Parameter Efficient Fine-tuning for Multi-task Medical Applications},
  author={Liu, Qidong and Wu, Xian and Zhao, Xiangyu and Zhu, Yuanshao and Xu, Derong and Tian, Feng and Zheng, Yefeng},
  booktitle={Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval},
  pages={1104--1114},
  year={2024}
}

Thanks

The code refers to the repo PromptCBLUE.

Besides, thank lhyscau to help me refine the code.