# JetMoE

<figure><img src="/files/ju8JkH8vdpO5xGX3XdOR" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/OlFWwZAYLgwdmHx6wYac" alt="" width="375"><figcaption></figcaption></figure>

[GitHub](https://github.com/myshell-ai/JetMoE) / [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)

JetMoE-8B는 0.1백만 달러(\*) 미만의 비용으로 훈련되었으며, 수십억 달러의 훈련 자원을 보유한 Meta AI의 LLaMA2-7B를 능가합니다. LLM 훈련이 이전에 생각했던 것보다 훨씬 저렴할 수 있다는 것을 보여줍니다.

이는 완전히 오픈소스이며 학계 친화적인 모델입니다. 이유는 다음과 같습니다:

* 훈련에 공개 데이터셋만 사용되며, 코드는 오픈소스입니다. 독점 자원은 필요 없습니다.
* 소비자급 GPU와 같은 매우 제한된 컴퓨팅 예산으로 미세 조정이 가능하며, 대부분의 연구실에서 감당할 수 있습니다.

JetMoE-8B는 추론 시 2.2B의 활성 매개변수만을 가지며, 이는 계산 비용을 크게 낮춥니다. 유사한 추론 계산을 요구하는 모델(예: Gemma-2B)과 비교했을 때, JetMoE-8B는 지속적으로 더 나은 성능을 달성합니다.

(\*) 우리는 96×H100 GPU 클러스터를 2주 동안 사용했으며, 비용은 약 0.08백만 달러였습니다.

<figure><img src="/files/uK7hNJYjVcIJ2Az6g2VZ" alt=""><figcaption></figcaption></figure>

## 벤치마크

우리는 Open LLM 리더보드에서와 동일한 평가 방법론을 사용합니다. MBPP 코드 벤치마크의 경우 LLaMA2와 Deepseek-MoE 논문에서 사용된 동일한 평가 방법론을 따릅니다. 결과는 아래에 표시됩니다:

| Model           | Activate Params | Training Tokens | Open LLM Leaderboard Avg | ARC       | Hellaswag | MMLU     | TruthfulQA | WinoGrande | GSM8k    | MBPP     | HumanEval |
| --------------- | --------------- | --------------- | ------------------------ | --------- | --------- | -------- | ---------- | ---------- | -------- | -------- | --------- |
| Shot            |                 |                 |                          | 25        | 10        | 5        | 0          | 5          | 5        | 3        | 0         |
| Metric          |                 |                 |                          | acc\_norm | acc\_norm | acc      | mc2        | acc        | acc      | Pass\@1  | Pass\@1   |
| LLaMA2-7B       | 7B              | 2T              | 51.0                     | 53.1      | 78.6      | 46.9     | 38.8       | 74         | 14.5     | 20.8     | 12.8      |
| LLaMA-13B       | 13B             | 1T              | 51.4                     | **56.2**  | **80.9**  | 47.7     | 39.5       | **76.2**   | 7.6      | 22.0     | 15.8      |
| DeepseekMoE-16B | 2.8B            | 2T              | 51.1                     | 53.2      | 79.8      | 46.3     | 36.1       | 73.7       | 17.3     | 34.0     | **25.0**  |
| Gemma-2B        | 2B              | 2T              | 46.4                     | 48.4      | 71.8      | 41.8     | 33.1       | 66.3       | 16.9     | 28.0     | 24.4      |
| JetMoE-8B       | 2.2B            | 1.25T           | **53.0**                 | 48.7      | 80.5      | **49.2** | **41.7**   | 70.2       | **27.8** | **34.2** | 14.6      |

| Model              | MT-Bench Score |
| ------------------ | -------------- |
| GPT-4              | 9.014          |
| GPT-3.5-turbo      | 7.995          |
| Claude-v1          | 7.923          |
| **JetMoE-8B-chat** | **6.681**      |
| Llama-2-13b-chat   | 6.650          |
| Vicuna-13b-v1.3    | 6.413          |
| Wizardlm-13b       | 6.353          |
| Llama-2-7b-chat    | 6.269          |

놀랍게도, 더 낮은 훈련 비용과 계산 자원에도 불구하고 JetMoE-8B는 LLaMA2-7B, LLaMA-13B, DeepseekMoE-16B보다 더 나은 성능을 보입니다. 유사한 훈련 및 추론 계산을 요구하는 모델(예: Gemma-2B)과 비교했을 때, JetMoE-8B는 더 나은 성능을 달성합니다.

## 모델 사용

모델을 로드하려면 다음 패키지를 설치해야 합니다:

```
pip install -e .
```

그런 다음 다음 코드를 사용해 모델을 로드할 수 있습니다:

```
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')
```

## 모델 세부 사항

모델 세부 사항 및 훈련 세부 사항은 기술 보고서 [https://arxiv.org/pdf/2404.07413.pdf를](https://arxiv.org/pdf/2404.07413.pdf) 참조하세요.&#x20;

## 협업

훌륭한 아이디어가 있지만 더 많은 자원(GPU, 데이터, 자금 등)이 필요하다면, [Zengyi Qin](https://www.qinzy.tech/) 을 통해 MyShell.ai에 연락해 주세요. MyShell.ai는 협업에 열려 있으며, 고품질 오픈소스 프로젝트를 적극적으로 지원하고 있습니다.&#x20;

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.myshell.ai/ko/technology/jetmoe.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
