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|
2 |
+
---
|
3 |
+
|
4 |
+
datasets:
|
5 |
+
- tiiuae/falcon-refinedweb
|
6 |
+
language:
|
7 |
+
- en
|
8 |
+
- de
|
9 |
+
- es
|
10 |
+
- fr
|
11 |
+
- it
|
12 |
+
- nl
|
13 |
+
- pl
|
14 |
+
- pt
|
15 |
+
- ro
|
16 |
+
- cs
|
17 |
+
inference: false
|
18 |
+
license: unknown
|
19 |
+
|
20 |
+
---
|
21 |
+
|
22 |
+
![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)
|
23 |
+
|
24 |
+
# QuantFactory/falcon-11B-GGUF
|
25 |
+
This is quantized version of [tiiuae/falcon-11B](https://huggingface.co/tiiuae/falcon-11B) created using llama.cpp
|
26 |
+
|
27 |
+
# Original Model Card
|
28 |
+
|
29 |
+
|
30 |
+
# 🚀 Falcon2-11B
|
31 |
+
|
32 |
+
**Falcon2-11B is an 11B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on over 5,000B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb) enhanced with curated corpora. The model is made available under the [TII Falcon License 2.0](https://falconllm-staging.tii.ae/falcon-2-terms-and-conditions.html), the permissive Apache 2.0-based software license which includes an [acceptable use policy](https://falconllm-staging.tii.ae/falcon-2-acceptable-use-policy.html) that promotes the responsible use of AI.**
|
33 |
+
|
34 |
+
*[arXiv technical report](https://arxiv.org/abs/2407.14885)*
|
35 |
+
|
36 |
+
|
37 |
+
🤗 To get started with Falcon (inference, finetuning, quantization, etc.), we recommend reading [this great blogpost from HF](https://huggingface.co/blog/falcon)!
|
38 |
+
|
39 |
+
⚠️ **This is a raw, pretrained model, which should be further finetuned for most usecases.**
|
40 |
+
|
41 |
+
```python
|
42 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
43 |
+
import transformers
|
44 |
+
import torch
|
45 |
+
|
46 |
+
model = "tiiuae/falcon-11B"
|
47 |
+
|
48 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
49 |
+
pipeline = transformers.pipeline(
|
50 |
+
"text-generation",
|
51 |
+
model=model,
|
52 |
+
tokenizer=tokenizer,
|
53 |
+
torch_dtype=torch.bfloat16,
|
54 |
+
)
|
55 |
+
sequences = pipeline(
|
56 |
+
"Can you explain the concepts of Quantum Computing?",
|
57 |
+
max_length=200,
|
58 |
+
do_sample=True,
|
59 |
+
top_k=10,
|
60 |
+
num_return_sequences=1,
|
61 |
+
eos_token_id=tokenizer.eos_token_id,
|
62 |
+
)
|
63 |
+
for seq in sequences:
|
64 |
+
print(f"Result: {seq['generated_text']}")
|
65 |
+
|
66 |
+
```
|
67 |
+
|
68 |
+
💥 **Falcon LLMs require PyTorch 2.0 for use with `transformers`!**
|
69 |
+
|
70 |
+
For fast inference with Falcon, check-out [Text Generation Inference](https://github.com/huggingface/text-generation-inference)! Read more in this [blogpost]((https://huggingface.co/blog/falcon).
|
71 |
+
|
72 |
+
# Model Card for Falcon2-11B
|
73 |
+
|
74 |
+
## Model Details
|
75 |
+
|
76 |
+
### Model Description
|
77 |
+
|
78 |
+
- **Developed by:** [https://www.tii.ae](https://www.tii.ae)
|
79 |
+
- **Model type:** Causal decoder-only
|
80 |
+
- **Language(s) (NLP):** English, German, Spanish, French, Italian, Portuguese, Polish, Dutch, Romanian, Czech, Swedish
|
81 |
+
- **License:** [TII Falcon License 2.0](https://falconllm-staging.tii.ae/falcon-2-terms-and-conditions.html)
|
82 |
+
|
83 |
+
### Model Source
|
84 |
+
|
85 |
+
- **Paper:** *coming soon*.
|
86 |
+
|
87 |
+
## Uses
|
88 |
+
|
89 |
+
### Direct Use
|
90 |
+
|
91 |
+
Research on large language models; as a foundation for further specialization and finetuning for specific usecases (e.g., summarization, text generation, chatbot, etc.)
|
92 |
+
|
93 |
+
### Out-of-Scope Use
|
94 |
+
|
95 |
+
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
|
96 |
+
|
97 |
+
## Bias, Risks, and Limitations
|
98 |
+
|
99 |
+
Falcon2-11B is trained mostly on English, but also German, Spanish, French, 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.
|
100 |
+
|
101 |
+
### Recommendations
|
102 |
+
|
103 |
+
We recommend users of Falcon2-11B 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.
|
104 |
+
|
105 |
+
## How to Get Started with the Model
|
106 |
+
|
107 |
+
|
108 |
+
```python
|
109 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
110 |
+
import transformers
|
111 |
+
import torch
|
112 |
+
|
113 |
+
model = "tiiuae/falcon-11B"
|
114 |
+
|
115 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
116 |
+
pipeline = transformers.pipeline(
|
117 |
+
"text-generation",
|
118 |
+
model=model,
|
119 |
+
tokenizer=tokenizer,
|
120 |
+
torch_dtype=torch.bfloat16,
|
121 |
+
device_map="auto",
|
122 |
+
)
|
123 |
+
sequences = pipeline(
|
124 |
+
"Can you explain the concepts of Quantum Computing?",
|
125 |
+
max_length=200,
|
126 |
+
do_sample=True,
|
127 |
+
top_k=10,
|
128 |
+
num_return_sequences=1,
|
129 |
+
eos_token_id=tokenizer.eos_token_id,
|
130 |
+
)
|
131 |
+
for seq in sequences:
|
132 |
+
print(f"Result: {seq['generated_text']}")
|
133 |
+
|
134 |
+
```
|
135 |
+
|
136 |
+
## Training Details
|
137 |
+
|
138 |
+
### Training Data
|
139 |
+
|
140 |
+
Falcon2-11B was trained over 5,000B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb), a high-quality filtered and deduplicated web dataset which we enhanced with curated corpora. It followed a four stage training strategy. The first three stages were focused on increasing the context length, from to 2048 to 4096 and finally to 8192 tokens. The last stage aimed to further enhance performance using only high quality data.
|
141 |
+
|
142 |
+
Overall, the data sources included RefinedWeb-English, Refined Web-Europe (cs, de, es, fr, it, nl, pl, pt, ro, sv), high quality technical data, code data, and conversational data extracted from public sources.
|
143 |
+
|
144 |
+
|
145 |
+
The training stages were as follows:
|
146 |
+
|
147 |
+
| **Stage** | **Context length** | **Tokens** |
|
148 |
+
|--------------|-----------------|-------------|
|
149 |
+
| Stage 1 | 2048 | 4500 B |
|
150 |
+
| Stage 2 | 4096 | 250 B |
|
151 |
+
| Stage 3 | 8192 | 250 B |
|
152 |
+
| Stage 4 | 8192 | 500 B |
|
153 |
+
|
154 |
+
|
155 |
+
The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[11B](https://huggingface.co/tiiuae/falcon-11B) tokenizer.
|
156 |
+
|
157 |
+
### Training Procedure
|
158 |
+
|
159 |
+
Falcon2-11B was trained on 1024 A100 40GB GPUs for the majority of the training, using a 3D parallelism strategy (TP=8, PP=1, DP=128) combined with ZeRO and Flash-Attention 2.
|
160 |
+
|
161 |
+
#### Training Hyperparameters
|
162 |
+
|
163 |
+
| **Hyperparameter** | **Value** | **Comment** |
|
164 |
+
|--------------------|------------|-------------------------------------------|
|
165 |
+
| Precision | `bfloat16` | |
|
166 |
+
| Optimizer | AdamW | |
|
167 |
+
| Max learning rate | 3.7e-4 | Following a linear warm-up, then cosine decay to 1.89e-5 across 4500 B tokens. |
|
168 |
+
| Weight decay | 1e-1 | |
|
169 |
+
| Z-loss | 1e-4 | |
|
170 |
+
| Batch size | Variable | Batch size was gradually increased during the training |
|
171 |
+
|
172 |
+
|
173 |
+
#### Speeds, Sizes, Times
|
174 |
+
|
175 |
+
The model training took roughly two months.
|
176 |
+
|
177 |
+
|
178 |
+
## Evaluation
|
179 |
+
|
180 |
+
|English Benchmark | **Value** |
|
181 |
+
|--------------------|------------|
|
182 |
+
| ARC-Challenge-25shots | 59.73 |
|
183 |
+
| HellaSwag-10shots | 82.91 |
|
184 |
+
| MMLU-5shots | 58.37 |
|
185 |
+
| Winogrande-5shots | 78.30 |
|
186 |
+
| TruthfulQA-0shot | 52.56 |
|
187 |
+
| GSM8k-5shots | 53.83 |
|
188 |
+
| ARC-Challenge-0shot | 50.17 |
|
189 |
+
| ARC-Easy-0shot | 77.78 |
|
190 |
+
| Hellaswag-0shot | 82.07 |
|
191 |
+
|
192 |
+
We thank the leaderboard team from HuggingFace for providing an official evaluation of our model on the leaderboard tasks.
|
193 |
+
|
194 |
+
## Technical Specifications
|
195 |
+
|
196 |
+
### Model Architecture and Objective
|
197 |
+
|
198 |
+
Falcon2-11B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
|
199 |
+
|
200 |
+
The architecture is broadly adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), with the following differences:
|
201 |
+
|
202 |
+
* **Positional embeddings:** rotary ([Su et al., 2021](https://arxiv.org/abs/2104.09864));
|
203 |
+
* **Attention:** multiquery ([Shazeer et al., 2019](https://arxiv.org/abs/1911.02150)) and FlashAttention-2 ([Dao, 2023](https://arxiv.org/abs/2307.08691));
|
204 |
+
* **Decoder-block:** parallel attention/MLP.
|
205 |
+
|
206 |
+
| **Hyperparameter** | **Value** | **Comment** |
|
207 |
+
|--------------------|-----------|----------------------------------------|
|
208 |
+
| Layers | 60 | |
|
209 |
+
| `d_model` | 4096 | |
|
210 |
+
| `head_dim` | 128 | |
|
211 |
+
| Vocabulary | 65024 | |
|
212 |
+
| Sequence length | 8192 | During stages 3 and 4 |
|
213 |
+
|
214 |
+
### Compute Infrastructure
|
215 |
+
|
216 |
+
#### Hardware
|
217 |
+
|
218 |
+
Falcon2-11B was trained on AWS SageMaker, using on average 1024 A100 40GB GPUs in 128 p4d instances.
|
219 |
+
|
220 |
+
#### Software
|
221 |
+
|
222 |
+
Falcon2-11B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO, high-performance Triton kernels and FlashAttention-2. More details about the distributed training strategy can be found in [Almazrouei et.al](https://arxiv.org/abs/2311.16867).
|
223 |
+
|
224 |
+
## Citation
|
225 |
+
|
226 |
+
[Falcon2-11B Technical Report, Malartic et al. 2024](https://www.arxiv.org/abs/2407.14885)
|
227 |
+
|
228 |
+
## License
|
229 |
+
|
230 |
+
Falcon2-11B is licenced under [TII Falcon License 2.0](https://falconllm-staging.tii.ae/falcon-2-terms-and-conditions.html), the permissive Apache 2.0-based software license which includes an [acceptable use policy](https://falconllm-staging.tii.ae/falcon-2-acceptable-use-policy.html) that promotes the responsible use of AI.
|
231 |
+
|
232 |
+
## Contact
|
233 |
+
falconllm@tii.ae
|