blair-johnson commited on
Commit
d9bcabe
1 Parent(s): 6ee4097

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +90 -0
README.md CHANGED
@@ -1,3 +1,93 @@
1
  ---
2
  license: cc-by-nc-4.0
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc-by-nc-4.0
3
+ datasets:
4
+ - tatsu-lab/alpaca
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - galactica
9
+ - alpaca
10
+ - opt
11
+ inference: false
12
  ---
13
+
14
+ # GALPACA 6.7B (standard)
15
+
16
+ GALACTICA 30B fine-tuned on the Alpaca dataset.
17
+
18
+ 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).
19
+
20
+ The dataset card for Alpaca can be found [here](https://huggingface.co/datasets/tatsu-lab/alpaca/blob/main/README.md), and the project homepage [here](https://crfm.stanford.edu/2023/03/13/alpaca.html).
21
+ The Alpaca dataset was collected with a modified version of the [Self-Instruct Framework](https://github.com/yizhongw/self-instruct), and was built using OpenAI's `text-davinci-003` model. As such it is subject to OpenAI's terms of service.
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 the GALPACA model is additionally subject to the [OpenAI Terms of Service](https://openai.com/policies/terms-of-use).
32
+
33
+ ## Training Data
34
+
35
+ The GALPACA models are trained by fine-tuning pre-trained GALACTICA models on the Alpaca 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 52k instruction-response pairs in the Alpaca dataset allows users to query the GALPACA models in an instruct-response fashion.
37
+
38
+ ## How to Use
39
+
40
+ The GALPACA 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, OPTForCausalLM
48
+
49
+ tokenizer = AutoTokenizer.from_pretrained("GeorgiaTechResearchInstitute/galpaca-6.7b")
50
+ model = OPTForCausalLM.from_pretrained("GeorgiaTechResearchInstitute/galpaca-6.7b", device_map="auto", torch_dtype=torch.float16)
51
+
52
+ # see the original Alpaca repo for more information about the prompt templates
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
+ GALPACA 6.7B was fine-tuned in about 2 hours using 4 A100 80GB GPUS, 16-bit mixed-precision, an effective batch-size of 128, and with a maximum context window of 512 tokens. This model was trained using full-shard data parallelism.
69
+
70
+ ## Performance and Limitations
71
+
72
+ Qualitative evaluation suggests that Galpaca frequently outperforms LLaMA-based Alpaca models on tasks related to technical knowledge and programming, while it underperforms on natural langauge tasks such as generating prose. More information about the performance and limitations of the GALACTICA family of models can be found on the original GALACTICA model card.
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{alpaca,
86
+ author = {Rohan Taori and Ishaan Gulrajani and Tianyi Zhang and Yann Dubois and Xuechen Li and Carlos Guestrin and Percy Liang and Tatsunori B. Hashimoto },
87
+ title = {Stanford Alpaca: An Instruction-following LLaMA model},
88
+ year = {2023},
89
+ publisher = {GitHub},
90
+ journal = {GitHub repository},
91
+ howpublished = {\url{https://github.com/tatsu-lab/stanford_alpaca}},
92
+ }
93
+ ```