🚀 Mamba-7B
このモデルは、Mambaアーキテクチャを持つ70億パラメータのモデルで、RefinedWebデータセットの複数エポック(1.2兆トークン)で訓練されています。Mambaは、標準的なTransformerアーキテクチャとは異なり、自己注意機構を使用しない状態空間モデルです。様々な自然言語ベンチマークで高い性能を示しています。現在までに公開されている最大の純粋なMamba事前学習モデルはMamba-2.8Bです。私たちは彼らの訓練方法を参考に、Mamba-7Bのバージョンを公開しています。
このモデルは、論文Linearizing Large Language Modelsのベースラインとして訓練されました。
🚀 クイックスタート
このモデルは、OpenLMを使用して訓練されています。重みはHuggingFaceと互換性があるように変換されています。
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("tri-ml/mamba-7b-rw")
model = AutoModelForCausalLM.from_pretrained("tri-ml/mamba-7b-rw")
inputs = tokenizer(["The Toyota Supra"], return_tensors="pt")
gen_kwargs = {"max_new_tokens": 50, "top_p": 0.8, "temperature": 0.8, "do_sample": True, "repetition_penalty": 1.1}
output = model.generate(inputs['input_ids'], **gen_kwargs)
output = tokenizer.decode(output[0].tolist(), skip_special_tokens=True)
print(output)
✨ 主な機能
- Mambaアーキテクチャを採用し、自己注意機構を使用せずに高い性能を発揮します。
- 複数の自然言語ベンチマークで良好な結果を示しています。
📚 ドキュメント
モデルの詳細
パラメータ |
隠れ層サイズ |
レイヤー数 |
語彙サイズ |
シーケンス長 |
7B |
4096 |
64 |
50432 |
2048 |
訓練の詳細
- Mamba-7Bは、AWS SageMakerを使用して128台のH100 80GB GPUで訓練されました。
- 訓練は2024年3月に開始され、3週間続きました。
ハイパーパラメータ |
値 |
精度 |
bfloat16 |
オプティマイザー |
AdamW |
学習率 |
3e-4 |
LR冷却終了値 |
1e-5 |
ウォームアップステップ |
2000 |
Z損失 |
1e-4 |
バッチサイズ |
2M |
性能評価
評価は、Eleuther LM Eval Harnessリポジトリを使用して行われました。
以下に、Mamba 7Bと他のベースモデルの性能を比較して報告します。
|
HellaSwag |
PIQA |
Winogrande |
ARC-E |
ARC-C |
MMLU (5-shot) |
Mamba-1.4B |
59.0 |
73.9 |
61.4 |
65.5 |
32.9 |
25.2 |
Mamba-2.8B |
71.0 |
78.1 |
65.9 |
68.2 |
41.7 |
26.2 |
RWKV5-1.7T-7B |
73.0 |
78.6 |
72.9 |
75.8 |
45.6 |
34.9 |
Llama2-7B |
76.0 |
79.1 |
69.1 |
76.3 |
46.3 |
45.9 |
Gemma-7B |
80.7 |
81.9 |
73.7 |
81.1 |
53.2 |
62.9 |
Mistral-7B |
81.0 |
82.1 |
74.0 |
80.9 |
53.8 |
62.4 |
Mamba-7B |
77.9 |
81.0 |
71.8 |
77.5 |
46.7 |
33.3 |
🔧 技術詳細
- Mambaアーキテクチャは、自己注意機構を使用せずに高い性能を達成します。
- AWS SageMakerを使用して128台のH100 80GB GPUで訓練され、3週間で訓練が完了しました。
📄 ライセンス
このモデルはApache License, Version 2.0の下でライセンスされています。
引用方法
このモデルを使用する場合は、論文Linearizing Large Language Modelsを引用してください。
@article{Mercat2024Linearizing,
title={Linearizing Large Language Models},
author={Jean Mercat and Igor Vasiljevic and Sedrick Keh and Kushal Arora and Achal Dave and Adrien Gaidon and Thomas Kollar},
journal={arXiv preprint arXiv:2405.06640},
year={2024}
}
その他の引用
Mamba
@article{mamba,
title={Mamba: Linear-Time Sequence Modeling with Selective State Spaces},
author={Gu, Albert and Dao, Tri},
journal={arXiv preprint arXiv:2312.00752},
year={2023}
}
OpenLM
@misc{open_lm,
author = {Gururangan, Suchin and Wortsman, Mitchell and Gadre, Samir Yitzhak and Dave, Achal and Kilian, Maciej and Shi, Weijia and Mercat, Jean and Smyrnis, Georgios and Ilharco, Gabriel and Jordan, Matt and Heckel, Reinhard and Dimakis, Alex and Farhadi, Ali and Shankar, Vaishaal and Schmidt, Ludwig},
title = {{open_lm}: a minimal but performative language modeling (LM) repository},
year = {2023},
note = {GitHub repository},
url = {https://github.com/mlfoundations/open_lm/}
}