Home

Awesome

JetMoE: Reaching LLaMA2 Performance with 0.1M Dollars

<div align="center"> <div>&nbsp;</div> <img src="https://github.com/myshell-ai/JetMoE/assets/40556743/202f61a4-f2fa-4983-bcda-027478139e00" width="500"/> <img src="resources/2-performance.png" width="530"/> </div>

Key Messages

  1. JetMoE-8B is trained with less than $ 0.1 million<sup>1</sup> cost but outperforms LLaMA2-7B from Meta AI, who has multi-billion-dollar training resources. LLM training can be much cheaper than people previously thought.

  2. JetMoE-8B is fully open-sourced and academia-friendly because:

    • It only uses public datasets for training, and the code is open-sourced. No proprietary resource is needed.
    • It can be finetuned with very limited compute budget (e.g., consumer-grade GPU) that most labs can afford.
  3. JetMoE-8B only has 2.2B active parameters during inference, which drastically lowers the computational cost. Compared to a model with similar inference computation, like Gemma-2B, JetMoE-8B achieves constantly better performance.

<sup>1</sup> We used a 96×H100 GPU cluster for 2 weeks, which cost ~$0.08 million.

Website: https://research.myshell.ai/jetmoe

HuggingFace: https://huggingface.co/jetmoe/jetmoe-8b

Online Demo on Lepton AI: https://www.lepton.ai/playground/chat?model=jetmoe-8b-chat

Technical Report: https://arxiv.org/pdf/2404.07413.pdf

Authors

The project is contributed by Yikang Shen, Zhen Guo, Tianle Cai and Zengyi Qin. For technical inquiries, please contact Yikang Shen. For media and collaboration inquiries, please contact Zengyi Qin.

Collaboration

If you have great ideas but need more resources (GPU, data, funding, etc.), welcome to contact MyShell.ai via Zengyi Qin. MyShell.ai is open to collaborations and are actively supporting high-quality open-source projects.

Benchmarks

We use the same evaluation methodology as in the Open LLM leaderboard. For MBPP code benchmark, we use the same evaluation methodology as in the LLaMA2 and Deepseek-MoE paper. The results are shown below:

ModelActivate ParamsTraining TokensOpen LLM Leaderboard AvgARCHellaswagMMLUTruthfulQAWinoGrandeGSM8kMBPPHumanEval
Shot2510505530
Metricacc_normacc_normaccmc2accaccPass@1Pass@1
LLaMA2-7B7B2T51.053.178.646.938.87414.520.812.8
LLaMA-13B13B1T51.456.280.947.739.576.27.622.015.8
DeepseekMoE-16B2.8B2T51.153.279.846.336.173.717.334.025.0
Gemma-2B2B2T46.448.471.841.833.166.316.928.024.4
JetMoE-8B2.2B1.25T53.048.780.549.241.770.227.834.214.6
ModelMT-Bench Score
GPT-49.014
GPT-3.5-turbo7.995
Claude-v17.923
JetMoE-8B-chat6.681
Llama-2-13b-chat6.650
Vicuna-13b-v1.36.413
Wizardlm-13b6.353
Llama-2-7b-chat6.269

To our surprise, despite the lower training cost and computation, JetMoE-8B performs even better than LLaMA2-7B, LLaMA-13B, and DeepseekMoE-16B. Compared to a model with similar training and inference computation, like Gemma-2B, JetMoE-8B achieves better performance.

Model Usage

To load the models, you need install this package:

pip install -e .

Then you can load the model with the following code:

from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig, AutoModelForSequenceClassification
from jetmoe import JetMoEForCausalLM, JetMoEConfig, JetMoEForSequenceClassification

AutoConfig.register("jetmoe", JetMoEConfig)
AutoModelForCausalLM.register(JetMoEConfig, JetMoEForCausalLM)
AutoModelForSequenceClassification.register(JetMoEConfig, JetMoEForSequenceClassification)

tokenizer = AutoTokenizer.from_pretrained('jetmoe/jetmoe-8b')
model = AutoModelForCausalLM.from_pretrained('jetmoe/jetmoe-8b')

Model Details

Please refer to the technical report https://arxiv.org/pdf/2404.07413.pdf for model details and training details.

Acknowledgement

We express our gratitude to Shengding Hu for his valuable advice on the Phase 2 data mixture. We also express our gratitude to Exabits for their assistance in setting up the GPU clusters.