weqweasdas commited on
Commit
875c75b
1 Parent(s): 3678e58

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +115 -197
README.md CHANGED
@@ -1,199 +1,117 @@
1
  ---
2
- library_name: transformers
3
- tags: []
4
  ---
5
-
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
-
12
- ## Model Details
13
-
14
- ### Model Description
15
-
16
- <!-- Provide a longer summary of what this model is. -->
17
-
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
19
-
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
-
28
- ### Model Sources [optional]
29
-
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
-
36
- ## Uses
37
-
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
-
40
- ### Direct Use
41
-
42
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
43
-
44
- [More Information Needed]
45
-
46
- ### Downstream Use [optional]
47
-
48
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
49
-
50
- [More Information Needed]
51
-
52
- ### Out-of-Scope Use
53
-
54
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
55
-
56
- [More Information Needed]
57
-
58
- ## Bias, Risks, and Limitations
59
-
60
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
61
-
62
- [More Information Needed]
63
-
64
- ### Recommendations
65
-
66
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
67
-
68
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
69
-
70
- ## How to Get Started with the Model
71
-
72
- Use the code below to get started with the model.
73
-
74
- [More Information Needed]
75
-
76
- ## Training Details
77
-
78
- ### Training Data
79
-
80
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
81
-
82
- [More Information Needed]
83
-
84
- ### Training Procedure
85
-
86
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
87
-
88
- #### Preprocessing [optional]
89
-
90
- [More Information Needed]
91
-
92
-
93
- #### Training Hyperparameters
94
-
95
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
96
-
97
- #### Speeds, Sizes, Times [optional]
98
-
99
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
100
-
101
- [More Information Needed]
102
-
103
- ## Evaluation
104
-
105
- <!-- This section describes the evaluation protocols and provides the results. -->
106
-
107
- ### Testing Data, Factors & Metrics
108
-
109
- #### Testing Data
110
-
111
- <!-- This should link to a Dataset Card if possible. -->
112
-
113
- [More Information Needed]
114
-
115
- #### Factors
116
-
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
-
119
- [More Information Needed]
120
-
121
- #### Metrics
122
-
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
-
125
- [More Information Needed]
126
-
127
- ### Results
128
-
129
- [More Information Needed]
130
-
131
- #### Summary
132
-
133
-
134
-
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
-
167
- #### Software
168
-
169
- [More Information Needed]
170
-
171
- ## Citation [optional]
172
-
173
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
-
175
- **BibTeX:**
176
-
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
1
  ---
2
+ license: cc-by-nc-nd-3.0
 
3
  ---
4
+ # LLaMA3-iterative-DPO-final
5
+
6
+ ## Introduction
7
+ We release an unofficial checkpoint of a state-of-the-art instruct model of its class, **LLaMA3-iterative-DPO-final**.
8
+ On all three widely-used instruct model benchmarks: **Alpaca-Eval-V2**, **MT-Bench**, **Chat-Arena-Hard**, our model outperforms all models of similar size (e.g., LLaMA-3-8B-it), most large open-sourced models (e.g., Mixtral-8x7B-it),
9
+ and strong proprietary models (e.g., GPT-3.5-turbo-0613). The model is trained with open-sourced datasets without any additional human-/GPT4-labeling.
10
+
11
+ ## Model Releases
12
+ See the [collection](https://huggingface.co/collections/RLHFlow/online-rlhf-663ae95fade1a39663dab218) of the training set, reward/preference model, SFT model.
13
+
14
+ - [SFT model](https://huggingface.co/RLHFlow/LLaMA3-SFT)
15
+ - [Reward model](https://huggingface.co/sfairXC/FsfairX-LLaMA3-RM-v0.1)
16
+
17
+ ## Dataset
18
+ - [Preference data mix](https://huggingface.co/datasets/hendrydong/preference_700K)
19
+ - [Prompt collection for RLHF training](https://huggingface.co/datasets/RLHFlow/prompt-collection-v0.1)
20
+
21
+ ## Training methods
22
+ We have developed a simple and efficient online RLHF recipe for LLM instruct training. Our recipe is DPO-based and thus much cheaper and simpler to train and tune compared to PPO-based approaches.
23
+ Unlike widely-used offline DPO, the online component of our approach effectively mitigates distribution shifts during policy optimization.
24
+ For a detailed exposition, please refer to our accompanying technical report.
25
+
26
+
27
+ ## Chat Benchmarks
28
+
29
+ | **Model** | **Size** | **Method** | **LC Alpaca-Eval-V2** | **MT-Bench** | **Chat-Arena-Hard** |
30
+ |-------------------------|----------|-------------------|-----------------------|--------------|---------------------|
31
+ | **Small Open-Sourced Models** | | | | | |
32
+ | Gemma-7B-it | 7B | SFT | 10.4 | 6.38 | 7.5 |
33
+ | Zephyr-7B-beta | 7B | Vanilla DPO | 13.1 | 7.34 | - |
34
+ | Mistral-7B-v0.2-it | 7B | SFT | 17.1 | 7.51 | 12.6 |
35
+ | Open-Chat-0106 | 7B | SFT | 15.6 | 7.8 | - |
36
+ | Starling-7B-beta | 7B | PPO | 25.8 | 8.12 | 23.0 |
37
+ | LLaMA-3-8B-it | 8B | RS+DPO+PPO | 22.9 | 8.16 | 20.6 |
38
+ | **Ours** | | | | | |
39
+ | Ours (SFT baseline) | 8B | SFT | 10.2 | 7.69 | 5.6 |
40
+ | Ours (DPO baseline) | 8B | Vanilla DPO | 22.5 | 8.17 | 22.4 |
41
+ | Ours (Online RLHF) | 8B | Iterative DPO | **37.2** | **8.46** | **29.1** |
42
+ | **Large Open-Sourced Models** | | | | | |
43
+ | Vicuna-33b-v1.3 | 33B | SFT | 17.6 | 7.12 | 8.6 |
44
+ | Yi-34B-Chat | 34B | SFT | 27.2 | - | 23.1 |
45
+ | Mixtral-8x7B-it | 45B* | SFT | 23.7 | 8.30 | 23.4 |
46
+ | Tulu-2-DPO-70B | 70B | Vanilla DPO | 21.2 | 7.89 | 15.0 |
47
+ | LLaMA-3-70B-it | 70B | RS+DPO+PPO | 34.4 | 8.95 | 41.1 |
48
+ | Mixtral-8x22B-it | 141B* | SFT | 30.9 | 8.66 | 36.4 |
49
+ | **Proprietary Models** | | | | | |
50
+ | GPT-3.5-turbo-1106 | - | - | 19.3 | 8.35 | 18.9 |
51
+ | GPT-3.5-turbo-0613 | - | - | 22.7 | 8.39 | 24.8 |
52
+ | GPT-4-0613 | - | - | 30.2 | 9.18 | 37.9 |
53
+ | Claude-3-Opus | - | - | 40.5 | 9.00 | 60.4 |
54
+ | GPT-4 Turbo (04/09) | - | - | 55.0 | - | 82.6 |
55
+
56
+
57
+ ## Academic Benchmarks
58
+
59
+ | **Model** | **Size** | **Method** | **GSM-8K** | **MMLU** | **HumanEval** | **TruthfulQA** | **ARC** | **MBPP** |
60
+ |----------------------------|----------|-----------------|------------|----------|---------------|----------------|---------|----------|
61
+ | LLaMA-3-8B-it | 8B | RS+DPO+PPO | 79.6 | 66.0 | 61.6 | 43.9 | 59.5 | 61.1 |
62
+ | Ours (SFT baseline) | 8B | SFT | 74.2 | 64.7 | 65.2 | 53.4 | 61.4 | 62.3 |
63
+ | Ours (DPO baseline) | 8B | Vanilla DPO | 79.8 | 64.5 | 63.4 | 61.8 | 65.2 | 60.3 |
64
+ | Ours (Iterative RLHF) | 8B | Iterative DPO | 80.7 | 65.3 | 64.6 | 60.4 | 64.3 | 60.8 |
65
+
66
+
67
+ ## Usage
68
+ ```python
69
+ from transformers import AutoModelForCausalLM, AutoTokenizer
70
+
71
+ device = "cuda"
72
+
73
+ model = AutoModelForCausalLM.from_pretrained("RLHFlow/LLaMA3-iterative-DPO-final")
74
+ tokenizer = AutoTokenizer.from_pretrained("RLHFlow/LLaMA3-iterative-DPO-final")
75
+
76
+ messages = [
77
+ {"role": "user", "content": "I'm trying to teach myself to have nicer handwriting. Can you help?"},
78
+ ]
79
+
80
+ model_inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
81
+
82
+ model_inputs = model_inputs.to(device)
83
+ model.to(device)
84
+
85
+ output_tokens = model.generate(model_inputs, max_new_tokens=1024, do_sample=True)
86
+ model_outputs = tokenizer.batch_decode(output_tokens)
87
+ print(model_outputs[0])
88
+ ```
89
+
90
+
91
+ ## Limitations
92
+ RLHFlow/LLaMA3-iterative-DPO-final is an unofficial checkpoint developed to illustrate the power of online iterative RLHF and is for research purpose. While safety and ethical considerations are integral to our alignment process,
93
+ there remains the possibility that the model could generate offensive or unethical content, particularly under adversarial conditions.
94
+ We are committed to continuous improvement in our models to minimize such risks and encourage responsible usage.
95
+
96
+ ## Citation
97
+ Please cite our techical report if you find our model is useful for your research or product.
98
+ ```
99
+ @misc{dong2024rlhf,
100
+ title={RLHF Workflow: From Reward Modeling to Online RLHF},
101
+ author={Hanze Dong and Wei Xiong and Bo Pang and Haoxiang Wang and Han Zhao and Yingbo Zhou and Nan Jiang and Doyen Sahoo and Caiming Xiong and Tong Zhang},
102
+ year={2024},
103
+ eprint={2405.07863},
104
+ archivePrefix={arXiv},
105
+ primaryClass={cs.LG}
106
+ }
107
+
108
+ @misc{xiong2024iterative,
109
+ title={Iterative Preference Learning from Human Feedback: Bridging Theory and Practice for RLHF under KL-Constraint},
110
+ author={Wei Xiong and Hanze Dong and Chenlu Ye and Ziqi Wang and Han Zhong and Heng Ji and Nan Jiang and Tong Zhang},
111
+ year={2024},
112
+ eprint={2312.11456},
113
+ archivePrefix={arXiv},
114
+ primaryClass={cs.LG}
115
+ }
116
+
117
+ ```