blair-johnson commited on
Commit
e25a60e
·
1 Parent(s): c05a2d4

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -0
README.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ datasets:
4
+ - victor123/evol_instruct_70k
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - galactica
9
+ - wizardlm
10
+ - alpaca
11
+ - opt
12
+ inference: false
13
+ ---
14
+
15
+ # GALACTICA 6.7B Evol-Instruct
16
+
17
+ GALACTICA 6.7B fine-tuned on the Evol-Instruct 70k dataset.
18
+
19
+ The model card from the original Galactica repo can be found [here](https://github.com/paperswithcode/galai/blob/main/docs/model_card.md), and the original paper [here](https://galactica.org/paper.pdf).
20
+
21
+ The HF dataset for Evol-Instruct-70k can be found [here](https://huggingface.co/datasets/victor123/evol_instruct_70k), and the original GitHub repo for WizardLM is [here](https://github.com/nlpxucan/WizardLM).
22
+
23
+ ## Model Details
24
+
25
+ The GALACTICA models are trained on a large-scale scientific corpus and are designed to perform scientific tasks.
26
+ The Alpaca dataset is a set of 52k instruct-response pairs designed to enhace the instruction following capabilites of pre-trained language models.
27
+
28
+ ## Model Use
29
+
30
+ The GALACTICA model card specifies that the primary indended users of the GALACTICA models are researchers studying language models applied to the scientific domain, and it cautions against production use of GALACTICA without safeguards due to the potential for the model to produce inaccurate information.
31
+ The original GALACTICA models are available under a non-commercial CC BY-NC 4.0 license, and models based on the Evol-Instruct-70k dataset are additionally subject to the [OpenAI Terms of Service](https://openai.com/policies/terms-of-use).
32
+
33
+ ## Training Data
34
+
35
+ This model was trained by fine-tuning pre-trained GALACTICA 6.7B on the Evol-Instruct-70k dataset. GALACTICA models were trained on 106 billion tokens of open-access scientific text and data, including papers, textbooks, scientific websites, encyclopedias, and more.
36
+ Fine-tuning the base GALACTICA models on the 70k instruction-response pairs in the Evol-Instruct-70k dataset allows users to query the resulting model in an instruct-response fashion.
37
+
38
+ ## How to Use
39
+
40
+ The GALACTICA Evol-Instruct-70K weights are made available for use with the `transformers` library.
41
+
42
+ <details>
43
+ <summary> Click to expand </summary>
44
+
45
+ ```python
46
+ # pip install accelerate
47
+ from transformers import AutoTokenizer, AutoModelForCausalLM
48
+
49
+ tokenizer = AutoTokenizer.from_pretrained("GeorgiaTechResearchInstitute/galactica-6.7b-evol-instruct-70k")
50
+ model = AutoModelForCausalLM.from_pretrained("GeorgiaTechResearchInstitute/galactica-6.7b-evol-instruct-70k", device_map="auto", torch_dtype=torch.float16)
51
+
52
+ # the evol-instruct models were fine-tuned with the same hidden prompts as the Alpaca project
53
+ no_input_prompt_template = ("Below is an instruction that describes a task. "
54
+ "Write a response that appropriately completes the request.\n\n"
55
+ "### Instruction:\n{instruction}\n\n### Response:")
56
+ prompt = "Write out Maxwell's equations and explain the meaning of each one."
57
+ formatted_prompt = no_input_prompt_template.format_map({'instruction': prompt})
58
+
59
+ tokenized_prompt = tokenizer(formatted_prompt, return_tensors="pt").input_ids.to(model.device)
60
+ out_tokens = model.generate(tokenized_prompt)
61
+
62
+ print(tokenizer.batch_decode(out_tokens, skip_special_tokens=False, clean_up_tokenization_spaces=False))
63
+ ```
64
+ </details>
65
+
66
+ ## Training Resources
67
+
68
+ GALACTICA 6.7B Evol-Instruct was fine-tuned in about 22 hours using 8 A100 80GB GPUS, 16-bit mixed-precision, an effective batch-size of 64, and with a maximum context window of 2048 tokens. This model was trained using full-shard data parallelism.
69
+
70
+ ## Performance and Limitations
71
+
72
+ Qualitative evaluation suggests that the evol-instruct-70k fine-tuned Galactica models are signficantly more controllable and attentive to user prompts than the Alpaca fine-tuned GALPACA models.
73
+
74
+ ## Works Cited
75
+
76
+ ```bibtex
77
+ @inproceedings{GALACTICA,
78
+ title={GALACTICA: A Large Language Model for Science},
79
+ author={Ross Taylor and Marcin Kardas and Guillem Cucurull and Thomas Scialom and Anthony Hartshorn and Elvis Saravia and Andrew Poulton and Viktor Kerkez and Robert Stojnic},
80
+ year={2022}
81
+ }
82
+ ```
83
+
84
+ ```bibtex
85
+ @misc{xu2023wizardlm,
86
+ title={WizardLM: Empowering Large Language Models to Follow Complex Instructions},
87
+ author={Can Xu and Qingfeng Sun and Kai Zheng and Xiubo Geng and Pu Zhao and Jiazhan Feng and Chongyang Tao and Daxin Jiang},
88
+ year={2023},
89
+ eprint={2304.12244},
90
+ archivePrefix={arXiv},
91
+ primaryClass={cs.CL}
92
+ }
93
+ ```