RichardErkhov commited on
Commit
9ccdb6e
·
verified ·
1 Parent(s): 38c7805

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +215 -0
README.md ADDED
@@ -0,0 +1,215 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ falcon-rw-1b - bnb 8bits
11
+ - Model creator: https://huggingface.co/petals-team/
12
+ - Original model: https://huggingface.co/petals-team/falcon-rw-1b/
13
+
14
+
15
+
16
+
17
+ Original model description:
18
+ ---
19
+ datasets:
20
+ - tiiuae/falcon-refinedweb
21
+ language:
22
+ - en
23
+ inference: false
24
+ license: apache-2.0
25
+ ---
26
+
27
+ # Falcon-RW-1B
28
+
29
+ **Falcon-RW-1B is a 1B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on 350B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb). It is made available under the Apache 2.0 license.**
30
+
31
+ See the 📓 [paper on arXiv](https://arxiv.org/abs/2306.01116) for more details.
32
+
33
+ RefinedWeb is a high-quality web dataset built by leveraging stringent filtering and large-scale deduplication. Falcon-RW-1B, trained on RefinedWeb only, matches or outperforms comparable models trained on curated data.
34
+
35
+ ⚠️ Falcon is now available as a core model in the `transformers` library! To use the in-library version, please install the latest version of `transformers` with `pip install git+https://github.com/huggingface/transformers.git`, then simply remove the `trust_remote_code=True` argument from `from_pretrained()`.
36
+
37
+ ⚠️ This model is intended for use as a **research artifact**, to study the influence of training on web data alone. **If you are interested in state-of-the-art models, we recommend using Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b), both trained on >1,000 billion tokens.**
38
+
39
+ ```python
40
+ from transformers import AutoTokenizer, AutoModelForCausalLM
41
+ import transformers
42
+ import torch
43
+
44
+ model = "tiiuae/falcon-rw-1b"
45
+
46
+ tokenizer = AutoTokenizer.from_pretrained(model)
47
+ pipeline = transformers.pipeline(
48
+ "text-generation",
49
+ model=model,
50
+ tokenizer=tokenizer,
51
+ torch_dtype=torch.bfloat16,
52
+ device_map="auto",
53
+ )
54
+ sequences = pipeline(
55
+ "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
56
+ max_length=200,
57
+ do_sample=True,
58
+ top_k=10,
59
+ num_return_sequences=1,
60
+ eos_token_id=tokenizer.eos_token_id,
61
+ )
62
+ for seq in sequences:
63
+ print(f"Result: {seq['generated_text']}")
64
+
65
+ ```
66
+
67
+ 💥 **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
68
+
69
+
70
+
71
+ # Model Card for Falcon-RW-1B
72
+
73
+ ## Model Details
74
+
75
+ ### Model Description
76
+
77
+ - **Developed by:** [https://www.tii.ae](https://www.tii.ae);
78
+ - **Model type:** Causal decoder-only;
79
+ - **Language(s) (NLP):** English;
80
+ - **License:** Apache 2.0.
81
+
82
+ ### Model Source
83
+
84
+ - **Paper:** [https://arxiv.org/abs/2306.01116](https://arxiv.org/abs/2306.01116).
85
+
86
+ ## Uses
87
+
88
+ ### Direct Use
89
+
90
+ Research on large language models, specifically the influence of adequately filtered and deduplicated web data on the properties of large language models (fairness, safety, limitations, capabilities, etc.).
91
+
92
+ ### Out-of-Scope Use
93
+
94
+ Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
95
+
96
+ Broadly speaking, we would recommend Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) for any use not directly related to research on web data pipelines.
97
+
98
+ ## Bias, Risks, and Limitations
99
+
100
+ Falcon-RW-1B is trained on English data only, and will not generalize appropriately to other languages. Furthermore, as it is trained on a large-scale corpora representative of the web, it will carry the stereotypes and biases commonly encountered online.
101
+
102
+ ### Recommendations
103
+
104
+ We recommend users of Falcon-RW-1B to consider finetuning it for the specific set of tasks of interest, and for guardrails and appropriate precautions to be taken for any production use.
105
+
106
+ ## How to Get Started with the Model
107
+
108
+
109
+ ```python
110
+ from transformers import AutoTokenizer, AutoModelForCausalLM
111
+ import transformers
112
+ import torch
113
+
114
+ model = "tiiuae/falcon-rw-1b"
115
+
116
+ tokenizer = AutoTokenizer.from_pretrained(model)
117
+ pipeline = transformers.pipeline(
118
+ "text-generation",
119
+ model=model,
120
+ tokenizer=tokenizer,
121
+ torch_dtype=torch.bfloat16,
122
+ device_map="auto",
123
+ )
124
+ sequences = pipeline(
125
+ "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
126
+ max_length=200,
127
+ do_sample=True,
128
+ top_k=10,
129
+ num_return_sequences=1,
130
+ eos_token_id=tokenizer.eos_token_id,
131
+ )
132
+ for seq in sequences:
133
+ print(f"Result: {seq['generated_text']}")
134
+
135
+ ```
136
+
137
+ ## Training Details
138
+
139
+ ### Training Data
140
+
141
+ Falcon-RW-1B was trained on 350B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb), a high-quality filtered and deduplicated web dataset. The data was tokenized with the GPT-2 tokenizer.
142
+
143
+ ### Training Procedure
144
+
145
+ Falcon-RW-1B was trained on 32 A100 40GB GPUs, using only data parallelism with ZeRO.
146
+
147
+ #### Training Hyperparameters
148
+
149
+ Hyperparameters were adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)).
150
+
151
+ | **Hyperparameter** | **Value** | **Comment** |
152
+ |--------------------|------------|-------------------------------------------|
153
+ | Precision | `bfloat16` | |
154
+ | Optimizer | AdamW | |
155
+ | Learning rate | 2e-4 | 500M tokens warm-up, cosine decay to 2e-5 |
156
+ | Weight decay | 1e-1 | |
157
+ | Batch size | 512 | 4B tokens ramp-up |
158
+
159
+
160
+ #### Speeds, Sizes, Times
161
+
162
+ Training happened in early December 2022 and took about six days.
163
+
164
+
165
+ ## Evaluation
166
+
167
+ See the 📓 [paper on arXiv](https://arxiv.org/abs/2306.01116) for in-depth evaluation.
168
+
169
+
170
+ ## Technical Specifications
171
+
172
+ ### Model Architecture and Objective
173
+
174
+ Falcon-RW-1B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
175
+
176
+ The architecture is adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), but uses ALiBi ([Ofir et al., 2021](https://arxiv.org/abs/2108.12409)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135)).
177
+
178
+ | **Hyperparameter** | **Value** | **Comment** |
179
+ |--------------------|-----------|----------------------------------------|
180
+ | Layers | 24 | |
181
+ | `d_model` | 2048 | |
182
+ | `head_dim` | 64 | Reduced to optimise for FlashAttention |
183
+ | Vocabulary | 50304 | |
184
+ | Sequence length | 2048 | |
185
+
186
+ ### Compute Infrastructure
187
+
188
+ #### Hardware
189
+
190
+ Falcon-RW-1B was trained on AWS SageMaker, on 32 A100 40GB GPUs in P4d instances.
191
+
192
+ #### Software
193
+
194
+ Falcon-RW-1B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
195
+
196
+
197
+ ## Citation
198
+
199
+ ```
200
+ @article{refinedweb,
201
+ title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
202
+ author={Guilherme Penedo and Quentin Malartic and Daniel Hesslow and Ruxandra Cojocaru and Alessandro Cappelli and Hamza Alobeidli and Baptiste Pannier and Ebtesam Almazrouei and Julien Launay},
203
+ journal={arXiv preprint arXiv:2306.01116},
204
+ eprint={2306.01116},
205
+ eprinttype = {arXiv},
206
+ url={https://arxiv.org/abs/2306.01116},
207
+ year={2023}
208
+ }
209
+ ```
210
+
211
+
212
+ ## Contact
213
214
+
215
+