🚀 AceReason-Nemotron:通过强化学习提升数学和代码推理能力
AceReason-Nemotron-14B是一个专注于数学和代码推理的模型,它基于DeepSeek-R1-Distilled-Qwen-14B,完全通过强化学习(RL)进行训练。该模型表现出色,在多个基准测试中取得了显著的成绩,如在AIME 2024中达到78.6%(提升8.9%),在AIME 2025中达到67.4%(提升17.4%)等。通过大量实验,研究团队系统地研究了RL训练过程,并提出了一种简单有效的方法:先对纯数学提示进行RL训练,再对纯代码提示进行RL训练。研究发现,纯数学RL不仅能显著提升强蒸馏模型在数学基准测试中的表现,还能提升代码推理任务的性能;而扩展的纯代码RL在进一步提高代码基准测试性能的同时,对数学结果的影响极小。

✨ 主要特性
- 强化学习训练:完全基于强化学习进行训练,从DeepSeek-R1-Distilled-Qwen-14B模型开始,挖掘模型在预训练和监督微调阶段获得的基础推理能力,并突破其推理极限。
- 卓越性能表现:在多个数学和代码基准测试中取得显著提升,如AIME 2024、AIME 2025、LiveCodeBench v5和v6等。
- 有效训练方法:提出先对纯数学提示进行RL训练,再对纯代码提示进行RL训练的方法,能有效提升模型在数学和代码推理任务中的性能。
📦 安装指南
文档未提及安装步骤,暂不提供。
💻 使用示例
基础用法
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = 'nvidia/AceReason-Nemotron-14B'
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=32768,
temperature=0.6,
top_p=0.95
)
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]
高级用法
文档未提及高级用法代码示例,暂不提供。
📚 详细文档
结果展示
研究团队将该模型与Qwen2.5和Llama3.1模型家族中规模相当的竞争推理模型,在AIME 2024、AIME 2025、LiveCodeBench v5(2024/08/01 - 2025/02/01)和LiveCodeBench v6(2025/02/01 - 2025/05/01)上进行了评估。更多评估结果可在技术报告中查看。
模型 |
AIME 2024 (avg@64) |
AIME 2025 (avg@64) |
LCB v5 (avg@8) |
LCB v6 (avg@8) |
QwQ - 32B |
79.5 |
65.8 |
63.4 |
- |
DeepSeek - R1 - 671B |
79.8 |
70.0 |
65.9 |
- |
Llama - Nemotron - Ultra - 253B |
80.8 |
72.5 |
66.3 |
- |
o3 - mini (medium) |
79.6 |
76.7 |
67.4 |
- |
Light - R1 - 14B |
74 |
60.2 |
57.9 |
51.5 |
DeepCoder - 14B (32K Inference) |
71 |
56.1 |
57.9 |
50.4 |
OpenMath - Nemotron - 14B |
76.3 |
63.0 |
- |
- |
OpenCodeReasoning - Nemotron - 14B |
- |
- |
59.4 |
54.1 |
Llama - Nemotron - Super - 49B - v1 |
67.5 |
60.0 |
45.5 |
- |
DeepSeek - R1 - Distilled - Qwen - 14B |
69.7 |
50.2 |
53.1 |
47.9 |
DeepSeek - R1 - Distilled - Qwen - 32B |
72.6 |
54.9 |
57.2 |
- |
AceReason - Nemotron - 14B 🤖 |
78.6 |
67.4 |
61.1 |
54.9 |
使用建议
- 不要包含系统提示,而是将所有指令直接放在用户提示中。
- 对于数学问题,建议使用以下指令:请逐步推理,并将最终答案放在 \boxed{} 内。
- 对于代码问题,建议使用以下指令:编写Python代码来解决问题。请将解决方案代码放在以下格式中:
联系方式
- Yang Chen (yachen@nvidia.com)
- Zhuolin Yang (zhuoliny@nvidia.com)
- Zihan Liu (zihanl@nvidia.com)
- Chankyu Lee (chankyul@nvidia.com)
- Wei Ping (wping@nvidia.com)
🔧 技术细节
研究团队在技术报告中分享了训练方法和训练日志。
📄 许可证
本模型的使用受 NVIDIA Open Model License 约束。
引用格式
@article{acereason2025,
title={AceReason-Nemotron: Advancing Math and Code Reasoning through Reinforcement Learning},
author={Chen, Yang and Yang, Zhuolin and Liu, Zihan and Lee, Chankyu and Shoeybi, Mohammad and Catanzaro, Bryan and Ping, Wei},
journal={arXiv preprint},
year={2025}
}