🚀 MathGenie:通过问题回译生成合成数据以增强大语言模型的数学推理能力
MathGenie是一个用于论文 "MathGenie: Generating Synthetic Data with Question Back-translation for Enhancing Mathematical Reasoning of LLMs" 的模型。该模型旨在通过问题回译生成合成数据,从而增强大语言模型(LLMs)的数学推理能力。
📢 最新消息
✨ 主要特性
大语言模型(LLMs)在数学推理方面展现出了巨大的潜力。然而,现有的开源模型在这一领域的表现与GPT - 4等闭源模型之间仍存在差距。
在本文中,我们引入了 MathGenie,这是一种从小规模问题 - 解决方案数据集(称为 种子数据)中生成多样化且可靠数学问题的新方法。我们对种子数据的真实解决方案进行增强,并训练一个回译模型,将增强后的解决方案回译为新的问题。随后,我们为这些新问题生成集成代码的解决方案。为确保集成代码解决方案的正确性,我们采用基于推理的策略进行解决方案验证。
我们在新整理的数据上训练了从7B到70B的各种预训练模型,以测试所提出的增强技术的有效性,得到了一系列名为 MathGenieLM 的模型。这些模型在五个具有代表性的数学推理数据集上始终优于以往的开源模型,达到了当前的最优性能。特别是,MathGenieLM - InternLM2在GSM8K上的准确率达到了87.7%,在MATH上达到了55.7%,在开源语言模型中获得了最佳的整体得分。
更多详细信息可参考 项目主页 和 论文。
💻 使用示例
模型
我们的 MathGenie - InterLM - 20B 模型和 MathGenie - Mixtral - 8x7B 模型现已在Huggingface上可用。
推理与评估
模板
{% for message in messages %}
{% if message['role'] == 'user' %}
{{ '<|user|>' }}{% elif message['role'] == 'system' %}
{{ '<|system|>' }}{% elif message['role'] == 'assistant' %}
{{ '<|assistant|>' }}{% endif %}
{% for block in message['content'] %}
{% if block['type'] == 'text' %}
{{ '<|text|>' }}{% elif block['type'] == 'code' %}
{{ '<|code|>' }}{% elif block['type'] == 'execution' %}
{{ '<|execution|>' }}{% endif %}
{{ block['content'] + '<|endofblock|>' }}{% endfor %}
{{ '<|endofmessage|>' }}{% endfor %}
有关我们的MathGenieLM模型推理和评估的详细代码,请参考 MathCoder仓库。
📖 引用
如果您发现本文对您的研究有帮助,请引用以下BibTex:
@misc{lu2024mathgenie,
title={MathGenie: Generating Synthetic Data with Question Back-translation for Enhancing Mathematical Reasoning of LLMs},
author={Zimu Lu and Aojun Zhou and Houxing Ren and Ke Wang and Weikang Shi and Junting Pan and Mingjie Zhan and Hongsheng Li},
year={2024},
eprint={2402.16352},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
@inproceedings{
wang2024mathcoder,
title={MathCoder: Seamless Code Integration in {LLM}s for Enhanced Mathematical Reasoning},
author={Ke Wang and Houxing Ren and Aojun Zhou and Zimu Lu and Sichun Luo and Weikang Shi and Renrui Zhang and Linqi Song and Mingjie Zhan and Hongsheng Li},
booktitle={The Twelfth International Conference on Learning Representations},
year={2024},
url={https://openreview.net/forum?id=z8TW0ttBPp}
}
📄 许可证
本项目采用Apache - 2.0许可证。