Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,157 @@
|
|
1 |
-
---
|
2 |
-
license: llama3.1
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: llama3.1
|
3 |
+
library_name: nemo
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
inference: false
|
7 |
+
fine-tuning: false
|
8 |
+
tags:
|
9 |
+
- nvidia
|
10 |
+
- llama3.1
|
11 |
+
- reward model
|
12 |
+
datasets:
|
13 |
+
- nvidia/HelpSteer2
|
14 |
+
---
|
15 |
+
|
16 |
+
# Model Overview
|
17 |
+
|
18 |
+
## Description:
|
19 |
+
|
20 |
+
Llama-3.1-Nemotron-70B-Reward is a large language model customized using developed by NVIDIA to predict the quality of LLM generated responses.
|
21 |
+
|
22 |
+
## Terms of use
|
23 |
+
|
24 |
+
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/)
|
25 |
+
|
26 |
+
## Usage:
|
27 |
+
|
28 |
+
|
29 |
+
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).
|
30 |
+
|
31 |
+
1. Spin up an inference server within the NeMo container (`docker pull nvcr.io/nvidia/nemo.24.05.llama3.1`)
|
32 |
+
|
33 |
+
|
34 |
+
```python
|
35 |
+
python /opt/NeMo-Aligner/examples/nlp/gpt/serve_reward_model.py \
|
36 |
+
rm_model_file=Llama-3.1-Nemotron-70B-Reward \
|
37 |
+
trainer.num_nodes=1 \
|
38 |
+
trainer.devices=8 \
|
39 |
+
++model.tensor_model_parallel_size=8 \
|
40 |
+
++model.pipeline_model_parallel_size=1 \
|
41 |
+
inference.micro_batch_size=2 \
|
42 |
+
inference.port=1424
|
43 |
+
```
|
44 |
+
|
45 |
+
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) .
|
46 |
+
|
47 |
+
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.
|
48 |
+
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)
|
49 |
+
|
50 |
+
```python
|
51 |
+
python /opt/NeMo-Aligner/examples/nlp/data/steerlm/preprocess_openassistant_data.py --output_directory=data/oasst
|
52 |
+
python /opt/NeMo-Aligner/examples/nlp/data/steerlm/attribute_annotate.py \
|
53 |
+
--input-file=data/oasst/train.jsonl \
|
54 |
+
--output-file=data/oasst/train_labeled.jsonl \
|
55 |
+
--port=1424
|
56 |
+
```
|
57 |
+
|
58 |
+
3. Alternatively, this can be any conversational data file (in .jsonl) in the following format, where each line looks like
|
59 |
+
|
60 |
+
```json
|
61 |
+
{
|
62 |
+
"conversations": [
|
63 |
+
{"value": <user_turn_1>, "from": "User", "label": None},
|
64 |
+
{"value": <assistant_turn_1>, "from": "Assistant", "label": <formatted_label_1>},
|
65 |
+
{"value": <user_turn_2>, "from": "User", "label": None},
|
66 |
+
{"value": <assistant_turn_2>, "from": "Assistant", "label": <formatted_label_2>},
|
67 |
+
],
|
68 |
+
"mask": "User"
|
69 |
+
}
|
70 |
+
```
|
71 |
+
|
72 |
+
Ideally, each ```<formatted_label_n>``` 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.
|
73 |
+
|
74 |
+
|
75 |
+
|
76 |
+
## Contact
|
77 |
+
|
78 |
+
E-Mail: [Zhilin Wang](mailto:zhilinw@nvidia.com)
|
79 |
+
|
80 |
+
|
81 |
+
## Citation
|
82 |
+
|
83 |
+
If you find this model useful, please cite the following works
|
84 |
+
|
85 |
+
```bibtex
|
86 |
+
@misc{wang2024helpsteer2,
|
87 |
+
title={HelpSteer2: Open-source dataset for training top-performing reward models},
|
88 |
+
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},
|
89 |
+
year={2024},
|
90 |
+
eprint={2406.08673},
|
91 |
+
archivePrefix={arXiv},
|
92 |
+
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.'}
|
93 |
+
}
|
94 |
+
```
|
95 |
+
|
96 |
+
## References(s):
|
97 |
+
|
98 |
+
* [HelpSteer2](https://arxiv.org/abs/2406.08673)
|
99 |
+
* [HelpSteer](https://arxiv.org/abs/2311.09528)
|
100 |
+
* [SteerLM method](https://arxiv.org/abs/2310.05344)
|
101 |
+
* [Introducing Llama 3.1: Our most capable models to date](https://ai.meta.com/blog/meta-llama-3-1/)
|
102 |
+
* [Meta's Llama 3.1 Webpage](https://www.llama.com/docs/model-cards-and-prompt-formats/llama3_1)
|
103 |
+
* [Meta's Llama 3.1 Model Card](https://github.com/meta-llama/llama-models/blob/main/models/llama3_1/MODEL_CARD.md)
|
104 |
+
|
105 |
+
|
106 |
+
## Model Architecture:
|
107 |
+
**Architecture Type:** Transformer <br>
|
108 |
+
**Network Architecture:** Llama 3.1 <br>
|
109 |
+
|
110 |
+
## Input:
|
111 |
+
**Input Type(s):** Text <br>
|
112 |
+
**Input Format:** String <br>
|
113 |
+
**Input Parameters:** NA <br>
|
114 |
+
**Other Properties Related to Input:** Provided text must be within 4096 tokens <br>
|
115 |
+
|
116 |
+
## Output:
|
117 |
+
**Output Type(s):** Float <br>
|
118 |
+
**Output Format:** One Single Float <br>
|
119 |
+
**Output Parameters:** NA <br>
|
120 |
+
**Other Properties Related to Output:** NA <br>
|
121 |
+
|
122 |
+
## Software Integration:
|
123 |
+
**Supported Hardware Microarchitecture Compatibility:** <br>
|
124 |
+
* NVIDIA Ampere <br>
|
125 |
+
* NVIDIA Hopper <br>
|
126 |
+
* NVIDIA Turing <br>
|
127 |
+
**Supported Operating System(s):** Linux <br>
|
128 |
+
|
129 |
+
## Model Version:
|
130 |
+
v1.0
|
131 |
+
|
132 |
+
# Training & Evaluation:
|
133 |
+
|
134 |
+
## Datasets:
|
135 |
+
|
136 |
+
**Data Collection Method by dataset** <br>
|
137 |
+
* [Hybrid: Human, Synthetic] <br>
|
138 |
+
|
139 |
+
**Labeling Method by dataset** <br>
|
140 |
+
* [Human] <br>
|
141 |
+
|
142 |
+
**Link:**
|
143 |
+
* [HelpSteer2](https://huggingface.co/datasets/nvidia/HelpSteer2)
|
144 |
+
|
145 |
+
**Properties (Quantity, Dataset Descriptions, Sensor(s)):** <br>
|
146 |
+
* 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.
|
147 |
+
|
148 |
+
|
149 |
+
# Inference:
|
150 |
+
**Engine:** [Triton](https://developer.nvidia.com/triton-inference-server) <br>
|
151 |
+
**Test Hardware:** H100, A100 80GB, A100 40GB <br>
|
152 |
+
|
153 |
+
|
154 |
+
## Ethical Considerations:
|
155 |
+
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/).
|
156 |
+
|
157 |
+
Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
|