aashish1904 commited on
Commit
bf26f33
1 Parent(s): a9f5063

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +334 -0
README.md ADDED
@@ -0,0 +1,334 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ license: other
5
+ language:
6
+ - en
7
+ pipeline_tag: text-generation
8
+ tags:
9
+ - cerebras
10
+ - doc-chat
11
+ - DocChat
12
+ - llama-3
13
+ - pytorch
14
+
15
+ ---
16
+
17
+ ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)
18
+
19
+ # QuantFactory/Llama3-DocChat-1.0-8B-GGUF
20
+ This is quantized version of [cerebras/Llama3-DocChat-1.0-8B](https://huggingface.co/cerebras/Llama3-DocChat-1.0-8B) created using llama.cpp
21
+
22
+ # Original Model Card
23
+
24
+
25
+ # Model Information
26
+
27
+ We are excited to announce the release of Cerebras DocChat, our first iteration of models designed for document-based conversational question answering. This series includes two models: Cerebras Llama3-DocChat, a large language model (LLM), and Cerebras Dragon-DocChat, a multi-turn retriever model.
28
+
29
+ This model – Cerebras Llama3-DocChat 1.0 8B – was built on top of Llama 3 base using insights from the latest research on document-based Q&A, most notably Nvidia’s ChatQA model series. As part of this work, we leveraged our experience in LLM model training and dataset curation to overcome the gaps in ChatQA's released datasets and training recipes. Additionally, we employed synthetic data generation to address limitations that couldn't be fully resolved with the available real data. Using a single Cerebras System, Llama3-DocChat 8B was trained in a few hours.
30
+
31
+ You can find more information about DocChat at the following locations:
32
+ * [Blog post](https://www.cerebras.net/blog/train-a-gpt-4-level-conversational-qa-in-a-few-hours)
33
+ * [LLM model weights on HuggingFace](https://huggingface.co/cerebras/Llama3-DocChat-1.0-8B)
34
+ * Embedding model weights on HuggingFace: [Query Encoder](https://huggingface.co/cerebras/Dragon-DocChat-Query-Encoder), [Context Encoder](https://huggingface.co/cerebras/Dragon-DocChat-Context-Encoder)
35
+ * [Data preparation, training, and evaluation code](https://github.com/Cerebras/DocChat)
36
+
37
+ ## Results
38
+
39
+ | **ChatRAG Benchmark** | **Llama3 Instruct 8B** | **Command-R-Plus** | **Nvidia Llama3-ChatQA 1.5 8B** | **GPT-4-Turbo-2024-04-09** | **Cerebras Llama3-DocChat 1.0 8B** |
40
+ | --- | --- | --- | --- | --- | --- |
41
+ | Doc2Dial | 31.33 | 33.51 | 39.33 | 35.35 | 39.19 |
42
+ | QuAC | 32.64 | 34.16 | 39.73 | 40.1 | 36 |
43
+ | QReCC | 43.4 | 49.77 | 49.03 | 51.46 | 50.27 |
44
+ | CoQA | 73.25 | 69.71 | 76.46 | 77.73 | 79.56 |
45
+ | DoQA | 30.34 | 40.67 | 49.6 | 41.6 | 48.77 |
46
+ | ConvFinQA | 53.15 | 71.21 | 78.46 | 84.16 | 80.13 |
47
+ | SQA | 36.6 | 74.07 | 73.28 | 79.98 | 74.19 |
48
+ | TopioCQA | 34.64 | 53.77 | 49.96 | 48.32 | 52.13 |
49
+ | HybriDial\* | 40.77 | 46.7 | 65.76 | 47.86 | 64 |
50
+ | INSCIT | 32.09 | 35.76 | 30.1 | 33.75 | 32.88 |
51
+ | Average (all) | 40.82 | 50.93 | 55.17 | 54.03 | 55.71 |
52
+ | Average (exclude HybriDial) | 40.83 | 51.4 | 53.99 | 54.72 | 54.79 |
53
+
54
+
55
+ | **Eleuther Eval Harness Benchmark** | **Llama3 Instruct 8B** | **Nvidia Llama3-ChatQA 1.5 8B** | **Cerebras Llama3-DocChat 1.0 8B** |
56
+ | --- | --- | --- | --- |
57
+ | hellaswag | 57.68 | 61.37 | 61.68 |
58
+ | winogrande | 71.98 | 73.95 | 74.11 |
59
+ | truthfulqa_mc1 | 36.23 | 28.52 | 29.25 |
60
+ | truthfulqa_mc2 | 51.65 | 43.56 | 45.14 |
61
+ | mmlu | 63.84 | 60.68 | 62.86 |
62
+ | gsm8k | 76.12 | 13.72 | 55.57 |
63
+ | arc_easy | 81.61 | 80.56 | 82.03 |
64
+ | arc_challenge | 52.99 | 51.02 | 53.92 |
65
+ | Average | 61.51 | 51.67 | 58.07 |
66
+
67
+ ## Prompt Format
68
+
69
+ DocChat supports the standard Llama3 Instruct chat template – no fancy formatting functions required! When providing a context document to the model, simply prepend the user turn with `<context> {put your document here} </context>`. You may also provide an “instruction” before the user input to better align the model’s response with the desired behavior. Examples include:
70
+
71
+ * `Please give a full and complete answer for the question.`
72
+ * `Answer the following question with a short span`
73
+
74
+ We use the same system prompt as ChatQA: `This is a chat between a user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions based on the context. The assistant should also indicate when the answer cannot be found in the context.`
75
+
76
+ ## Example Usage
77
+
78
+
79
+ ```python
80
+ from transformers import AutoTokenizer, AutoModelForCausalLM
81
+ import torch
82
+
83
+ model_id = "cerebras/Llama3-DocChat-1.0-8B"
84
+
85
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
86
+ model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
87
+
88
+
89
+ system = "This is a chat between a user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions based on the context. The assistant should also indicate when the answer cannot be found in the context."
90
+ instruction = "Please give a full and complete answer for the question."
91
+
92
+ document = """
93
+ # Cerebras Wafer-Scale Cluster
94
+
95
+ Exa-scale performance, single device simplicity
96
+
97
+ ## AI Supercomputers
98
+
99
+ Condor Galaxy (CG), the supercomputer built by G42 and Cerebras, is the simplest and fastest way to build AI models in the cloud. With over 16 ExaFLOPs of AI compute, Condor Galaxy trains the most demanding models in hours rather than days. The terabyte scale MemoryX system natively accommodates 100 billion+ parameter models, making large scale training simple and efficient.
100
+
101
+ | Cluster | ExaFLOPs | Systems | Memory |
102
+ | -------- | -------- | -------- | ------ |
103
+ | CG1 | 4 | 64 CS-2s | 82 TB |
104
+ | CG2 | 4 | 64 CS-2s | 82 TB |
105
+ | CG3 | 8 | 64 CS-3s | 108 TB |
106
+ """
107
+
108
+ question = "How many total CS systems does Condor Galaxy 1, 2, and 3 have combined, and how many flops does this correspond to?"
109
+
110
+ user_turn = f"""<context>
111
+ {document}
112
+ </context>
113
+ {instruction} {question}"""
114
+
115
+ messages = [
116
+ {"role": "system", "content": system},
117
+ {"role": "user", "content": user_turn}
118
+ ]
119
+
120
+ input_ids = tokenizer.apply_chat_template(
121
+ messages,
122
+ add_generation_prompt=True,
123
+ return_tensors="pt"
124
+ ).to(model.device)
125
+
126
+ terminators = [
127
+ tokenizer.eos_token_id,
128
+ tokenizer.convert_tokens_to_ids("<|eot_id|>")
129
+ ]
130
+
131
+ outputs = model.generate(
132
+ input_ids,
133
+ max_new_tokens=256,
134
+ eos_token_id=terminators,
135
+ )
136
+ response = outputs[0][input_ids.shape[-1]:]
137
+ print(tokenizer.decode(response, skip_special_tokens=True))
138
+ ```
139
+ ## License
140
+
141
+ This model was trained from Llama 3 8B base, and therefore is subject to the [META LLAMA 3 COMMUNITY LICENSE AGREEMENT](https://llama.meta.com/llama3/license/). Furthermore, it is trained on ChatQA's synthetic conversational QA dataset which was generated using GPT-4. As a result this model can be used for non-commercial purposes only, and is subject to [Terms of Use](https://openai.com/policies/terms-of-use) of the data generated by OpenAI. Additionally, please see the licensing information of individual datasets.
142
+
143
+ ## Acknowledgements
144
+
145
+ DocChat was built on top of a large body of ML work, spanning training datasets, recipes, and evaluation. We want to thank each of these resources.
146
+
147
+ ```
148
+ @inproceedings{dua2019drop,
149
+ title={DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphs},
150
+ author={Dua, Dheeru and Wang, Yizhong and Dasigi, Pradeep and Stanovsky, Gabriel and Singh, Sameer and Gardner, Matt},
151
+ booktitle={Proceedings of the 2019 Conference on NAACL},
152
+ year={2019}
153
+ }
154
+ @article{kocisky2018narrativeqa,
155
+ title={The NarrativeQA Reading Comprehension Challenge},
156
+ author={Kocisky, Tomas and Schwarz, Jonathan and Blunsom, Phil and Dyer, Chris and Hermann, Karl Moritz and Melis, Gabor and Grefenstette, Edward},
157
+ journal={Transactions of the Association for Computational Linguistics},
158
+ year={2018}
159
+ }
160
+ @inproceedings{dasigi2019quoref,
161
+ title={Quoref: A Reading Comprehension Dataset with Questions Requiring Coreferential Reasoning},
162
+ author={Dasigi, Pradeep and Liu, Nelson F and Marasovi{\'c}, Ana and Smith, Noah A and Gardner, Matt},
163
+ booktitle={Proceedings of the 2019 Conference on EMNLP},
164
+ year={2019}
165
+ }
166
+ @inproceedings{lin2019reasoning,
167
+ title={Reasoning Over Paragraph Effects in Situations},
168
+ author={Lin, Kevin and Tafjord, Oyvind and Clark, Peter and Gardner, Matt},
169
+ booktitle={Proceedings of the 2nd Workshop on Machine Reading for Question Answering},
170
+ year={2019}
171
+ }
172
+ @inproceedings{rajpurkar2016squad,
173
+ title={SQuAD: 100,000+ Questions for Machine Comprehension of Text},
174
+ author={Rajpurkar, Pranav and Zhang, Jian and Lopyrev, Konstantin and Liang, Percy},
175
+ booktitle={Proceedings of the 2016 Conference on EMNLP},
176
+ year={2016}
177
+ }
178
+ @inproceedings{rajpurkar2018know,
179
+ title={Know What You Don’t Know: Unanswerable Questions for SQuAD},
180
+ author={Rajpurkar, Pranav and Jia, Robin and Liang, Percy},
181
+ booktitle={Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics},
182
+ pages={784--789},
183
+ year={2018}
184
+ }
185
+ @inproceedings{trischler2017newsqa,
186
+ title={NewsQA: A Machine Comprehension Dataset},
187
+ author={Trischler, Adam and Wang, Tong and Yuan, Xingdi and Harris, Justin and Sordoni, Alessandro and Bachman, Philip and Suleman, Kaheer},
188
+ booktitle={Proceedings of the 2nd Workshop on Representation Learning for NLP},
189
+ year={2017}
190
+ }
191
+ @inproceedings{zhu2021tat,
192
+ title={TAT-QA: A Question Answering Benchmark on a Hybrid of Tabular and Textual Content in Finance},
193
+ author={Zhu, Fengbin and Lei, Wenqiang and Huang, Youcheng and Wang, Chao and Zhang, Shuo and Lv, Jiancheng and Feng, Fuli and Chua, Tat-Seng},
194
+ booktitle={Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics},
195
+ year={2021}
196
+ }
197
+ @inproceedings{kim2023soda,
198
+ title={SODA: Million-scale Dialogue Distillation with Social Commonsense Contextualization},
199
+ author={Kim, Hyunwoo and Hessel, Jack and Jiang, Liwei and West, Peter and Lu, Ximing and Yu, Youngjae and Zhou, Pei and Bras, Ronan and Alikhani, Malihe and Kim, Gunhee and others},
200
+ booktitle={Proceedings of the 2023 Conference on EMNLP},
201
+ year={2023}
202
+ }
203
+ @inproceedings{fan2019eli5,
204
+ title={ELI5: Long Form Question Answering},
205
+ author={Fan, Angela and Jernite, Yacine and Perez, Ethan and Grangier, David and Weston, Jason and Auli, Michael},
206
+ booktitle={Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics},
207
+ year={2019}
208
+ }
209
+ @article{chung2024scaling,
210
+ title={Scaling instruction-finetuned language models},
211
+ author={Chung, Hyung Won and Hou, Le and Longpre, Shayne and Zoph, Barret and Tay, Yi and Fedus, William and Li, Yunxuan and Wang, Xuezhi and Dehghani, Mostafa and Brahma, Siddhartha and others},
212
+ journal={Journal of Machine Learning Research},
213
+ year={2024}
214
+ }
215
+ @inproceedings{longpre2023flan,
216
+ title={The flan collection: Designing data and methods for effective instruction tuning},
217
+ author={Longpre, Shayne and Hou, Le and Vu, Tu and Webson, Albert and Chung, Hyung Won and Tay, Yi and Zhou, Denny and Le, Quoc V and Zoph, Barret and Wei, Jason and others},
218
+ booktitle={International Conference on Machine Learning},
219
+ year={2023},
220
+ }
221
+ @inproceedings{wang2023self,
222
+ title={Self-Instruct: Aligning Language Models with Self-Generated Instructions},
223
+ author={Wang, Yizhong and Kordi, Yeganeh and Mishra, Swaroop and Liu, Alisa and Smith, Noah A and Khashabi, Daniel and Hajishirzi, Hannaneh},
224
+ booktitle={Proceedings of the 61st Annual Meeting Of The Association For Computational Linguistics},
225
+ year={2023}
226
+ }
227
+ @inproceedings{honovich2023unnatural,
228
+ title={Unnatural Instructions: Tuning Language Models with (Almost) No Human Labor},
229
+ author={Honovich, Or and Scialom, Thomas and Levy, Omer and Schick, Timo},
230
+ booktitle={Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics},
231
+ year={2023}
232
+ }
233
+ @article{kopf2024openassistant,
234
+ title={Openassistant conversations-democratizing large language model alignment},
235
+ author={K{\"o}pf, Andreas and Kilcher, Yannic and von R{\"u}tte, Dimitri and Anagnostidis, Sotiris and Tam, Zhi Rui and Stevens, Keith and Barhoum, Abdullah and Nguyen, Duc and Stanley, Oliver and Nagyfi, Rich{\'a}rd and others},
236
+ journal={Advances in Neural Information Processing Systems},
237
+ year={2024}
238
+ }
239
+ @online{DatabricksBlog2023DollyV2,
240
+ author = {Mike Conover and Matt Hayes and Ankit Mathur and Jianwei Xie and Jun Wan and Sam Shah and Ali Ghodsi and Patrick Wendell and Matei Zaharia and Reynold Xin},
241
+ title = {Free Dolly: Introducing the World's First Truly Open Instruction-Tuned LLM},
242
+ year = {2023},
243
+ url = {https://www.databricks.com/blog/2023/04/12/dolly-first-open-commercially-viable-instruction-tuned-llm},
244
+ urldate = {2023-06-30}
245
+ }
246
+ @misc{numina_math_datasets,
247
+ author = {Jia LI and Edward Beeching and Lewis Tunstall and Ben Lipkin and Roman Soletskyi and Shengyi Costa Huang and Kashif Rasul and Longhui Yu and Albert Jiang and Ziju Shen and Zihan Qin and Bin Dong and Li Zhou and Yann Fleureau and Guillaume Lample and Stanislas Polu},
248
+ title = {NuminaMath},
249
+ year = {2024},
250
+ publisher = {Numina},
251
+ journal = {Hugging Face repository},
252
+ howpublished = {\url{[https://huggingface.co/AI-MO/NuminaMath-CoT](https://github.com/project-numina/aimo-progress-prize/blob/main/report/numina_dataset.pdf)}}
253
+ }
254
+ @misc{zhuang2024structlm,
255
+ title={StructLM: Towards Building Generalist Models for Structured Knowledge Grounding},
256
+ author={Alex Zhuang and Ge Zhang and Tianyu Zheng and Xinrun Du and Junjie Wang and Weiming Ren and Stephen W. Huang and Jie Fu and Xiang Yue and Wenhu Chen},
257
+ year={2024},
258
+ eprint={2402.16671},
259
+ archivePrefix={arXiv},
260
+ primaryClass={cs.CL}
261
+ }
262
+ @article{llama3modelcard,
263
+ title={Llama 3 Model Card},
264
+ author={AI@Meta},
265
+ year={2024},
266
+ url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
267
+ }
268
+ @article{liu2024chatqa,
269
+ title={ChatQA: Surpassing GPT-4 on Conversational QA and RAG},
270
+ author={Liu, Zihan and Ping, Wei and Roy, Rajarshi and Xu, Peng and Lee, Chankyu and Shoeybi, Mohammad and Catanzaro, Bryan},
271
+ journal={arXiv preprint arXiv:2401.10225},
272
+ year={2024}}
273
+ @inproceedings{feng2020doc2dial,
274
+ title={doc2dial: A Goal-Oriented Document-Grounded Dialogue Dataset},
275
+ author={Feng, Song and Wan, Hui and Gunasekara, Chulaka and Patel, Siva and Joshi, Sachindra and Lastras, Luis},
276
+ booktitle={Proceedings of the 2020 Conference on EMNLP},
277
+ year={2020}
278
+ }
279
+ @inproceedings{choi2018quac,
280
+ title={QuAC: Question Answering in Context},
281
+ author={Choi, Eunsol and He, He and Iyyer, Mohit and Yatskar, Mark and Yih, Wen-tau and Choi, Yejin and Liang, Percy and Zettlemoyer, Luke},
282
+ booktitle={Proceedings of the 2018 Conference on EMNLP},
283
+ year={2018}
284
+ }
285
+ @inproceedings{anantha2021open,
286
+ title={Open-Domain Question Answering Goes Conversational via Question Rewriting},
287
+ author={Anantha, Raviteja and Vakulenko, Svitlana and Tu, Zhucheng and Longpre, Shayne and Pulman, Stephen and Chappidi, Srinivas},
288
+ booktitle={Proceedings of the 2021 Conference on NAACL},
289
+ year={2021}
290
+ }
291
+ @article{reddy2019coqa,
292
+ title={CoQA: A Conversational Question Answering Challenge},
293
+ author={Reddy, Siva and Chen, Danqi and Manning, Christopher D},
294
+ journal={Transactions of the Association for Computational Linguistics},
295
+ year={2019}
296
+ }
297
+ @inproceedings{campos2020doqa,
298
+ title={DoQA-Accessing Domain-Specific FAQs via Conversational QA},
299
+ author={Campos, Jon Ander and Otegi, Arantxa and Soroa, Aitor and Deriu, Jan Milan and Cieliebak, Mark and Agirre, Eneko},
300
+ booktitle={Proceedings of the 2020 Conference on ACL},
301
+ year={2020}
302
+ }
303
+ @inproceedings{chen2022convfinqa,
304
+ title={ConvFinQA: Exploring the Chain of Numerical Reasoning in Conversational Finance Question Answering},
305
+ author={Chen, Zhiyu and Li, Shiyang and Smiley, Charese and Ma, Zhiqiang and Shah, Sameena and Wang, William Yang},
306
+ booktitle={Proceedings of the 2022 Conference on EMNLP},
307
+ year={2022}
308
+ }
309
+ @inproceedings{iyyer2017search,
310
+ title={Search-based neural structured learning for sequential question answering},
311
+ author={Iyyer, Mohit and Yih, Wen-tau and Chang, Ming-Wei},
312
+ booktitle={Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics},
313
+ year={2017}
314
+ }
315
+ @article{adlakha2022topiocqa,
316
+ title={TopiOCQA: Open-domain Conversational Question Answering with Topic Switching},
317
+ author={Adlakha, Vaibhav and Dhuliawala, Shehzaad and Suleman, Kaheer and de Vries, Harm and Reddy, Siva},
318
+ journal={Transactions of the Association for Computational Linguistics},
319
+ year={2022}
320
+ }
321
+ @inproceedings{nakamura2022hybridialogue,
322
+ title={HybriDialogue: An Information-Seeking Dialogue Dataset Grounded on Tabular and Textual Data},
323
+ author={Nakamura, Kai and Levy, Sharon and Tuan, Yi-Lin and Chen, Wenhu and Wang, William Yang},
324
+ booktitle={Findings of the Association for Computational Linguistics: ACL 2022},
325
+ year={2022}
326
+ }
327
+ @article{wu2023inscit,
328
+ title={InSCIt: Information-Seeking Conversations with Mixed-Initiative Interactions},
329
+ author={Wu, Zeqiu and Parish, Ryu and Cheng, Hao and Min, Sewon and Ammanabrolu, Prithviraj and Ostendorf, Mari and Hajishirzi, Hannaneh},
330
+ journal={Transactions of the Association for Computational Linguistics},
331
+ year={2023}
332
+ }
333
+ ```
334
+