Text Generation
Transformers
PyTorch
English
llama
text-generation-inference
Inference Endpoints
bleysg commited on
Commit
bf8c918
1 Parent(s): 56a5a35

Update README.md

Browse files

Still in progress...

Files changed (1) hide show
  1. README.md +215 -4
README.md CHANGED
@@ -1,11 +1,222 @@
1
  ---
2
  license: llama2
 
 
 
 
 
 
3
  ---
4
 
5
- Usage:
6
 
7
- 1. [Install OpenChat](https://github.com/imoneoi/openchat/#installation)
8
 
9
- 2. `python -m ochat.serving.openai_api_server --model-type openchat_llama2 --model Open-Orca/Llama2_GPT4_1M --engine-use-ray --worker-use-ray --max-num-batched-tokens 5120`
10
 
11
- To use features such as tensor parallelism on consumer GPUs, API keys and logging, follow the OpenChat documentation.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: llama2
3
+ language:
4
+ - en
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ datasets:
8
+ - Open-Orca/OpenOrca
9
  ---
10
 
11
+ <p><h1>🐋 The Second OpenOrca Model Preview! 🐋</h1></p>
12
 
 
13
 
14
+ ![OpenOrca Logo](https://huggingface.co/datasets/Open-Orca/OpenOrca/resolve/main/OpenOrcaLogo.png "OpenOrca Logo")
15
 
16
+
17
+ # OpenOrca x OpenChat - Preview2 - 13B
18
+
19
+ We have used our own [OpenOrca dataset](https://huggingface.co/datasets/Open-Orca/OpenOrca) to fine-tune Llama2-13B using [OpenChat](https://huggingface.co/openchat) packing and conditional behavior cloning.
20
+ This dataset is our attempt to reproduce the dataset generated for Microsoft Research's [Orca Paper](https://arxiv.org/abs/2306.02707).
21
+
22
+ This second preview release is trained on a curated filtered subset of most of our GPT4 augmented data.
23
+
24
+ This release highlights that our dataset and training methods have surpassed performance parity with the Orca paper.
25
+ As well, this is done with ~1/3rd the compute requirement and using <20% of the dataset size from the original Orca paper.
26
+
27
+ We have run extensive evaluations internally and expect this model to place number 1 on both the HuggingFaceH4 Open LLM Leaderboard and the GPT4ALL Leaderboard for 13B models.
28
+
29
+ "One" of [OpenChat](https://huggingface.co/openchat) has joined our team, and we'd like to provide special thanks for their training of this model!
30
+ We have utilized OpenChat conditional behavior cloning and [MultiPack algorithm](https://github.com/imoneoi/multipack_sampler) which achieves 99.85% bin-packing efficiency on our dataset.
31
+ This has significantly reduced training time, with efficiency improvement of 3-10X over traditional methods.
32
+
33
+
34
+ <img src="https://raw.githubusercontent.com/imoneoi/openchat/master/assets/logo_new.png" style="width: 40%">
35
+
36
+
37
+ Want to visualize our full (pre-filtering) dataset? Check out our [Nomic Atlas Map](https://atlas.nomic.ai/map/c1b88b47-2d9b-47e0-9002-b80766792582/2560fd25-52fe-42f1-a58f-ff5eccc890d2).
38
+
39
+
40
+ [<img src="https://huggingface.co/Open-Orca/OpenOrca-Preview1-13B/resolve/main/OpenOrca%20Nomic%20Atlas.png" alt="Atlas Nomic Dataset Map" width="400" height="400" />](https://atlas.nomic.ai/map/c1b88b47-2d9b-47e0-9002-b80766792582/2560fd25-52fe-42f1-a58f-ff5eccc890d2)
41
+
42
+
43
+ We are in-process with training more models, so keep a look out on our org for releases coming soon with exciting partners.
44
+
45
+ We will also give sneak-peak announcements on our Discord, which you can find here:
46
+
47
+ https://AlignmentLab.ai
48
+
49
+
50
+ # Evaluation
51
+
52
+ We have evaluated **OpenOrcaxOpenChat-Preview2-13B** on hard reasoning tasks from BigBench-Hard and AGIEval as outlined in the Orca paper.
53
+
54
+ Our average performance for BigBench-Hard: 0.488
55
+
56
+ Average for AGIEval: 0.441
57
+
58
+ In the Orca paper, they measured their score relative to Vicuna on these evals.
59
+ We've done the same and have found our score averages to >103% of the total improvement that was shown in the Orca paper, using the same evaluation methods as outlined in the paper.
60
+
61
+ So we are surpassing Orca performance with <20% of the dataset size and ~1/3rd the training budget!
62
+
63
+ ## BigBench-Hard Performance
64
+
65
+ ![OpenOrca Preview2 BigBench-Hard Performance](https://huggingface.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B/resolve/main/OO_Preview2_BigBenchHard.png "BigBench-Hard Performance")
66
+
67
+ ## AGIEval Performance
68
+
69
+ ![OpenOrca Preview2 AGIEval Performance](https://huggingface.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B/resolve/main/OO_Preview2_AGIEval.png "AGIEval Performance")
70
+
71
+ ## HuggingFaceH4 Open LLM Leaderboard Performance
72
+
73
+ We have run our own tests using parameters matching the [HuggingFaceH4 Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) evals.
74
+ We find
75
+
76
+ ![OpenOrca Preview2 HuggingFace Leaderboard Performance](https://huggingface.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B/resolve/main/OO_Preview2_HFLeaderboard.png "GPT4ALL Performance")
77
+
78
+ ## GPT4ALL Leaderboard Performance
79
+
80
+ We have tested using parameters matching the GPT4ALL Benchmark Suite and report our results and placement vs their official reporting below.
81
+ We place #1 for all open models and come within comparison of text-davinci-003, a proprietary model an order of magnitude larger.
82
+
83
+ ![OpenOrca Preview2 GPT4ALL Performance](https://huggingface.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B/resolve/main/OO_Preview2_AGIEval.png "GPT4ALL Performance")
84
+
85
+ # Dataset
86
+
87
+ We used a curated, filtered selection of most of the GPT-4 augmented data from our OpenOrca dataset, which aims to reproduce the Orca Research Paper dataset.
88
+ Further details of our curation practices will be forthcoming with our full model release.
89
+
90
+
91
+ # Training
92
+
93
+ We trained with 8x A100-80G GPUs for 170 hours, completing 5 epochs of full fine tuning on our dataset.
94
+ This contrasts with the 20x A100-80G GPUs for 200 hours used in the Orca paper, for only 3 epochs.
95
+ Our compute requirement was ~1/3rd that of the original Orca.
96
+ Commodity cost was ~$2,300.
97
+
98
+ Please await our full releases for further training details.
99
+
100
+
101
+ # Prompt Template
102
+
103
+ We use our own prompt template which we call "``"
104
+
105
+
106
+ # Serving
107
+
108
+ This model is most easily served with [OpenChat's](https://github.com/imoneoi/openchat) customized vLLM OpenAI-compatible API server.
109
+ We also illustrate setup of Oobabooga/text-generation-webui below.
110
+
111
+
112
+ ## Serving with OpenChat
113
+
114
+ [Install OpenChat](https://github.com/imoneoi/openchat/#installation)
115
+
116
+ After installation, run:
117
+
118
+ ```bash
119
+ python -m ochat.serving.openai_api_server \
120
+ --model-type openchat_llama2 \
121
+ --model Open-Orca/OpenOrcaxOpenChat-Preview2-13B \
122
+ --engine-use-ray --worker-use-ray --max-num-batched-tokens 5120
123
+ ```
124
+
125
+ Follow the OpenChat documentation to use features such as tensor parallelism on consumer GPUs, API keys, and logging.
126
+ You may then connect to the OpenAI-compatible API endpoint with tools such as [BetterGPT.chat](https://bettergpt.chat).
127
+
128
+ ## Serving with Oobabooga / text-generation-webui
129
+
130
+ The model may also be loaded via [oobabooga/text-generation-webui](https://github.com/oobabooga/text-generation-webui/) in a similar manner to other models.
131
+ See the requirements below.
132
+
133
+ ### Oobabooga Key Requirements
134
+
135
+ * You will first need to download the model as you normally do to the "`models/`" folder of your text-generation-webui installation.
136
+ * To use the unquantized model presented here, select "`Transformers`"" in the webui's "`Model`" tab "`Model loader`" dropdown.
137
+ * You will likely want to tick "`auto-devices`". The model will require >30GB VRAM after loading in context for inference.
138
+ * The model was trained in bf16, so tick the "`bf16`" box for best performance.
139
+ * It will run safely on single GPUs with VRAM >=48GB (e.g. A6000)
140
+ * If using consumer GPUs, e.g. 2x RTX3090 24GB, you will likely want to enter "18,17" under tensor_split to split the model across both GPUs
141
+ * The model will perform significantly better if you use the appropriate prompting template
142
+ * We will submit a PR to include our prompting template into text-generation-webui soon
143
+ * For now, manually enter the settings described in the following sections:
144
+
145
+ ### Oobabooga Chat Settings
146
+
147
+ In the "`Chat settings`" tab, select the following settings:
148
+
149
+ For "`User String`" ...
150
+ ```
151
+ User:
152
+ ```
153
+ For "`Bot string`" ...
154
+ ```
155
+ Assistant:
156
+ ```
157
+ For "`Context`", it is not necessary but we have found good results with ...
158
+ ```
159
+ You are a helpful assistant. Please answer truthfully and write out your thinking step by step to be sure you get the right answer. If you make a mistake or encounter an error in your thinking, say so out loud and attempt to correct it. If you don't know or aren't sure about something, say so clearly. You will act as a professional logician, mathematician, and physicist. You will also act as the most appropriate type of expert to answer any particular question or solve the relevant problem; state which expert type your are, if so. Also think of any particular named expert that would be ideal to answer the relevant question or solve the relevant problem; name and act as them, if appropriate.
160
+ ```
161
+ For "`Turn template`", this is absolutely essential to have. You will get poor, mixed up output without this template ...
162
+ ```
163
+ <|user|> <|user-message|><|end_of_turn|>\n<|bot|> <|bot-message|>\n
164
+ ```
165
+
166
+ When done, it should look as below:
167
+ <img src="https://huggingface.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B/resolve/main/Images/OpenOrcaLlama2OobaboogaChatInstructionTemplate.png" style="width: 40%">
168
+
169
+ You may then save this as a named template preset by clicking the "Floppy" icon and giving it an appropriate name in the popup, e.g. "`OpenOrcaxOpenChat Llama2`".
170
+
171
+ ### Oobabooga Text Generation Mode
172
+
173
+ In the "`Text generation`" tab, select "`instruct`" as the mode:
174
+
175
+ #### Mode Illustration
176
+ It should look as below:
177
+ <img src="https://huggingface.co/Open-Orca/OpenOrcaxOpenChat-Preview2-13B/resolve/main/Images/OpenOrcaLlama2OobaboogaInstructMode.png" style="width: 40%">
178
+
179
+
180
+ # Citation
181
+
182
+ ```bibtex
183
+ @software{OpenOrca_Preview2,
184
+ title = {OpenOrca_Preview2: A Llama2-13B Model Instruct-tuned on Filtered OpenOrcaV1 GPT-4 Dataset},
185
+ author = {Wing Lian and Bleys Goodson and Guan Wang and Eugene Pentland and Austin Cook and Chanvichet Vong` and "Teknium"},
186
+ year = {2023},
187
+ publisher = {HuggingFace},
188
+ journal = {HuggingFace repository},
189
+ howpublished = {\url{https://https://huggingface.co/Open-Orca/OpenOrca-Preview2-13B},
190
+ }
191
+ @software{openchat,
192
+ title = {{OpenChat: Advancing Open-source Language Models with Imperfect Data}},
193
+ author = {Wang, Guan and Cheng, Sijie and Yu, Qiying and Liu, Changling},
194
+ doi = {10.5281/zenodo.8105775},
195
+ url = {https://github.com/imoneoi/openchat},
196
+ version = {pre-release},
197
+ year = {2023},
198
+ month = {7},
199
+ }
200
+ @misc{mukherjee2023orca,
201
+ title={Orca: Progressive Learning from Complex Explanation Traces of GPT-4},
202
+ author={Subhabrata Mukherjee and Arindam Mitra and Ganesh Jawahar and Sahaj Agarwal and Hamid Palangi and Ahmed Awadallah},
203
+ year={2023},
204
+ eprint={2306.02707},
205
+ archivePrefix={arXiv},
206
+ primaryClass={cs.CL}
207
+ }
208
+ @misc{longpre2023flan,
209
+ title={The Flan Collection: Designing Data and Methods for Effective Instruction Tuning},
210
+ author={Shayne Longpre and Le Hou and Tu Vu and Albert Webson and Hyung Won Chung and Yi Tay and Denny Zhou and Quoc V. Le and Barret Zoph and Jason Wei and Adam Roberts},
211
+ year={2023},
212
+ eprint={2301.13688},
213
+ archivePrefix={arXiv},
214
+ primaryClass={cs.AI}
215
+ }
216
+ @software{touvron2023llama,
217
+ title={LLaMA: Open and Efficient Foundation Language Models},
218
+ author={Touvron, Hugo and Lavril, Thibaut and Izacard, Gautier and Martinet, Xavier and Lachaux, Marie-Anne and Lacroix, Timoth{\'e}e and Rozi{\`e}re, Baptiste and Goyal, Naman and Hambro, Eric and Azhar, Faisal and Rodriguez, Aurelien and Joulin, Armand and Grave, Edouard and Lample, Guillaume},
219
+ journal={arXiv preprint arXiv:2302.13971},
220
+ year={2023}
221
+ }
222
+ ```