模型概述
模型特點
模型能力
使用案例
🚀 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},
}



