LoRAMoE  by Ablustrund

Fine-tuning method for language model alignment

Created 1 year ago
375 stars

Top 75.7% on SourcePulse

GitHubView on GitHub
Project Summary

LoRAMoE introduces a novel Mixture of Experts (MoE) approach designed to enhance language model alignment by preserving world knowledge. This method is particularly beneficial for researchers and practitioners working on large language model fine-tuning and alignment, aiming to mitigate knowledge degradation often seen in standard fine-tuning processes.

How It Works

LoRAMoE integrates a Mixture of Experts architecture directly into the LoRA (Low-Rank Adaptation) framework. By introducing localized balance constraints and a configurable number of experts, it allows specific parameters to be specialized while maintaining a global balance. This approach aims to retain the model's foundational knowledge by distributing expertise across multiple, potentially specialized, LoRA adapters, preventing catastrophic forgetting during alignment.

Quick Start & Requirements

  • Installation: conda env create -f environment.yml or conda create -n loramoe python=3.10 -y followed by pip install -r requirements.txt. The peft package is not installed by default to avoid conflicts.
  • Prerequisites: Python 3.10, Conda environment.
  • Usage: Training is initiated via run_loramoe.sh. Evaluation is supported through OpenCompass.
  • Documentation: Configuration details and hyper-parameter explanations are available within the README.

Highlighted Details

  • Modifies transformers (specifically modeling_llama.py) and peft libraries to incorporate MoE into LoRA.
  • Introduces hyper-parameters like blc_weight, blc_alpha, LoRA_rank, LoRA_alpha, LoRA_trainable, LoRA_dropout, and LoRA_num for expert configuration.
  • Supports evaluation via OpenCompass by modifying its model configuration.

Maintenance & Community

The project is associated with authors from institutions including Shanghai Jiao Tong University and Alibaba Group. Citation details are provided for academic use.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README.

Limitations & Caveats

The README notes that the peft package is intentionally excluded from the default installation to prevent conflicts with existing local installations, requiring manual management. The project's primary modifications are within the transformers and peft libraries, suggesting potential compatibility issues with future versions of these core libraries.

Health Check
Last Commit

1 year ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
11 stars in the last 30 days

Explore Similar Projects

Starred by Omar Sanseviero Omar Sanseviero(DevRel at Google DeepMind), Binyuan Hui Binyuan Hui(Research Scientist at Alibaba Qwen), and
3 more.

Lemur by OpenLemur

0.2%
556
Open language model for language agents
Created 2 years ago
Updated 1 year ago
Starred by Georgi Gerganov Georgi Gerganov(Author of llama.cpp, whisper.cpp), Alex Yu Alex Yu(Research Scientist at OpenAI; Former Cofounder of Luma AI), and
13 more.

Qwen3 by QwenLM

0.4%
25k
Large language model series by Qwen team, Alibaba Cloud
Created 1 year ago
Updated 2 weeks ago
Starred by Rodrigo Nader Rodrigo Nader(Cofounder of Langflow), Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), and
11 more.

Awesome-LLM by Hannibal046

0.3%
25k
Curated list of Large Language Model resources
Created 2 years ago
Updated 1 month ago
Starred by Aravind Srinivas Aravind Srinivas(Cofounder of Perplexity), François Chollet François Chollet(Author of Keras; Cofounder of Ndea, ARC Prize), and
42 more.

spaCy by explosion

0.1%
32k
NLP library for production applications
Created 11 years ago
Updated 3 months ago
Feedback? Help us improve.