基于Llama-3.1开发的推理模型,经NAS优化提升效率,支持RAG、工具调用等任务,多阶段训练增强推理与对话能力,适用于AI代理、聊天机器人等应用。【此简介由AI生成】
library_name: transformers license: other license_name: nvidia-open-model-license license_link: >- https://www.nvidia.com/en-us/agreements/enterprise-software/nvidia-open-model-license/
pipeline_tag: text-generation language:
- en tags:
- nvidia
- llama-3
- pytorch
Llama-3.1-Nemotron-Ultra-253B-v1
模型概述

Llama-3.1-Nemotron-Ultra-253B-v1 是基于 Meta Llama-3.1-405B-Instruct(又称参考模型)衍生开发的大型语言模型(LLM)。该模型专为推理任务、人类对话偏好以及 RAG 和工具调用等场景进行后训练优化,支持 128K token 的上下文长度,可在单台 8xH100 节点上完成推理部署。
本模型在精度与效率之间实现了卓越平衡。效率(吞吐量)的提升直接转化为成本节约——通过创新的神经架构搜索(NAS)技术,我们显著降低了模型内存占用,既能承载更大规模工作负载,又减少了数据中心运行所需的 GPU 数量。这种 NAS 方法支持在精度-效率权衡曲线上自由选择最优解。此外,采用突破性的纵向压缩技术(详见本研究论文),模型在延迟性能上也获得显著提升。
该模型经过多阶段后训练过程,同步增强其推理与非推理能力。训练流程包括针对数学、代码、推理、对话及工具调用的监督微调阶段,以及运用群体相对策略优化(GRPO)算法进行的多轮强化学习(RL)阶段,覆盖推理、对话和指令遵循三大维度。
本模型已开放商业使用许可。

本模型属于 Llama Nemotron 系列产品,该系列其他模型包括:
许可证/使用条款
管辖条款:您对本模型的使用受《NVIDIA 开放模型许可证》约束。附加信息请参阅《Llama 3.1 社区许可协议》。基于 Llama 构建。
模型开发商: NVIDIA
模型训练时间: 2024年11月至2025年4月期间训练
数据新鲜度: 预训练数据截止时间根据 Llama-3.1-405B-Instruct 设定为2023年
适用场景:
适用于设计AI智能体系统、聊天机器人、RAG系统及其他AI驱动应用的开发者,同时适合典型的指令跟随任务。
发布日期:
2025年4月7日
参考文献
- [2505.00949] Llama-Nemotron:高效推理模型
- [2502.00203] 奖励感知偏好优化:模型对齐的统一数学框架
- [2411.19146] Puzzle:基于蒸馏的神经网络架构搜索实现推理优化大语言模型
- [2503.18908] FFN融合:重新思考大语言模型中的序列计算
模型架构
架构类型: 密集型仅解码器Transformer模型
网络架构: 基于Llama-3.1-405B-Instruct,通过神经架构搜索(NAS)定制化开发
本模型基于Llama-3.1-405B-Instruct开发
模型参数量:2530亿
该模型是Llama 3.1-405B-Instruct的衍生版本,采用神经架构搜索(NAS)技术。NAS算法产生了非标准化且非重复的模块结构,具体包括:
- 跳跃注意力机制:部分模块完全跳过注意力计算,或使用单一线性层替代
- 可变前馈网络:不同模块中前馈网络的扩展/压缩比率存在差异
- FFN融合:当连续多个注意力层被跳过时(可能形成多个FFN串联序列),该序列会被融合为数量更少但宽度更大的FFN层
针对参考模型的每个模块,我们创建了多种变体以平衡质量与计算复杂度(下文将深入探讨)。通过模块搜索构建出在满足吞吐量和内存要求的同时最大限度降低质量损失的模型。为恢复性能,模型首先进行了650亿个token的知识蒸馏(KD),随后进行了880亿个token的持续预训练(CPT)阶段。
用途说明
Llama-3.1-Nemotron-Ultra-253B-v1 是一款通用推理与对话模型,主要适用于英语及编程语言场景,同时支持德语、法语、意大利语、葡萄牙语、印地语、西班牙语和泰语等其他非英语语言。
输入规范
- 输入类型: 文本
- 输入格式: 字符串
- 输入参数: 一维(1D)
- 其他输入相关属性: 上下文长度最高支持 131,072 个标记
输出规范
- 输出类型: 文本
- 输出格式: 字符串
- 输出参数: 一维(1D)
- 其他输出相关属性: 上下文长度最高支持 131,072 个标记
软件集成
- 运行引擎: Transformers
- 推荐硬件微架构兼容性:
- NVIDIA Hopper
- NVIDIA Ampere
- 首选操作系统: Linux
模型版本
1.0 (2025年4月7日)
快速开始与使用建议:
- 推理模式(开启/关闭)通过系统提示词控制,必须按下文示例格式设置。所有指令应包含在用户提示词中
- 开启推理模式时,建议将温度值设为 `0.6`,Top P 设为 `0.95`
- 关闭推理模式时,建议使用贪婪解码(温度值 0)
- 除控制提示词外不建议添加其他系统提示词,所有指令应置于用户查询中
- 我们已为每个需要特定模板的基准测试提供了提示词列表
- 在开启推理模式下若无需推理,模型将输出
<think></think>标签,此属正常现象
您可通过预览 API 体验此模型:Llama-3_1-Nemotron-Ultra-253B-v1
Transformers 调用方式
以下代码片段展示如何通过 Hugging Face Transformers 库调用。推理模式(开启/关闭)通过系统提示词控制,请参见示例:
推荐使用 4.48.3 及以上版本的 transformers 包。
推理模式开启示例:
import torch
import transformers
model_id = "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1"
model_kwargs = {"torch_dtype": torch.bfloat16, "trust_remote_code": True, "device_map": "auto"}
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token_id = tokenizer.eos_token_id
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
tokenizer=tokenizer,
max_new_tokens=32768,
temperature=0.6,
top_p=0.95,
**model_kwargs
)
thinking = "on"
print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"},{"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
推理关闭示例:
import torch
import transformers
model_id = "nvidia/Llama-3_1-Nemotron-ULtra-253B-v1"
model_kwargs = {"torch_dtype": torch.bfloat16, "trust_remote_code": True, "device_map": "auto"}
tokenizer = transformers.AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token_id = tokenizer.eos_token_id
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
tokenizer=tokenizer,
max_new_tokens=32768,
do_sample=False,
**model_kwargs
)
thinking = "off"
print(pipeline([{"role": "system", "content": f"detailed thinking {thinking}"},{"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))
与 vLLM 配合使用
pip install vllm==0.8.3
关于如何使用 vLLM 进行服务的示例:
python3 -m vllm.entrypoints.openai.api_server \
--model "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1" \
--trust-remote-code \
--seed=1 \
--host="0.0.0.0" \
--port=5000 \
--served-model-name "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1" \
--tensor-parallel-size=8 \
--max-model-len=32768 \
--gpu-memory-utilization 0.95 \
--enforce-eager
推理部署
引擎支持:
- Transformers
测试硬件环境:
- BF16精度:
- 8×NVIDIA H100-80GB
- 4×NVIDIA B100
- FP8精度:
- 4×NVIDIA H100-80GB
训练与评估数据集
训练数据集
在后训练流程开始前的知识蒸馏阶段,我们采用了多样化的训练数据,其中包含三个重要数据集:FineWeb、Buzz-V1.2以及Dolma。
多阶段后训练流程所使用的数据整合了SFT(监督微调)和RL(强化学习)数据,旨在提升原始Llama指导模型在数学计算、编程能力、通用推理及指令遵循方面的表现。
提示词来源包括公开语料库和人工合成生成,回答内容则由多种模型自动生成。部分提示词同时包含开启与关闭推理模式的回答,以训练模型区分两种模式的能力。该模型通过Qwen技术实现了进一步优化。
为促进模型开发与改进的开放透明,我们已发布Llama-Nemotron后训练数据集。
训练数据集收集方式:
- 混合模式:自动化采集、人工收集、合成生成
训练数据集标注方式:
- 混合模式:自动化标注、人工标注、合成标注
评估数据集
我们采用下一章节列出的数据集对Llama-3.1-Nemotron-Ultra-253B-v1进行性能评估。
评估数据集收集方式:
- 混合模式:人工收集/合成生成
评估数据集标注方式:
- 混合模式:人工标注/合成标注/自动标注
评估结果
以下结果同时包含推理模式开启(Reasoning On)与关闭(Reasoning Off)状态。建议在开启推理模式时使用温度参数0.6和顶部概率0.95,关闭推理模式时采用贪婪解码。所有评估均在32k序列长度下完成。为保证准确性,每个基准测试最多运行16次并取平均值。
注意:如适用,我们将提供提示词模板。在进行基准测试时,请务必根据提供的提示词解析正确的输出格式,以确保复现下方所示的基准测试结果。
GPQA
| 推理模式 | 通过率@1 |
|---|---|
| 关闭推理功能 | 56.60 |
| 开启推理功能 | 76.01 |
用户提示模板:
"What is the correct answer to this question: {question}\nChoices:\nA. {option_A}\nB. {option_B}\nC. {option_C}\nD. {option_D}\nLet's think step by step, and put the final answer (should be a single letter A, B, C, or D) into a \boxed{}"
AIME25
| 推理模式 | 通过率@1 |
|---|---|
| 关闭推理 | 16.67 |
| 开启推理 | 72.50 |
用户提示模板:
"Below is a math question. I want you to reason through the steps and then give a final answer. Your final answer should be in \boxed{}.\nQuestion: {question}"
BFCL V2 实时数据
| 推理模式 | 得分 |
|---|---|
| 推理关闭 | 73.62 |
| 推理开启 | 74.10 |
用户提示模板:
You are an expert in composing functions. You are given a question and a set of possible functions.
Based on the question, you will need to make one or more function/tool calls to achieve the purpose.
If none of the function can be used, point it out. If the given question lacks the parameters required by the function,
also point it out. You should only return the function call in tools call sections.
If you decide to invoke any of the function(s), you MUST put it in the format of <TOOLCALL>[func_name1(params_name1=params_value1, params_name2=params_value2...), func_name2(params)]</TOOLCALL>
You SHOULD NOT include any other text in the response.
Here is a list of functions in JSON format that you can invoke.
<AVAILABLE_TOOLS>{functions}</AVAILABLE_TOOLS>
{user_prompt}
LiveCodeBench (20240801-20250201)
| 推理模式 | 通过率@1 |
|---|---|
| 关闭推理 | 29.03 |
| 开启推理 | 66.31 |
用户提示模板(不含初始代码):
"You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question: {prompt}
Read the inputs from stdin solve the problem and write the answer to stdout (do not directly test on the sample inputs). Enclose your code within delimiters as follows. Ensure that when the python program runs, it reads the inputs, runs the algorithm and writes output to STDOUT.
```python
# YOUR CODE HERE
```
用户提示模板(含起始代码):
You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.
Question: {prompt}
You will use the following starter code to write the solution to the problem and enclose your code within delimiters.
```python
{starter_code}
```
IFEval
| 推理模式 | 严格:指令遵循 |
|---|---|
| 推理关闭 | 88.85 |
| 推理开启 | 89.45 |
MATH500
| 推理模式 | 一次通过率 |
|---|---|
| 推理关闭 | 80.40 |
| 推理开启 | 97.00 |
用户提示模板:
"Below is a math question. I want you to reason through the steps and then give a final answer. Your final answer should be in \boxed{}.\nQuestion: {question}"
JudgeBench 评测基准
| 推理模式 | 知识得分 | 推理得分 | 数学得分 | 编程得分 | 综合得分 |
|---|---|---|---|---|---|
| 启用推理 | 70.13 | 81.63 | 89.29 | 92.86 | 79.14 |
伦理考量:
英伟达认为可信赖的人工智能是共同责任,我们已制定相关政策和实践方案,以支持广泛AI应用场景的开发。根据我们的服务条款下载或使用本模型时,开发人员应与其内部模型团队协作,确保该模型符合相关行业和应用场景的要求,并能应对不可预见的产品误用情况。
有关本模型伦理考量的详细信息,请参阅模型卡片++中的可解释性、偏差、安全与保障以及隐私子卡片。
如需报告安全漏洞或英伟达AI相关问题,请点击此处提交。
引用文献
@misc{bercovich2025llamanemotronefficientreasoningmodels,
title={Llama-Nemotron: Efficient Reasoning Models},
author={Akhiad Bercovich and Itay Levy and Izik Golan and Mohammad Dabbah and Ran El-Yaniv and Omri Puny and Ido Galil and Zach Moshe and Tomer Ronen and Najeeb Nabwani and Ido Shahaf and Oren Tropp and Ehud Karpas and Ran Zilberstein and Jiaqi Zeng and Soumye Singhal and Alexander Bukharin and Yian Zhang and Tugrul Konuk and Gerald Shen and Ameya Sunil Mahabaleshwarkar and Bilal Kartal and Yoshi Suhara and Olivier Delalleau and Zijia Chen and Zhilin Wang and David Mosallanezhad and Adi Renduchintala and Haifeng Qian and Dima Rekesh and Fei Jia and Somshubra Majumdar and Vahid Noroozi and Wasi Uddin Ahmad and Sean Narenthiran and Aleksander Ficek and Mehrzad Samadi and Jocelyn Huang and Siddhartha Jain and Igor Gitman and Ivan Moshkov and Wei Du and Shubham Toshniwal and George Armstrong and Branislav Kisacanin and Matvei Novikov and Daria Gitman and Evelina Bakhturina and Jane Polak Scowcroft and John Kamalu and Dan Su and Kezhi Kong and Markus Kliegl and Rabeeh Karimi and Ying Lin and Sanjeev Satheesh and Jupinder Parmar and Pritam Gundecha and Brandon Norick and Joseph Jennings and Shrimai Prabhumoye and Syeda Nahida Akter and Mostofa Patwary and Abhinav Khattar and Deepak Narayanan and Roger Waleffe and Jimmy Zhang and Bor-Yiing Su and Guyue Huang and Terry Kong and Parth Chadha and Sahil Jain and Christine Harvey and Elad Segal and Jining Huang and Sergey Kashirsky and Robert McQueen and Izzy Putterman and George Lam and Arun Venkatesan and Sherry Wu and Vinh Nguyen and Manoj Kilaru and Andrew Wang and Anna Warno and Abhilash Somasamudramath and Sandip Bhaskar and Maka Dong and Nave Assaf and Shahar Mor and Omer Ullman Argov and Scot Junkin and Oleksandr Romanenko and Pedro Larroy and Monika Katariya and Marco Rovinelli and Viji Balas and Nicholas Edelman and Anahita Bhiwandiwalla and Muthu Subramaniam and Smita Ithape and Karthik Ramamoorthy and Yuting Wu and Suguna Varshini Velury and Omri Almog and Joyjit Daw and Denys Fridman and Erick Galinkin and Michael Evans and Katherine Luna and Leon Derczynski and Nikki Pope and Eileen Long and Seth Schneider and Guillermo Siman and Tomasz Grzegorzek and Pablo Ribalta and Monika Katariya and Joey Conway and Trisha Saar and Ann Guan and Krzysztof Pawelec and Shyamala Prayaga and Oleksii Kuchaiev and Boris Ginsburg and Oluwatobi Olabiyi and Kari Briski and Jonathan Cohen and Bryan Catanzaro and Jonah Alben and Yonatan Geifman and Eric Chung and Chris Alexiuk},
year={2025},
eprint={2505.00949},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2505.00949},
}