🚀 MetaMath-Mistral-7B
MetaMath-Mistral-7B 是基于强大的 Mistral-7B 模型,在 MetaMathQA 数据集上进行全量微调的模型。该模型显著提升了在 GSM8K 等数学问答任务上的表现,为数学领域的大语言模型应用带来新的突破。
🚀 快速开始
你可以通过以下链接查看项目的相关信息:
✨ 主要特性
- 数据来源可靠:所有 MetaMathQA 数据均从 GSM8K 和 MATH 的训练集扩充而来,无测试集数据。
- 性能显著提升:使用 MetaMathQA 数据集并将基础模型从 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
💻 使用示例
基础用法
提示模板如下:
"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}
。
高级用法
还有一个关于 Arithmo-Mistral-7B 的有趣仓库:https://huggingface.co/akjindal53244/Arithmo-Mistral-7B,他们结合了 MetaMathQA 数据集和 MathInstruct 数据集训练了一个强大的模型。我们也将尝试使用 MetaMathQA 和 MathInstruct 数据集的组合进行训练,并公开所有结果和训练细节。
📚 详细文档
注意事项
- 所有 MetaMathQA 数据均从 GSM8K 和 MATH 的训练集扩充而来,无任何扩充数据来自测试集。你可以查看
meta-math/MetaMathQA
中的 original_question
,每个项目都来自 GSM8K 或 MATH 训练集。
模型详情
MetaMath-Mistral-7B 在 MetaMathQA 数据集上进行全量微调,基于 Mistral-7B 模型。为了微调 Mistral-7B,建议使用较小的学习率(通常是 LlaMa-2-7B 学习率的 1/5 到 1/10),并保持其他训练参数不变。更多训练细节和脚本可查看:https://github.com/meta-math/MetaMath。
实验结果
模型 |
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 |
📄 许可证
本项目使用 Apache-2.0 许可证。
🔧 技术细节
数据集
属性 |
详情 |
模型类型 |
MetaMath-Mistral-7B 是基于 Mistral-7B 微调的模型 |
训练数据 |
meta-math/MetaMathQA 数据集,数据从 GSM8K 和 MATH 训练集扩充而来 |
引用信息
@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}
}
⚠️ 重要提示
所有 MetaMathQA 数据均从 GSM8K 和 MATH 的训练集扩充而来,无测试集数据。
💡 使用建议
微调 Mistral-7B 时,建议使用较小的学习率(通常是 LlaMa-2-7B 学习率的 1/5 到 1/10),并保持其他训练参数不变。