🚀 OpenCodeReasoning-Nemotron-32B-IOI
OpenCodeReasoning-Nemotron-32B-IOI 是一个大语言模型(LLM),它基于 Qwen2.5-32B-Instruct(即参考模型)衍生而来。这是一个经过后训练的推理模型,用于代码生成推理,支持 32K 令牌的上下文长度。该模型可用于商业或非商业用途。

🚀 快速开始
复现结果
使用模型
对 IOI 基准测试的编码问题进行推理
import transformers
import torch
model_id = "nvidia/OpenCodeReasoning-Nemotron-32B-IOI"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.
Please use c++ programming language only.
You must use ```cpp for just the final solution code block with the following format:
```cpp
// Your code here
{user}
"""
messages = [
{
"role": "user",
"content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},
]
outputs = pipeline(
messages,
max_new_tokens=32768,
)
print(outputs[0]["generated_text"][-1]['content'])
#### 对 Python 程序的编码问题进行推理
```python
import transformers
import torch
model_id = "nvidia/OpenCodeReasoning-Nemotron-32B"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
prompt = """You are a helpful and harmless assistant. You should think step-by-step before responding to the instruction below.
Please use python programming language only.
You must use ```python for just the final solution code block with the following format:
```python
# Your code here
{user}
"""
messages = [
{
"role": "user",
"content": prompt.format(user="Write a program to calculate the sum of the first $N$ fibonacci numbers")},
]
outputs = pipeline(
messages,
max_new_tokens=32768,
)
print(outputs[0]["generated_text"][-1]['content'])
## ✨ 主要特性
- 基于 Qwen2.5-32B-Instruct 开发,具有 32B 模型参数。
- 支持 32K 令牌的上下文长度。
- 可用于商业或非商业用途。
## 📦 安装指南
文档未提及安装步骤,故跳过。
## 💻 使用示例
### 基础用法
上述“对 IOI 基准测试的编码问题进行推理”和“对 Python 程序的编码问题进行推理”的代码示例展示了基础的使用方法。
## 📚 详细文档
### 评估结果
以下结果是在每个基准测试上进行 **64 次评估**的平均值。
| 模型 | 数据集规模(Python) | 数据集规模(C++) | LiveCodeBench (pass@1) | CodeContests (pass@1) | IOI(总分) |
|---------------------------|---------------------|------------------|------------------------|-----------------------|-------------------|
| OlympicCoder-7B | 0 | 100K | 40.9 | 10.6 | 127 |
| OlympicCoder-32B | 0 | 100K | 57.4 | 18.0 | 153.5 |
| QWQ-32B | - | - | 61.3 | 20.2 | 175.5 |
| **OpenCodeReasoning-IOI** | | | | | |
| **OCR-Qwen-32B-Instruct** | **736K** | **356K** | **61.5** | **25.5** | **175.5** |
### 模型架构
- 架构类型:密集解码器 Transformer 模型
- 网络架构:Qwen-32B-Instruct
本模型基于 Qwen2.5-32B-Instruct 开发,具有 32B 模型参数。OpenCodeReasoning-Nemotron-32B 同样基于 Qwen2.5-32B-Instruct 开发,也具有 32B 模型参数。
### 输入
- **输入类型**:文本
- **输入格式**:字符串
- **输入参数**:一维(1D)
- **其他输入相关属性**:上下文长度可达 32,768 个令牌
### 输出
- **输出类型**:文本
- **输出格式**:字符串
- **输出参数**:一维(1D)
- **其他输出相关属性**:上下文长度可达 32,768 个令牌
我们的 AI 模型设计和/或优化为在 NVIDIA GPU 加速系统上运行。通过利用 NVIDIA 的硬件(如 GPU 核心)和软件框架(如 CUDA 库),该模型与仅使用 CPU 的解决方案相比,实现了更快的训练和推理时间。
### 软件集成
- 运行时引擎:NeMo 2.3.0
- 推荐的硬件微架构兼容性:
- NVIDIA Ampere
- NVIDIA Hopper
- 首选/支持的操作系统:Linux
### 模型版本
- 1.0 (4/25/2025)
- OpenCodeReasoning-Nemotron-7B
- OpenCodeReasoning-Nemotron-14B
- OpenCodeReasoning-Nemotron-32B
- OpenCodeReasoning-Nemotron-32B-IOI
### 训练和评估数据集
#### 训练数据集
OpenCodeReasoning-Nemotron-32B 的训练语料库是 [OpenCodeReasoning](https://huggingface.co/datasets/nvidia/OpenCodeReasoning) 数据集,它由竞赛编程问题和 DeepSeek-R1 生成的响应组成。
- 数据收集方法:混合(自动化、人工、合成)
- 标注方法:混合(自动化、人工、合成)
- 属性:来自 OpenCodeReasoning 的 736k 个样本
#### 评估数据集
我们使用下一节列出的数据集来评估 OpenCodeReasoning-Nemotron-32B。
- 数据收集方法:混合(自动化、人工、合成)
- 标注方法:混合(自动化、人工、合成)
### 许可证
使用本模型受 [Apache 2.0](https://huggingface.co/nvidia/OpenCode-Nemotron-2-7B/blob/main/LICENSE) 许可协议的约束。
### 部署地域
全球
### 使用场景
本模型适用于构建大语言模型的开发者和研究人员。
### 发布日期
Huggingface [04/25/2025],通过 https://huggingface.co/nvidia/OpenCodeReasoning-Nemotron-32B/ 发布
### 参考资料
[2504.01943] OpenCodeReasoning: Advancing Data Distillation for Competitive Coding
### 推理
- **引擎**:vLLM
- **测试硬件**:NVIDIA H100 - 80GB
### 伦理考量
NVIDIA 认为可信 AI 是一项共同责任,我们已经制定了政策和实践,以支持广泛的 AI 应用开发。当按照我们的服务条款下载或使用时,开发者应与他们的内部模型团队合作,确保该模型满足相关行业和用例的要求,并解决意外的产品滥用问题。请在此报告安全漏洞或 NVIDIA AI 相关问题。
## 🔧 技术细节
文档未提及技术实现细节,故跳过。
## 📄 许可证
使用本模型受 [Apache 2.0](https://huggingface.co/nvidia/OpenCode-Nemotron-2-7B/blob/main/LICENSE) 许可协议的约束。
## 引用
如果您发现这些数据有用,请引用:
@article{ahmad2025opencodereasoning,
title={OpenCodeReasoning: Advancing Data Distillation for Competitive Coding},
author={Wasi Uddin Ahmad, Sean Narenthiran, Somshubra Majumdar, Aleksander Ficek, Siddhartha Jain, Jocelyn Huang, Vahid Noroozi, Boris Ginsburg},
year={2025},
eprint={2504.01943},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2504.01943},
}