--- license: llama3.1 library_name: nemo language: - en inference: false fine-tuning: false tags: - nvidia - llama3.1 - reward model datasets: - nvidia/HelpSteer2 --- # Model Overview ## Description: Llama-3.1-Nemotron-70B-Reward is a large language model customized using developed by NVIDIA to predict the quality of LLM generated responses. ## Terms of use By accessing this model, you are agreeing to the LLama 3.1 terms and conditions of the [license](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/LICENSE), [acceptable use policy](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/USE_POLICY.md) and [Meta’s privacy policy](https://www.facebook.com/privacy/policy/) ## RewardBench Primary Dataset LeaderBoard | Model | Type of Data Used For Training | Overall | Chat | Chat-Hard | Safety | Reasoning | |:-----------------------------|:----------------|:-----|:----------|:-------|:----------|:-----------------------| | _**Llama-3.1-Nemotron-70B-Reward**_ |Permissive Licensed Data Only (CC-BY-4.0) | **94.1** | **97.5** | 85.8 | **95.1** | **98.1** | | Skywork-Reward-Gemma-2-27B | Includes GPT4 Generated Data| 93.8 | 95.8 | **91.4** | 91.9 | 96.1 | | TextEval-Llama3.1-70B | Not disclosed | 93.5 | 94.1 | 90.1 | 93.2 | 96.4 | | Skywork-Critic-Llama-3.1-70B | Not fully disclosed | 93.3 | 96.6 | 87.9 | 93.1 | 95.5 | | SFR-LLaMa-3.1-70B-Judge-r | Not fully disclosed | 92.7 | 96.9 | 84.8 | 91.6 | 97.6 | Nemotron-4-340B-Reward | Permissive Licensed Data Only (CC-BY-4.0) | 92.0 | 95.8 | 87.1 | 91.5 | 93.7 | | ArmoRM-Llama3-8B-v0.1 | Includes GPT4 Generated Data | 90.8 | 96.9 | 76.8 | 92.2 | 97.3 | | Cohere May 2024 | Not disclosed | 89.5 | 96.4 | 71.3 | 92.7 | 97.7 | | Llama3-70B-SteerLM-RM | Permissive Licensed Data Only (CC-BY-4.0) | 88.8 | 91.3 | 80.3 | 92.8 | 90.7 | | Google Gemini Pro 1.5 | Not disclosed | 88.1 | 92.3 | 80.6 | 87.5 | 92.0 | | GPT-4o-2024-08-06 |Not disclosed | 86.7 | 96.1 | 76.1 | 88.1 | 86.6 | | claude-3-5-sonnet-20240620 | Not disclosed | 84.2 | 96.4 | 74.0 | 81.6 | 84.7 | | Meta-Llama-3.1-70B-Instruct | Not fully disclosed | 84.0 | 97.2 | 70.2 | 82.8 | 86.0 | As shown above, Llama-3.1-Nemotron-70B-Reward performs best overall as well as in Chat, Safety and Reasoning category. To better understand why it struggles in Chat-Hard category, we analyzed the scores for each consistutent subset of Chat-Hard category. | Model | Type of Data Used For Training | Overall | Chat | Chat-Hard | Safety | Reasoning | |:-----------------------------|:----------------|:-----|:----------|:-------|:----------|:-----------------------| | _**Llama-3.1-Nemotron-70B-Reward**_ |Permissive Licensed Data Only (CC-BY-4.0) | **94.1** | **97.5** | 85.8 | **95.1** | **98.1** | | Skywork-Reward-Gemma-2-27B | Includes GPT4 Generated Data| 93.8 | 95.8 | **91.4** | 91.9 | 96.1 | Last updated: 27 Sept 2024 ## Usage: You can use the model with [NeMo Aligner](https://github.com/NVIDIA/NeMo-Aligner) following [SteerLM training user guide](https://docs.nvidia.com/nemo-framework/user-guide/latest/modelalignment/steerlm.html). 1. Spin up an inference server within the NeMo container (`docker pull nvcr.io/nvidia/nemo.24.05.llama3.1`) ```python HF_HOME= \ python /opt/NeMo-Aligner/examples/nlp/gpt/serve_reward_model.py \ rm_model_file=Llama-3.1-Nemotron-70B-Reward \ trainer.num_nodes=1 \ trainer.devices=8 \ ++model.tensor_model_parallel_size=8 \ ++model.pipeline_model_parallel_size=1 \ inference.micro_batch_size=2 \ inference.port=1424 ``` 2. Annotate data files using the served reward model. As an example, this can be the Open Assistant train/val files. Then follow the next step to train a SteerLM model based on [SteerLM training user guide](https://docs.nvidia.com/nemo-framework/user-guide/latest/modelalignment/steerlm.html#step-5-train-the-attribute-conditioned-sft-model) . Please note that this script rounds the predicted floats to the nearest int (between 0 and 4 inclusive), as it's meant for SteerLM training. For other use cases (e.g. reward bench measurement, response filtering/ranking), we recommend using the floats directly, which can be done by commenting out [two lines of code in NeMo-Aligner](https://github.com/NVIDIA/NeMo-Aligner/blob/main/examples/nlp/data/steerlm/attribute_annotate.py#L135-136) ```python python /opt/NeMo-Aligner/examples/nlp/data/steerlm/preprocess_openassistant_data.py --output_directory=data/oasst python /opt/NeMo-Aligner/examples/nlp/data/steerlm/attribute_annotate.py \ --input-file=data/oasst/train.jsonl \ --output-file=data/oasst/train_labeled.jsonl \ --port=1424 ``` 3. Alternatively, this can be any conversational data file (in .jsonl) in the following format, where each line looks like ```json { "conversations": [ {"value": , "from": "User", "label": None}, {"value": , "from": "Assistant", "label": }, {"value": , "from": "User", "label": None}, {"value": , "from": "Assistant", "label": }, ], "mask": "User" } ``` Ideally, each `````` refers to the ground truth label for the assistant turn but if they are not available, we can also use ```helpfulness:-1```. It must not be ```None``` or an empty string. ## Contact E-Mail: [Zhilin Wang](mailto:zhilinw@nvidia.com) ## Citation If you find this model useful, please cite the following works ```bibtex @misc{wang2024helpsteer2, title={HelpSteer2: Open-source dataset for training top-performing reward models}, author={Zhilin Wang and Yi Dong and Olivier Delalleau and Jiaqi Zeng and Gerald Shen and Daniel Egert and Jimmy J. Zhang and Makesh Narsimhan Sreedhar and Oleksii Kuchaiev}, year={2024}, eprint={2406.08673}, archivePrefix={arXiv}, primaryClass={id='cs.CL' full_name='Computation and Language' is_active=True alt_name='cmp-lg' in_archive='cs' is_general=False description='Covers natural language processing. Roughly includes material in ACM Subject Class I.2.7. Note that work on artificial languages (programming languages, logics, formal systems) that does not explicitly address natural-language issues broadly construed (natural-language processing, computational linguistics, speech, text retrieval, etc.) is not appropriate for this area.'} } ``` ## References(s): * [HelpSteer2](https://arxiv.org/abs/2406.08673) * [HelpSteer](https://arxiv.org/abs/2311.09528) * [SteerLM method](https://arxiv.org/abs/2310.05344) * [Introducing Llama 3.1: Our most capable models to date](https://ai.meta.com/blog/meta-llama-3-1/) * [Meta's Llama 3.1 Webpage](https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_1) * [Meta's Llama 3.1 Model Card](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md) ## Model Architecture: **Architecture Type:** Transformer
**Network Architecture:** Llama 3.1
## Input: **Input Type(s):** Text
**Input Format:** String
**Input Parameters:** NA
**Other Properties Related to Input:** Provided text must be within 4096 tokens
## Output: **Output Type(s):** Float
**Output Format:** One Single Float
**Output Parameters:** NA
**Other Properties Related to Output:** NA
## Software Integration: **Supported Hardware Microarchitecture Compatibility:**
* NVIDIA Ampere
* NVIDIA Hopper
* NVIDIA Turing
**Supported Operating System(s):** Linux
## Model Version: v1.0 # Training & Evaluation: ## Datasets: **Data Collection Method by dataset**
* [Hybrid: Human, Synthetic]
**Labeling Method by dataset**
* [Human]
**Link:** * [HelpSteer2](https://huggingface.co/datasets/nvidia/HelpSteer2) **Properties (Quantity, Dataset Descriptions, Sensor(s)):**
* 37,120 prompt-responses built to make more models more aligned with human preference - specifically more helpful, factually-correct, coherent, and customizable based on complexity and verbosity. # Inference: **Engine:** [Triton](https://developer.nvidia.com/triton-inference-server)
**Test Hardware:** H100, A100 80GB, A100 40GB
## 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 supporting 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](https://www.nvidia.com/en-us/support/submit-security-vulnerability/). Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).