lucyknada commited on
Commit
9f611b8
·
verified ·
1 Parent(s): f283596

Upload ./README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +253 -0
README.md ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - fr
5
+ - es
6
+ - pt
7
+ tags:
8
+ - falcon3
9
+ base_model: tiiuae/Falcon3-7B-Base
10
+ license: other
11
+ license_name: falcon-llm-license
12
+ license_link: https://falconllm.tii.ae/falcon-terms-and-conditions.html
13
+ library_name: transformers
14
+ ---
15
+ ### exl2 quant (measurement.json in main branch)
16
+ ---
17
+ ### check revisions for quants
18
+ ---
19
+
20
+
21
+ <div align="center">
22
+ <img src="https://huggingface.co/datasets/tiiuae/documentation-images/resolve/main/general/falco3-logo.png" alt="drawing" width="500"/>
23
+ </div>
24
+
25
+ # Falcon3-7B-Instruct
26
+
27
+ **Falcon3** family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B.
28
+
29
+ This repository contains the **Falcon3-7B-Instruct**. It achieves state of art results (at the time of release) on reasoning, language understanding, instruction following, code and mathematics tasks.
30
+ Falcon3-7B-Instruct supports 4 languages (english, french, spanish, portuguese) and a context length up to 32K.
31
+
32
+ ## Model Details
33
+ - Architecture
34
+ - Transformer based causal decoder only architecture
35
+ - 28 decoder blocks
36
+ - Grouped query attention (GQA) for faster inference: 12 query heads and 4 key value heads
37
+ - Wider head dimension: 256
38
+ - High RoPE value to support long context understanding: 1000042
39
+ - Uses SwiGLU and RMSNorm
40
+ - 32K context length
41
+ - 131K vocab size
42
+ - Pretrained on 14 Teratokens of datasets comprising of web, code, STEM, high quality and mutlilingual data using 1024 H100 GPU chips
43
+ - Postrained on 1.2 million samples of STEM, conversations, code, safety and function call data
44
+ - Supports EN, FR, ES, PT
45
+ - Developed by [Technology Innovation Institute](https://www.tii.ae)
46
+ - License: TII Falcon-LLM License 2.0
47
+ - Model Release Date: December 2024
48
+
49
+
50
+ ## Getting started
51
+
52
+ <details>
53
+ <summary> Click to expand </summary>
54
+
55
+ ```python
56
+ from transformers import AutoTokenizer, AutoModelForCausalLM
57
+
58
+
59
+ from transformers import AutoModelForCausalLM, AutoTokenizer
60
+
61
+ model_name = "tiiuae/Falcon3-7B-Instruct"
62
+
63
+ model = AutoModelForCausalLM.from_pretrained(
64
+ model_name,
65
+ torch_dtype="auto",
66
+ device_map="auto"]
67
+ )
68
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
69
+
70
+ prompt = "How many hours in one day?"
71
+ messages = [
72
+ {"role": "system", "content": "You are a helpful friendly assistant Falcon3 from TII, try to follow instructions as much as possible."},
73
+ {"role": "user", "content": prompt}
74
+ ]
75
+ text = tokenizer.apply_chat_template(
76
+ messages,
77
+ tokenize=False,
78
+ add_generation_prompt=True
79
+ )
80
+ model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
81
+
82
+ generated_ids = model.generate(
83
+ **model_inputs,
84
+ max_new_tokens=1024
85
+ )
86
+ generated_ids = [
87
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
88
+ ]
89
+
90
+ response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
91
+ print(response)
92
+ ```
93
+
94
+ </details>
95
+
96
+ <br>
97
+
98
+ ## Benchmarks
99
+ We report in the following table our internal pipeline benchmarks.
100
+ - We use [lm-evaluation harness](https://github.com/EleutherAI/lm-evaluation-harness).
101
+ - We report **raw scores** obtained by applying chat template **without fewshot_as_multiturn** (unlike Llama3.1).
102
+ - We use same batch-size across all models.
103
+
104
+ <table border="1" style="width: 100%; text-align: center; border-collapse: collapse;">
105
+ <colgroup>
106
+ <col style="width: 10%;">
107
+ <col style="width: 10%;">
108
+ <col style="width: 7%;">
109
+ <col style="width: 7%;">
110
+ <col style="background-color: rgba(80, 15, 213, 0.5); width: 7%;">
111
+ </colgroup>
112
+ <thead>
113
+ <tr>
114
+ <th>Category</th>
115
+ <th>Benchmark</th>
116
+ <th>Llama-3.1-8B-Instruct</th>
117
+ <th>Qwen2.5-7B-Instruct</th>
118
+ <th>Falcon3-7B-Instruct</th>
119
+ </tr>
120
+ </thead>
121
+ <tbody>
122
+ <tr>
123
+ <td rowspan="3">General</td>
124
+ <td>MMLU (5-shot)</td>
125
+ <td>55.9</td>
126
+ <td><b>72.4</b></td>
127
+ <td>68</td>
128
+ </tr>
129
+ <tr>
130
+ <td>MMLU-PRO (5-shot)</td>
131
+ <td>21.8</td>
132
+ <td>35.8</td>
133
+ <td><b>40.7</b></td>
134
+ </tr>
135
+ <tr>
136
+ <td>IFEval</td>
137
+ <td><b>78.8</b></td>
138
+ <td>74.7</td>
139
+ <td>76.5</td>
140
+ </tr>
141
+ <tr>
142
+ <td rowspan="3">Math</td>
143
+ <td>GSM8K (5-shot)</td>
144
+ <td>78.1</td>
145
+ <td>77.5</td>
146
+ <td><b>79.1</b></td>
147
+ </tr>
148
+ <tr>
149
+ <td>GSM8K (8-shot, COT)</td>
150
+ <td>79.8</td>
151
+ <td>72.7</td>
152
+ <td><b>80.9</b></td>
153
+ </tr>
154
+ <tr>
155
+ <td>MATH Lvl-5 (4-shot)</td>
156
+ <td>10.4</td>
157
+ <td>26</td>
158
+ <td><b>29.4</b></td>
159
+ </tr>
160
+ <tr>
161
+ <td rowspan="5">Reasoning</td>
162
+ <td>Arc Challenge (25-shot)</td>
163
+ <td>46.6</td>
164
+ <td>55.7</td>
165
+ <td><b>65.9</b></td>
166
+ </tr>
167
+ <tr>
168
+ <td>GPQA (0-shot)</td>
169
+ <td><b>33.6</b></td>
170
+ <td>31.9</td>
171
+ <td>32</td>
172
+ </tr>
173
+ <tr>
174
+ <td>GPQA (0-shot, COT)</td>
175
+ <td>9.6</td>
176
+ <td>13.8</td>
177
+ <td><b>22.3</b></td>
178
+ </tr>
179
+ <tr>
180
+ <td>MUSR (0-shot)</td>
181
+ <td>38.6</td>
182
+ <td>40.7</td>
183
+ <td><b>46.4</b></td>
184
+ </tr>
185
+ <tr>
186
+ <td>BBH (3-shot)</td>
187
+ <td>43.7</td>
188
+ <td><b>53.9</b></td>
189
+ <td>52.4</td>
190
+ </tr>
191
+ <tr>
192
+ <td rowspan="4">CommonSense Understanding</td>
193
+ <td>PIQA (0-shot)</td>
194
+ <td><b>78.9</b></td>
195
+ <td>73.7</td>
196
+ <td>78.8</td>
197
+ </tr>
198
+ <tr>
199
+ <td>SciQ (0-shot)</td>
200
+ <td>80.2</td>
201
+ <td>50.9</td>
202
+ <td><b>94.7</b></td>
203
+ </tr>
204
+ <tr>
205
+ <td>Winogrande (0-shot)</td>
206
+ <td>-</td>
207
+ <td>-</td>
208
+ <td>70.4</td>
209
+ </tr>
210
+ <tr>
211
+ <td>OpenbookQA (0-shot)</td>
212
+ <td><b>46.2</b></td>
213
+ <td>42.4</td>
214
+ <td>45.8</td>
215
+ </tr>
216
+ <tr>
217
+ <td rowspan="2">Instructions following</td>
218
+ <td>MT-Bench (avg)</td>
219
+ <td>7.9</td>
220
+ <td><b>8.5</b></td>
221
+ <td>8.4</td>
222
+ </tr>
223
+ <tr>
224
+ <td>Alpaca (WC)</td>
225
+ <td>26.6</td>
226
+ <td><b>31.5</b></td>
227
+ <td>26.1</td>
228
+ </tr>
229
+ <tr>
230
+ <td>Tool use</td>
231
+ <td>BFCL AST (avg)</td>
232
+ <td>90.6</td>
233
+ <td><b>91.4</b></td>
234
+ <td>72.3</td>
235
+ </tr>
236
+ </tbody>
237
+ </table>
238
+
239
+
240
+ ## Technical Report
241
+ Coming soon....
242
+
243
+ ## Citation
244
+ If Falcon3 family were helpful to your work, feel free to give us a cite.
245
+
246
+ ```
247
+ @misc{Falcon3,
248
+ title = {The Falcon 3 family of Open Models},
249
+ author = {TII Team},
250
+ month = {December},
251
+ year = {2024}
252
+ }
253
+ ```