wasiuddina's picture
Update README.md
f9f5111 verified
|
raw
history blame
7.1 kB
metadata
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
tags:
  - nvidia
  - pytorch

OpenCodeReasoning-Distill-Qwen-7B-Instruct

Model Overview

Llama-3.1-Nemotron-Ultra-253B-v1 is a large language model (LLM) which is a derivative of Meta Llama-3.1-405B-Instruct (AKA the reference model). It is a reasoning model that is post trained for reasoning, human chat preferences, and tasks, such as RAG and tool calling. The model supports a context length of 128K tokens. This model fits on a single 8xH100 node for inference.

Llama-3.1-Nemotron-Ultra-253B-v1 is a model which offers a great tradeoff between model accuracy and efficiency. Efficiency (throughput) directly translates to savings. Using a novel Neural Architecture Search (NAS) approach, we greatly reduce the model’s memory footprint, enabling larger workloads, as well as reducing the number of GPUs required to run the model in a data center environment. This NAS approach enables the selection of a desired point in the accuracy-efficiency tradeoff. Furthermore, by using a novel method to vertically compress the model (see details here), it also offers a significant improvement in latency.

The model underwent a multi-phase post-training process to enhance both its reasoning and non-reasoning capabilities. This includes a supervised fine-tuning stage for Math, Code, Reasoning, Chat, and Tool Calling as well as multiple reinforcement learning (RL) stages using Group Relative Policy Optimization (GRPO) algorithms for reasoning, chat, and instruction-following.

This model is ready for commercial use.

License/Terms of Use

GOVERNING TERMS: Your use of this model is governed by the NVIDIA Open Model License. Additional Information: Llama 3.1 Community License Agreement. Built with Qwen.

Model Developer: NVIDIA

Model Dates: Trained between February 2025 and March 2025

Use Case:

Developers designing AI-powered code generation applications. Also suitable for typical instruction-following tasks.

Release Date:

2025-04-21

References

Model Architecture

  • Architecture Type: Dense decoder-only Transformer model
  • Network Architecture: Qwen

**This model was developed based on Qwen2.5-7B-Instruct
** This model has 7B of model parameters.

Intended use

OpenCodeReasoning-Distill-Qwen-7B-Instruct is a competitive code generation focused reasoning and chat model intended to be used in English.

Input

  • Input Type: Text
  • Input Format: String
  • Input Parameters: One-Dimensional (1D)
  • Other Properties Related to Input: Context length up to 32,768 tokens

Output

  • Output Type: Text
  • Output Format: String
  • Output Parameters: One-Dimensional (1D)
  • Other Properties Related to Output: Context length up to 32,768 tokens

Software Integration

  • Runtime Engine: Transformers
  • Recommended Hardware Microarchitecture Compatibility:
    • NVIDIA Hopper
    • NVIDIA Ampere
  • Preferred Operating System(s): Linux

Model Version

1.0 (4/21/2025)

Quick Start and Usage Recommendations:

We recommend setting temperature to `0.6`, and Top P to `0.95` for inference on LiveCodeBench.

Use It with Transformers

See the snippet below for usage with Hugging Face Transformers library. Please see the example below.

We recommend using the transformers package with version 4.48.3.
Example:

import torch
import transformers

model_id = "nvidia/OpenCodeReasoning-Distill-Qwen-7B-Instruct"
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
)

print(pipeline([{"role": "user", "content": "Solve x*(sin(x)+2)=0"}]))

Training and Evaluation Datasets

Training Datasets

This model is trained using OpenCodeReasoning dataset.

Data Collection for Training Datasets:

  • Hybrid: Automated, Human, Synthetic

Data Labeling for Training Datasets:

  • Hybrid: Automated, Human, Synthetic

Evaluation Datasets

We used the datasets listed in the next section to evaluate Llama-3.1-Nemotron-Ultra-253B-v1.

Data Collection for Evaluation Datasets:

  • Hybrid: Human/Synthetic

Data Labeling for Evaluation Datasets:

  • Hybrid: Human/Synthetic/Automatic

Evaluation Results

LiveCodeBench (20240801-20250201)

Models Pass@1
R1-Distill-Qwen-7B 37.6
OpenCodeReasoning-Distill-Qwen-7B-Instruct 51.3

User Prompt Template (without starter code):

"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
```

User Prompt Template (with starter code):

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}
```

Ethical Considerations:

NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.

For more detailed information on ethical considerations for this model, please see the Model Card++ Explainability, Bias, Safety & Security, and Privacy Subcards.

Please report security vulnerabilities or NVIDIA AI Concerns here.