🚀 MetaMath-Mistral-7B
MetaMath-Mistral-7Bは、MetaMathQAデータセットを用いて完全にファインチューニングされたモデルです。強力なMistral-7Bモデルをベースに構築され、数学的な質問応答タスクで高い性能を発揮します。
🚀 クイックスタート
本プロジェクトの詳細については、以下のリンクを参照してください。
✨ 主な機能
- MetaMath-Mistral-7BはMetaMathQAデータセットで完全にファインチューニングされており、GSM8Kの性能を向上させます。
- ベースモデルをllama-2-7BからMistral-7Bに変更することで、GSM8Kの性能が66.5から77.7に向上しました。
📦 インストール
必要なパッケージをインストールするには、以下のコマンドを実行してください。
pip install transformers==4.35.0
pip install torch==2.0.1
pip install sentencepiece==0.1.99
pip install tokenizers==0.13.3
pip install accelerate==0.21.0
pip install bitsandbytes==0.40.0
pip install vllm
pip install fraction
pip install protobuf
📚 ドキュメント
注意事項
すべてのMetaMathQAデータは、GSM8KとMATHのトレーニングセットから拡張されています。拡張データのいずれもテストセットからは取得されていません。
meta-math/MetaMathQA
の original_question
を確認すると、各項目がGSM8KまたはMATHのトレーニングセットに由来することがわかります。
モデルの詳細
MetaMath-Mistral-7Bは、MetaMathQAデータセットで完全にファインチューニングされ、強力なMistral-7Bモデルをベースにしています。MetaMathQAデータセットを使用し、ベースモデルをllama-2-7BからMistral-7Bに変更することで、GSM8Kの性能が66.5から77.7に向上したことが確認されました。
Mistral-7Bをファインチューニングする際には、学習率を小さく設定することをおすすめします(通常、LlaMa-2-7Bの学習率の1/5から1/10)。その他のトレーニング引数は変更しないでください。
より詳細なトレーニング情報やスクリプトは、https://github.com/meta-math/MetaMath を参照してください。
モデルの使用方法
プロンプトテンプレートは以下の通りです。
"Below is an instruction that describes a task. "
"Write a response that appropriately completes the request.\n\n"
"### Instruction:\n{instruction}\n\n### Response: Let's think step by step."
{instruction}
の部分には、クエリの質問を入力してください。
また、https://huggingface.co/akjindal53244/Arithmo-Mistral-7B では、MetaMathQAデータセットとMathInstructデータセットを組み合わせて強力なモデルを学習させています。彼らの貢献に感謝いたします。
当方も、MetaMathQA と MathInstruct データセットの組み合わせで学習を試み、結果とトレーニングの詳細を公開する予定です。
実験結果
モデル |
GSM8k Pass@1 |
MATH Pass@1 |
MPT-7B |
6.8 |
3.0 |
Falcon-7B |
6.8 |
2.3 |
LLaMA-1-7B |
11.0 |
2.9 |
LLaMA-2-7B |
14.6 |
2.5 |
MPT-30B |
15.2 |
3.1 |
LLaMA-1-13B |
17.8 |
3.9 |
GPT-Neo-2.7B |
19.5 |
-- |
Falcon-40B |
19.6 |
2.5 |
Baichuan-chat-13B |
23.9 |
-- |
Vicuna-v1.3-13B |
27.6 |
-- |
LLaMA-2-13B |
28.7 |
3.9 |
InternLM-7B |
31.2 |
-- |
ChatGLM-2-6B |
32.4 |
-- |
GPT-J-6B |
34.9 |
-- |
LLaMA-1-33B |
35.6 |
3.9 |
LLaMA-2-34B |
42.2 |
6.24 |
RFT-7B |
50.3 |
-- |
LLaMA-1-65B |
50.9 |
10.6 |
Qwen-7B |
51.6 |
-- |
WizardMath-7B |
54.9 |
10.7 |
LLaMA-2-70B |
56.8 |
13.5 |
WizardMath-13B |
63.9 |
14.0 |
MAmmoTH-7B (COT) |
50.5 |
10.4 |
MAmmoTH-7B (POT+COT) |
53.6 |
31.5 |
Arithmo-Mistral-7B |
74.7 |
25.3 |
MetaMath-7B |
66.5 |
19.8 |
MetaMath-13B |
72.3 |
22.4 |
🔥 MetaMath-Mistral-7B |
77.7 |
28.2 |
引用
@article{yu2023metamath,
title={MetaMath: Bootstrap Your Own Mathematical Questions for Large Language Models},
author={Yu, Longhui and Jiang, Weisen and Shi, Han and Yu, Jincheng and Liu, Zhengying and Zhang, Yu and Kwok, James T and Li, Zhenguo and Weller, Adrian and Liu, Weiyang},
journal={arXiv preprint arXiv:2309.12284},
year={2023}
}
@article{jiang2023mistral,
title={Mistral 7B},
author={Jiang, Albert Q and Sablayrolles, Alexandre and Mensch, Arthur and Bamford, Chris and Chaplot, Devendra Singh and Casas, Diego de las and Bressand, Florian and Lengyel, Gianna and Lample, Guillaume and Saulnier, Lucile and others},
journal={arXiv preprint arXiv:2310.06825},
year={2023}
}
📄 ライセンス
本プロジェクトは、Apache-2.0ライセンスの下で公開されています。