🚀 AceMath:前沿數學推理模型
AceMath 是一系列專為數學推理設計的前沿模型。AceMath 家族的模型,包括 AceMath - 1.5B/7B/72B - Instruct 和 AceMath - 7B/72B - RM,基於 Qwen 進行了改進。AceMath - 1.5B/7B/72B - Instruct 模型擅長使用思維鏈(CoT)推理解決英文數學問題,而 AceMath - 7B/72B - RM 模型作為結果獎勵模型,專門用於評估和評分數學解決方案。
🚀 快速開始
AceMath 模型可用於解決數學問題,若需支持其他任務,我們還發布了 AceInstruct - 1.5B/7B/72B 系列通用監督微調(SFT)模型,可處理代碼、數學和通用知識任務。這些模型基於 Qwen2.5 - 1.5B/7B/72B - Base 構建。
✨ 主要特性
- 強大的數學推理能力:AceMath - 1.5B/7B/72B - Instruct 模型在多種數學推理基準測試中表現出色,如 AceMath - 7B - Instruct 在平均通過率@1 上大幅超過之前同類最佳的 Qwen2.5 - Math - 7B - Instruct(67.2 對比 62.9),接近 10 倍規模的 Qwen2.5 - Math - 72B - Instruct(67.2 對比 68.2)。AceMath - 72B - Instruct 更是超越了最先進的 Qwen2.5 - Math - 72B - Instruct(71.8 對比 68.2)、GPT - 4o(67.4)和 Claude 3.5 Sonnet(65.6)。
- 專業的獎勵模型:AceMath - 7B/72B - RM 作為結果獎勵模型,可對數學解決方案進行評估和評分,其 AceMath - 72B - RM 在推理基準測試中創下了 rm@8 準確率(8 選最佳)的新紀錄。
- 多階段監督微調:AceMath - 1.5B/7B/72B - Instruct 模型基於 Qwen2.5 - Math - 1.5B/7B/72B - Base 模型開發,採用多階段監督微調(SFT)過程,先使用通用 SFT 數據,再使用特定數學 SFT 數據。
📦 安裝指南
文檔未提供安裝步驟,暫不展示。
💻 使用示例
基礎用法
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "nvidia/AceMath-72B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
prompt = "Jen enters a lottery by picking $4$ distinct numbers from $S=\\{1,2,3,\\cdots,9,10\\}.$ $4$ numbers are randomly chosen from $S.$ She wins a prize if at least two of her numbers were $2$ of the randomly chosen numbers, and wins the grand prize if all four of her numbers were the randomly chosen numbers. The probability of her winning the grand prize given that she won a prize is $\\tfrac{m}{n}$ where $m$ and $n$ are relatively prime positive integers. Find $m+n$."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to("cuda")
generated_ids = model.generate(
**model_inputs,
max_new_tokens=2048
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
📚 詳細文檔
所有資源
AceMath 指令模型
AceMath 獎勵模型
評估與訓練數據
通用指令模型
基準測試結果
我們將 AceMath 與領先的專有和開放訪問數學模型進行了比較。在各種數學推理基準測試中,我們的 AceMath - 7B - Instruct 大幅優於之前同類最佳的 Qwen2.5 - Math - 7B - Instruct(平均通過率@1:67.2 對比 62.9),接近 10 倍規模的 Qwen2.5 - Math - 72B - Instruct(67.2 對比 68.2)。值得注意的是,我們的 AceMath - 72B - Instruct 大幅超越了最先進的 Qwen2.5 - Math - 72B - Instruct(71.8 對比 68.2)、GPT - 4o(67.4)和 Claude 3.5 Sonnet(65.6)。我們還報告了我們的獎勵模型 AceMath - 72B - RM 實現的 rm@8 準確率(8 選最佳),這在這些推理基準測試中創下了新紀錄。這不包括依賴大規模推理計算的 OpenAI 的 o1 模型。
聯繫方式
Zihan Liu (zihanl@nvidia.com)
Yang Chen (yachen@nvidia.com)
Wei Ping (wping@nvidia.com)
引用
如果您認為我們的工作有幫助,請引用我們:
@article{acemath2024,
title={AceMath: Advancing Frontier Math Reasoning with Post-Training and Reward Modeling},
author={Liu, Zihan and Chen, Yang and Shoeybi, Mohammad and Catanzaro, Bryan and Ping, Wei},
journal={arXiv preprint},
year={2024}
}
📄 許可證
AceMath 家族的所有模型僅用於非商業用途,需遵守 OpenAI 生成數據的使用條款。我們將 AceMath 模型置於知識共享署名 - 非商業性使用 4.0 國際許可協議之下。