slimfrikha-tii commited on
Commit
f7e1c38
0 Parent(s):

falcon3 release

Browse files
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,267 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - fr
5
+ - es
6
+ - pt
7
+ tags:
8
+ - falcon3
9
+ base_model: tiiuae/Falcon3-1B-Base
10
+ license: other
11
+ license_name: falcon-llm-license
12
+ license_link: https://falconllm.tii.ae/falcon-terms-and-conditions.html
13
+ ---
14
+
15
+ <div align="center">
16
+ <img src="https://huggingface.co/datasets/tiiuae/documentation-images/resolve/main/general/falco3-logo.png" alt="drawing" width="500"/>
17
+ </div>
18
+
19
+ # Falcon3-1B-Instruct
20
+
21
+ **Falcon3** family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B parameters.
22
+
23
+ This repository contains the **Falcon3-1B-Instruct**. It achieves strong results on reasoning, language understanding, instruction following, code and mathematics tasks.
24
+ Falcon3-1B-Instruct supports 4 languages (English, French, Spanish, Portuguese) and a context length of up to 8K.
25
+
26
+ ## Model Details
27
+ - Architecture
28
+ - Transformer-based causal decoder-only architecture
29
+ - 18 decoder blocks
30
+ - Grouped Query Attention (GQA) for faster inference: 8 query heads and 4 key-value heads
31
+ - Wider head dimension: 256
32
+ - High RoPE value to support long context understanding: 1000042
33
+ - Uses SwiGLU and RMSNorm
34
+ - 8K context length
35
+ - 131K vocab size
36
+ - Pruned and healed using larger Falcon models (3B and 7B respectively) on only 80 Gigatokens of datasets comprising of web, code, STEM, high quality and multilingual data using 256 H100 GPU chips
37
+ - Posttrained on 1.2 million samples of STEM, conversational, code, safety and function call data
38
+ - Supports EN, FR, ES, PT
39
+ - Developed by [Technology Innovation Institute](https://www.tii.ae)
40
+ - License: TII Falcon-LLM License 2.0
41
+ - Model Release Date: December 2024
42
+
43
+
44
+ ## Getting started
45
+
46
+ <details>
47
+ <summary> Click to expand </summary>
48
+
49
+ ```python
50
+ from transformers import AutoTokenizer, AutoModelForCausalLM
51
+
52
+
53
+ from transformers import AutoModelForCausalLM, AutoTokenizer
54
+
55
+ model_name = "tiiuae/Falcon3-1B-Instruct"
56
+
57
+ model = AutoModelForCausalLM.from_pretrained(
58
+ model_name,
59
+ torch_dtype="auto",
60
+ device_map="auto"
61
+ )
62
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
63
+
64
+ prompt = "How many hours in one day?"
65
+ messages = [
66
+ {"role": "system", "content": "You are a helpful friendly assistant Falcon3 from TII, try to follow instructions as much as possible."},
67
+ {"role": "user", "content": prompt}
68
+ ]
69
+ text = tokenizer.apply_chat_template(
70
+ messages,
71
+ tokenize=False,
72
+ add_generation_prompt=True
73
+ )
74
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
75
+
76
+ generated_ids = model.generate(
77
+ **model_inputs,
78
+ max_new_tokens=1024
79
+ )
80
+ generated_ids = [
81
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
82
+ ]
83
+
84
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
85
+ print(response)
86
+ ```
87
+
88
+ </details>
89
+
90
+ <br>
91
+
92
+ ## Benchmarks
93
+ We report in the following table our internal pipeline benchmarks:
94
+
95
+ <table border="1" style="width: 100%; text-align: center; border-collapse: collapse;">
96
+ <colgroup>
97
+ <col style="width: 10%;">
98
+ <col style="width: 10%;">
99
+ <col style="width: 7%;">
100
+ <col style="width: 7%;">
101
+ <col style="width: 7%;">
102
+ <col style="background-color: rgba(80, 15, 213, 0.5); width: 7%;">
103
+ </colgroup>
104
+ <thead>
105
+ <tr>
106
+ <th>Category</th>
107
+ <th>Benchmark</th>
108
+ <th>Llama-3.2-1B</th>
109
+ <th>Qwen2.5-1.5B</th>
110
+ <th>SmolLM2-1.7B</th>
111
+ <th>Falcon3-1B-Instruct</th>
112
+ </tr>
113
+ </thead>
114
+ <tbody>
115
+ <tr>
116
+ <td rowspan="3">General</td>
117
+ <td>MMLU (5-shot)</td>
118
+ <td>23.4</td>
119
+ <td><b>58.4</b></td>
120
+ <td>48.4</td>
121
+ <td>43.9</td>
122
+ </tr>
123
+ <tr>
124
+ <td>MMLU-PRO (5-shot)</td>
125
+ <td>11.3</td>
126
+ <td><b>21.3</b></td>
127
+ <td>17.2</td>
128
+ <td>18.6</td>
129
+ </tr>
130
+ <tr>
131
+ <td>IFEval</td>
132
+ <td><b>55.8</b></td>
133
+ <td>44.4</td>
134
+ <td>53.0</td>
135
+ <td>54.4</td>
136
+ </tr>
137
+ <tr>
138
+ <td rowspan="3">Math</td>
139
+ <td>GSM8K (5-shot)</td>
140
+ <td>37.4</td>
141
+ <td><b>57.2</b></td>
142
+ <td>43.4</td>
143
+ <td>38.6</td>
144
+ </tr>
145
+ <tr>
146
+ <td>GSM8K (8-shot, COT)</td>
147
+ <td>35.6</td>
148
+ <td><b>62.2</b></td>
149
+ <td>47.2</td>
150
+ <td>41.8</td>
151
+ </tr>
152
+ <tr>
153
+ <td>MATH Lvl-5 (4-shot)</td>
154
+ <td><b>3.9</b></td>
155
+ <td>0.2</td>
156
+ <td>0.1</td>
157
+ <td>1.0</td>
158
+ </tr>
159
+ <tr>
160
+ <td rowspan="6">Reasoning</td>
161
+ <td>Arc Challenge (25-shot)</td>
162
+ <td>34.1</td>
163
+ <td>47.0</td>
164
+ <td><b>47.6</b></td>
165
+ <td>45.9</td>
166
+ </tr>
167
+ <tr>
168
+ <td>GPQA (0-shot)</td>
169
+ <td>25.3</td>
170
+ <td><b>29.6</b></td>
171
+ <td>28.7</td>
172
+ <td>26.5</td>
173
+ </tr>
174
+ <tr>
175
+ <td>GPQA (0-shot, COT)</td>
176
+ <td>13.2</td>
177
+ <td>9.2</td>
178
+ <td>16.0</td>
179
+ <td><b>21.3</b></td>
180
+ </tr>
181
+ <tr>
182
+ <td>MUSR (0-shot)</td>
183
+ <td>32.4</td>
184
+ <td>36.8</td>
185
+ <td>33.0</td>
186
+ <td><b>40.7</b></td>
187
+ </tr>
188
+ <tr>
189
+ <td>BBH (3-shot)</td>
190
+ <td>30.3</td>
191
+ <td><b>38.5</b></td>
192
+ <td>33.1</td>
193
+ <td>35.1</td>
194
+ </tr>
195
+ <tr>
196
+ <td>BBH (3-shot, COT)</td>
197
+ <td>0.0</td>
198
+ <td>20.3</td>
199
+ <td>0.8</td>
200
+ <td><b>30.5</b></td>
201
+ </tr>
202
+ <tr>
203
+ <td rowspan="5">CommonSense Understanding</td>
204
+ <td>PIQA (0-shot)</td>
205
+ <td>72.1</td>
206
+ <td>73.2</td>
207
+ <td><b>74.4</b></td>
208
+ <td>72.0</td>
209
+ </tr>
210
+ <tr>
211
+ <td>SciQ (0-shot)</td>
212
+ <td>61.8</td>
213
+ <td>69.5</td>
214
+ <td>71.4</td>
215
+ <td><b>86.8</b></td>
216
+ </tr>
217
+ <tr>
218
+ <td>Winogrande (0-shot)</td>
219
+ <td>-</td>
220
+ <td>-</td>
221
+ <td>-</td>
222
+ <td><b>60.2</b></td>
223
+ </tr>
224
+ <tr>
225
+ <td>OpenbookQA (0-shot)</td>
226
+ <td>40.2</td>
227
+ <td>40.4</td>
228
+ <td><b>42.8</b></td>
229
+ <td>40.0</td>
230
+ </tr>
231
+ <tr>
232
+ <td>MT-Bench (avg)</td>
233
+ <td>5.4</td>
234
+ <td><b>7.1</b></td>
235
+ <td>6.1</td>
236
+ <td>5.5</td>
237
+ </tr>
238
+ <tr>
239
+ <td rowspan="1">Instructions following</td>
240
+ <td>Alpaca (WC)</td>
241
+ <td><b>8.6</b></td>
242
+ <td><b>8.6</b></td>
243
+ <td>5.4</td>
244
+ <td>6.1</td>
245
+ </tr>
246
+ </tbody>
247
+ </table>
248
+
249
+ ## Useful links
250
+ - View our [release blogpost](https://huggingface.co/blog/falcon3).
251
+ - Feel free to join [our discord server](https://discord.gg/fwXpMyGc) if you have any questions or to interact with our researchers and developers.
252
+
253
+ ## Technical Report
254
+ Coming soon....
255
+
256
+ ## Citation
257
+ If the Falcon3 family of models were helpful to your work, feel free to give us a cite.
258
+
259
+ ```
260
+ @misc{Falcon3,
261
+ title = {The Falcon 3 Family of Open Models},
262
+ url = {https://huggingface.co/blog/falcon3},
263
+ author = {Falcon-LLM Team},
264
+ month = {December},
265
+ year = {2024}
266
+ }
267
+ ```
config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "LlamaForCausalLM"
4
+ ],
5
+ "attention_bias": false,
6
+ "attention_dropout": 0.0,
7
+ "eos_token_id": 11,
8
+ "head_dim": 256,
9
+ "hidden_act": "silu",
10
+ "hidden_size": 2048,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 8192,
13
+ "max_position_embeddings": 8192,
14
+ "mlp_bias": false,
15
+ "model_type": "llama",
16
+ "num_attention_heads": 8,
17
+ "num_hidden_layers": 18,
18
+ "num_key_value_heads": 4,
19
+ "pretraining_tp": 1,
20
+ "rms_norm_eps": 1e-06,
21
+ "rope_scaling": null,
22
+ "rope_theta": 1000042,
23
+ "tie_word_embeddings": false,
24
+ "torch_dtype": "bfloat16",
25
+ "transformers_version": "4.46.1",
26
+ "use_cache": true,
27
+ "vocab_size": 131072
28
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 11,
4
+ "eos_token_id": 11,
5
+ "transformers_version": "4.46.1"
6
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f551b3271b550bfcf7c65282cdc8b3627c6ba8887e6dfa7492809f7b16cb087
3
+ size 3338836632
special_tokens_map.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ ">>TITLE<<",
4
+ ">>ABSTRACT<<",
5
+ ">>INTRODUCTION<<",
6
+ ">>SUMMARY<<",
7
+ ">>COMMENT<<",
8
+ ">>ANSWER<<",
9
+ ">>QUESTION<<",
10
+ ">>DOMAIN<<",
11
+ ">>EMAIL_ADDRESS<<",
12
+ ">>IP_ADDRESS<<",
13
+ "<|startoftext|>",
14
+ ">>IP_ADDRESS_0<<",
15
+ ">>IP_ADDRESS_1<<",
16
+ ">>IP_ADDRESS_2<<",
17
+ ">>IP_ADDRESS_3<<",
18
+ ">>IP_ADDRESS_4<<",
19
+ ">>IP_ADDRESS_5<<",
20
+ ">>IP_ADDRESS_6<<",
21
+ ">>IP_ADDRESS_7<<",
22
+ ">>IP_ADDRESS_8<<",
23
+ ">>IP_ADDRESS_9<<",
24
+ ">>PASSWORD<<",
25
+ ">>KEY<<"
26
+ ],
27
+ "eos_token": {
28
+ "content": "<|endoftext|>",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false
33
+ },
34
+ "pad_token": {
35
+ "content": "<|pad|>",
36
+ "lstrip": false,
37
+ "normalized": false,
38
+ "rstrip": false,
39
+ "single_word": false
40
+ }
41
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff