模型简介
模型特点
模型能力
使用案例
🚀 Llama-3.1-Nemotron-Ultra-253B-v1
Llama-3.1-Nemotron-Ultra-253B-v1是一个大型语言模型,它基于Meta Llama-3.1-405B-Instruct衍生而来。该模型经过后训练,在推理、满足人类聊天偏好和执行特定任务(如RAG和工具调用)方面表现出色,支持128K令牌的上下文长度,且适合在单个8xH100节点上进行推理。
🚀 快速开始
你可以通过以下链接使用预览API来尝试这个模型:Llama-3_1-Nemotron-Ultra-253B-v1。
使用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
首先安装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
✨ 主要特性
- 高效与准确的平衡:通过新颖的神经架构搜索(NAS)方法,大幅减少了模型的内存占用,提高了效率(吞吐量),同时在准确性和效率之间取得了良好的平衡。此外,通过垂直压缩模型的方法,显著改善了延迟。
- 多阶段后训练:该模型经过多阶段的后训练过程,包括监督微调阶段和多个强化学习阶段,增强了其推理和非推理能力。
- 商业可用:该模型已准备好用于商业用途。
- 多语言支持:支持英语、编码语言以及其他多种非英语语言(如德语、法语、意大利语、葡萄牙语、印地语、西班牙语和泰语)。
📦 安装指南
使用该模型时,你可以根据上述快速开始部分的说明,使用Transformers库或vLLM进行安装和使用。
📚 详细文档
模型概述
Llama-3.1-Nemotron-Ultra-253B-v1是一个大型语言模型(LLM),它是Meta Llama-3.1-405B-Instruct(即 参考模型)的衍生模型。它是一个推理模型,经过后训练以提高推理能力、满足人类聊天偏好和执行特定任务,如RAG和工具调用。该模型支持128K令牌的上下文长度,适合在单个8xH100节点上进行推理。
许可证/使用条款
本模型的使用受NVIDIA开放模型许可证的约束。更多信息请参考Llama 3.1社区许可协议。
模型开发者:NVIDIA
模型训练时间:2024年11月至2025年4月
数据新鲜度:预训练数据截止到2023年,遵循Llama-3.1-405B-Instruct的标准。
使用场景
适用于设计AI代理系统、聊天机器人、RAG系统和其他AI应用的开发者,也适用于典型的指令跟随任务。
发布日期
2025年4月7日
参考资料
- [2505.00949] Llama-Nemotron: Efficient Reasoning Models
- [2502.00203] Reward-aware Preference Optimization: A Unified Mathematical Framework for Model Alignment
- [2411.19146]Puzzle: Distillation-Based NAS for Inference-Optimized LLMs
- [2503.18908]FFN Fusion: Rethinking Sequential Computation in Large Language Models
模型架构
属性 | 详情 |
---|---|
架构类型 | 密集解码器仅Transformer模型 |
网络架构 | Llama-3.1-405B-Instruct,通过神经架构搜索(NAS)进行定制 |
该模型基于Llama-3.1-405B-Instruct开发,具有253B个模型参数。使用NAS算法产生了非标准和非重复的块,包括:
- 跳过注意力:在某些块中,注意力被完全跳过或被单个线性层取代。
- 可变FFN:FFN层中的扩展/压缩比在不同块之间不同。
- FFN融合:当几个连续的注意力层被跳过时,会导致多个FFN序列,这些FFN序列会被融合成更少但更宽的FFN层。
对于参考模型的每个块,创建了多个变体,提供了不同的质量与计算复杂度的权衡。然后搜索这些块以创建一个满足所需吞吐量和内存要求,同时最小化质量下降的模型。为了恢复性能,模型首先进行了650亿令牌的知识蒸馏(KD),然后进行了880亿令牌的持续预训练(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日)
推理
引擎:
- Transformers
测试硬件:
- BF16:
- 8x NVIDIA H100-80GB
- 4x NVIDIA B100
- FP 8
- 4x NVIDIA H100-80GB
训练和评估数据集
训练数据集
在多阶段后训练之前的知识蒸馏阶段,使用了多种训练数据,其中包括FineWeb、Buzz-V1.2和Dolma。多阶段后训练阶段的数据是SFT和RL数据的汇编,用于提高原始Llama指令模型的数学、代码、一般推理和指令跟随能力。
提示信息来自公共开放语料库或合成生成,响应由多种模型合成生成。部分提示包含推理开启和关闭模式的响应,用于训练模型区分两种模式。该模型使用Qwen进行了改进。
为了促进模型开发和改进的开放性和透明度,已经发布了Llama-Nemotron-Post-Training-Dataset。
训练数据集的数据收集:
- 混合:自动化、人工、合成
训练数据集的数据标注:
- 混合:自动化、人工、合成
评估数据集
使用以下数据集对Llama-3.1-Nemotron-Ultra-253B-v1进行评估:
评估数据集的数据收集:
- 混合:人工/合成
评估数据集的数据标注:
- 混合:人工/合成/自动
评估结果
这些结果包含推理开启和关闭两种模式。建议在推理开启模式下使用温度0.6
和Top P 0.95
,在推理关闭模式下使用贪心解码。所有评估均使用32k序列长度进行。为了更准确,运行基准测试最多16次并取平均分。
⚠️ 重要提示
在适用的情况下,将提供提示模板。在完成基准测试时,请确保按照提供的提示解析正确的输出格式,以重现以下基准测试结果。
GPQA
推理模式 | pass@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
推理模式 | pass@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 Live
推理模式 | 分数 |
---|---|
推理关闭 | 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)
推理模式 | pass@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
推理模式 | pass@1 |
---|---|
推理关闭 | 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 |
伦理考虑
NVIDIA认为可信AI是一项共同责任,并建立了相关政策和实践,以支持广泛的AI应用开发。当按照服务条款下载或使用该模型时,开发者应与内部模型团队合作,确保该模型满足相关行业和用例的要求,并解决不可预见的产品滥用问题。
如需了解该模型的更多伦理考虑细节,请参阅模型卡++ 可解释性、偏差、安全与保障和隐私子卡。
请在此报告安全漏洞或NVIDIA 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},
}



