Spaces:
Runtime error
Runtime error
pokeberrypie
commited on
Commit
•
dfffe01
1
Parent(s):
9669d3c
Update README.md
Browse files
README.md
CHANGED
@@ -1,234 +1,246 @@
|
|
1 |
-
---
|
2 |
-
datasets:
|
3 |
-
- tiiuae/falcon-refinedweb
|
4 |
-
language:
|
5 |
-
- en
|
6 |
-
- de
|
7 |
-
- es
|
8 |
-
- fr
|
9 |
-
inference: false
|
10 |
-
license: unknown
|
11 |
-
extra_gated_heading:
|
12 |
-
extra_gated_prompt:
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
*
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
###
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
##
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
###
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
|
132 |
-
|
|
133 |
-
|
|
134 |
-
|
|
135 |
-
|
|
136 |
-
|
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
####
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
falconllm@tii.ae
|
|
|
1 |
+
---
|
2 |
+
datasets:
|
3 |
+
- tiiuae/falcon-refinedweb
|
4 |
+
language:
|
5 |
+
- en
|
6 |
+
- de
|
7 |
+
- es
|
8 |
+
- fr
|
9 |
+
inference: false
|
10 |
+
license: unknown
|
11 |
+
extra_gated_heading: Acknowledge license to access the repository
|
12 |
+
extra_gated_prompt: >-
|
13 |
+
You agree to the [Falcon-180B TII
|
14 |
+
license](https://huggingface.co/spaces/tiiuae/falcon-180b-license/blob/main/LICENSE.txt)
|
15 |
+
and [acceptable use
|
16 |
+
policy](https://huggingface.co/spaces/tiiuae/falcon-180b-license/blob/main/ACCEPTABLE_USE_POLICY.txt).
|
17 |
+
extra_gated_button_content: >-
|
18 |
+
I agree to the terms and conditions of the Falcon-180B TII license and to the
|
19 |
+
acceptable use policy
|
20 |
+
title: falcon
|
21 |
+
sdk: gradio
|
22 |
+
emoji: ⚡
|
23 |
+
colorFrom: green
|
24 |
+
colorTo: green
|
25 |
+
short_description: hope
|
26 |
+
---
|
27 |
+
|
28 |
+
# 🚀 Falcon-180B
|
29 |
+
|
30 |
+
**Falcon-180B is a 180B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on 3,500B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) enhanced with curated corpora. It is made available under the [Falcon-180B TII License](https://huggingface.co/spaces/tiiuae/falcon-180b-license/blob/main/LICENSE.txt) and [Acceptable Use Policy](https://huggingface.co/spaces/tiiuae/falcon-180b-license/blob/main/ACCEPTABLE_USE_POLICY.txt).**
|
31 |
+
|
32 |
+
*Paper coming soon* 😊
|
33 |
+
|
34 |
+
|
35 |
+
🤗 To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost from HF](https://hf.co/blog/falcon-180b) or this [one](https://huggingface.co/blog/falcon) from the release of the 40B!
|
36 |
+
Note that since the 180B is larger than what can easily be handled with `transformers`+`acccelerate`, we recommend using [Text Generation Inference](https://github.com/huggingface/text-generation-inference).
|
37 |
+
|
38 |
+
You will need **at least 400GB of memory** to swiftly run inference with Falcon-180B.
|
39 |
+
|
40 |
+
## Why use Falcon-180B?
|
41 |
+
|
42 |
+
* **It is the best open-access model currently available, and one of the best model overall.** Falcon-180B outperforms [LLaMA-2](https://huggingface.co/meta-llama/Llama-2-70b-hf), [StableLM](https://github.com/Stability-AI/StableLM), [RedPajama](https://huggingface.co/togethercomputer/RedPajama-INCITE-Base-7B-v0.1), [MPT](https://huggingface.co/mosaicml/mpt-7b), etc. See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
|
43 |
+
* **It features an architecture optimized for inference**, with multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)).
|
44 |
+
* **It is made available under a permissive license allowing for commercial use**.
|
45 |
+
* ⚠️ **This is a raw, pretrained model, which should be further finetuned for most usecases.** If you are looking for a version better suited to taking generic instructions in a chat format, we recommend taking a look at [Falcon-180B-Chat](https://huggingface.co/tiiuae/falcon-180b-chat).
|
46 |
+
|
47 |
+
|
48 |
+
💸 **Looking for a smaller, less expensive model?** [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b) and [Falcon-40B](https://huggingface.co/tiiuae/falcon-40b) are Falcon-180B's little brothers!
|
49 |
+
|
50 |
+
💥 **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
|
51 |
+
|
52 |
+
|
53 |
+
# Model Card for Falcon-180B
|
54 |
+
|
55 |
+
## Model Details
|
56 |
+
|
57 |
+
### Model Description
|
58 |
+
|
59 |
+
- **Developed by:** [https://www.tii.ae](https://www.tii.ae);
|
60 |
+
- **Model type:** Causal decoder-only;
|
61 |
+
- **Language(s) (NLP):** English, German, Spanish, French (and limited capabilities in Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish);
|
62 |
+
- **License:** [Falcon-180B TII License](https://huggingface.co/tiiuae/falcon-180B/blob/main/LICENSE.txt) and [Acceptable Use Policy](https://huggingface.co/tiiuae/falcon-180B/blob/main/ACCEPTABLE_USE_POLICY.txt).
|
63 |
+
|
64 |
+
### Model Source
|
65 |
+
|
66 |
+
- **Paper:** *coming soon*.
|
67 |
+
|
68 |
+
## Uses
|
69 |
+
|
70 |
+
See the [acceptable use policy](https://huggingface.co/tiiuae/falcon-180B/blob/main/ACCEPTABLE_USE_POLICY.txt).
|
71 |
+
|
72 |
+
### Direct Use
|
73 |
+
|
74 |
+
Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
|
75 |
+
|
76 |
+
### Out-of-Scope Use
|
77 |
+
|
78 |
+
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
|
79 |
+
|
80 |
+
## Bias, Risks, and Limitations
|
81 |
+
|
82 |
+
Falcon-180B is trained mostly on English, German, Spanish, French, with limited capabilities also in in Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish. It 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.
|
83 |
+
|
84 |
+
### Recommendations
|
85 |
+
|
86 |
+
We recommend users of Falcon-180B 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.
|
87 |
+
|
88 |
+
## How to Get Started with the Model
|
89 |
+
|
90 |
+
To run inference with the model in full `bfloat16` precision you need approximately 8xA100 80GB or equivalent.
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
```python
|
95 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
96 |
+
import transformers
|
97 |
+
import torch
|
98 |
+
|
99 |
+
model = "tiiuae/falcon-180b"
|
100 |
+
|
101 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
102 |
+
pipeline = transformers.pipeline(
|
103 |
+
"text-generation",
|
104 |
+
model=model,
|
105 |
+
tokenizer=tokenizer,
|
106 |
+
torch_dtype=torch.bfloat16,
|
107 |
+
trust_remote_code=True,
|
108 |
+
device_map="auto",
|
109 |
+
)
|
110 |
+
sequences = pipeline(
|
111 |
+
"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:",
|
112 |
+
max_length=200,
|
113 |
+
do_sample=True,
|
114 |
+
top_k=10,
|
115 |
+
num_return_sequences=1,
|
116 |
+
eos_token_id=tokenizer.eos_token_id,
|
117 |
+
)
|
118 |
+
for seq in sequences:
|
119 |
+
print(f"Result: {seq['generated_text']}")
|
120 |
+
|
121 |
+
```
|
122 |
+
|
123 |
+
## Training Details
|
124 |
+
|
125 |
+
### Training Data
|
126 |
+
|
127 |
+
Falcon-180B was trained on 3,500B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb), a high-quality filtered and deduplicated web dataset which we enhanced with curated corpora. Significant components from our curated copora were inspired by The Pile ([Gao et al., 2020](https://arxiv.org/abs/2101.00027)).
|
128 |
+
|
129 |
+
| **Data source** | **Fraction** | **Tokens** | **Sources** |
|
130 |
+
|--------------------|--------------|------------|-----------------------------------|
|
131 |
+
| [RefinedWeb-English](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) | 75% | 750B | massive web crawl |
|
132 |
+
| RefinedWeb-Europe | 7% | 70B | European massive web crawl |
|
133 |
+
| Books | 6% | 60B | |
|
134 |
+
| Conversations | 5% | 50B | Reddit, StackOverflow, HackerNews |
|
135 |
+
| Code | 5% | 50B | |
|
136 |
+
| Technical | 2% | 20B | arXiv, PubMed, USPTO, etc. |
|
137 |
+
|
138 |
+
RefinedWeb-Europe is made of the following languages:
|
139 |
+
|
140 |
+
| **Language** | **Fraction of multilingual data** | **Tokens** |
|
141 |
+
|--------------|-----------------------------------|------------|
|
142 |
+
| German | 26% | 18B |
|
143 |
+
| Spanish | 24% | 17B |
|
144 |
+
| French | 23% | 16B |
|
145 |
+
| _Italian_ | 7% | 5B |
|
146 |
+
| _Portuguese_ | 4% | 3B |
|
147 |
+
| _Polish_ | 4% | 3B |
|
148 |
+
| _Dutch_ | 4% | 3B |
|
149 |
+
| _Romanian_ | 3% | 2B |
|
150 |
+
| _Czech_ | 3% | 2B |
|
151 |
+
| _Swedish_ | 2% | 1B |
|
152 |
+
|
153 |
+
|
154 |
+
The data was tokenized with the Falcon tokenizer.
|
155 |
+
|
156 |
+
### Training Procedure
|
157 |
+
|
158 |
+
Falcon-180B was trained on up to 4,096 A100 40GB GPUs, using a 3D parallelism strategy (TP=8, PP=8, DP=64) combined with ZeRO.
|
159 |
+
|
160 |
+
#### Training Hyperparameters
|
161 |
+
|
162 |
+
| **Hyperparameter** | **Value** | **Comment** |
|
163 |
+
|--------------------|------------|-------------------------------------------|
|
164 |
+
| Precision | `bfloat16` | |
|
165 |
+
| Optimizer | AdamW | |
|
166 |
+
| Learning rate | 1.25e-4 | 4B tokens warm-up, cosine decay to 1.25e-5 |
|
167 |
+
| Weight decay | 1e-1 | |
|
168 |
+
| Z-loss | 1e-4 | |
|
169 |
+
| Batch size | 2048 | 100B tokens ramp-up |
|
170 |
+
|
171 |
+
|
172 |
+
#### Speeds, Sizes, Times
|
173 |
+
|
174 |
+
Training started in early 2023.
|
175 |
+
|
176 |
+
## Evaluation
|
177 |
+
|
178 |
+
*Paper coming soon.*
|
179 |
+
|
180 |
+
See the [OpenLLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard) for early results.
|
181 |
+
|
182 |
+
|
183 |
+
## Technical Specifications
|
184 |
+
|
185 |
+
### Model Architecture and Objective
|
186 |
+
|
187 |
+
Falcon-180B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
|
188 |
+
|
189 |
+
The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
|
190 |
+
|
191 |
+
* **Positionnal embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
|
192 |
+
* **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135));
|
193 |
+
* **Decoder-block:** parallel attention/MLP with two layer norms.
|
194 |
+
|
195 |
+
For multiquery, we are using an internal variant which uses independent key and values per tensor parallel degree (so-called multigroup).
|
196 |
+
|
197 |
+
| **Hyperparameter** | **Value** | **Comment** |
|
198 |
+
|--------------------|-----------|----------------------------------------|
|
199 |
+
| Layers | 80 | |
|
200 |
+
| `d_model` | 14848 | |
|
201 |
+
| `head_dim` | 64 | Reduced to optimise for FlashAttention |
|
202 |
+
| Vocabulary | 65024 | |
|
203 |
+
| Sequence length | 2048 | |
|
204 |
+
|
205 |
+
### Compute Infrastructure
|
206 |
+
|
207 |
+
#### Hardware
|
208 |
+
|
209 |
+
Falcon-180B was trained on AWS SageMaker, on up to 4,096 A100 40GB GPUs in P4d instances.
|
210 |
+
|
211 |
+
#### Software
|
212 |
+
|
213 |
+
Falcon-180B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
|
214 |
+
|
215 |
+
|
216 |
+
## Citation
|
217 |
+
|
218 |
+
*Paper coming soon* 😊 (actually this time). In the meanwhile, you can use the following information to cite:
|
219 |
+
```
|
220 |
+
@article{falcon,
|
221 |
+
title={The Falcon Series of Language Models: Towards Open Frontier Models},
|
222 |
+
author={Almazrouei, Ebtesam and Alobeidli, Hamza and Alshamsi, Abdulaziz and Cappelli, Alessandro and Cojocaru, Ruxandra and Alhammadi, Maitha and Daniele, Mazzotta and Heslow, Daniel and Launay, Julien and Malartic, Quentin and Noune, Badreddine and Pannier, Baptiste and Penedo, Guilherme},
|
223 |
+
year={2023}
|
224 |
+
}
|
225 |
+
```
|
226 |
+
|
227 |
+
|
228 |
+
|
229 |
+
|
230 |
+
To learn more about the pretraining dataset, see the 📓 [RefinedWeb paper](https://arxiv.org/abs/2306.01116).
|
231 |
+
|
232 |
+
```
|
233 |
+
@article{refinedweb,
|
234 |
+
title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
|
235 |
+
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},
|
236 |
+
journal={arXiv preprint arXiv:2306.01116},
|
237 |
+
eprint={2306.01116},
|
238 |
+
eprinttype = {arXiv},
|
239 |
+
url={https://arxiv.org/abs/2306.01116},
|
240 |
+
year={2023}
|
241 |
+
}
|
242 |
+
```
|
243 |
+
|
244 |
+
|
245 |
+
## Contact
|
246 |
falconllm@tii.ae
|