transformers safetensors llama text-generation falcon3 en fr es pt license:other autotrain_compatible text-generation-inference endpoints_compatible region:us
---
language:
- en
- fr
- es
- pt
library_name: transformers
license: other
license_name: falcon-llm-license
license_link: https://falconllm.tii.ae/falcon-terms-and-conditions.html
tags:
- falcon3
---

<div align="center">
    <img src="https://huggingface.co/datasets/tiiuae/documentation-images/resolve/main/general/falco3-logo.png" alt="drawing" width="500"/>
</div>

# Falcon3-3B-Base

**Falcon3** family of Open Foundation Models is a set of pretrained and instruct LLMs ranging from 1B to 10B parameters.

This repository contains the **Falcon3-3B-Base**. It achieves strong results on reasoning, language understanding, instruction following, code and mathematics tasks.
Falcon3-3B-Base supports 4 languages (English, French, Spanish, Portuguese) and a context length of up to 8K.
It was pruned in terms of depth and width from Falcon3-7B-Base and was efficiently trained on only 100 GT using a knowledge distillation objective.

⚠️ **This is a raw, pretrained model, which should be further finetuned using SFT, RLHF, continued pretraining, etc. for most use cases.** 

## Model Details
- Architecture
  - Transformer-based causal decoder-only architecture
  - 22 decoder blocks
  - Grouped Query Attention (GQA) for faster inference: 12 query heads and 4 key-value heads
  - Wider head dimension: 256
  - High RoPE value to support long context understanding: 1000042
  - Uses SwiGLU and RMSNorm
  - 8K context length
  - 131K vocab size
- Pruned and healed from Falcon3-7B-Base on only 100 Gigatokens of datasets comprising of web, code, STEM, high quality and mutlilingual data using 1024 H100 GPU chips
- Supports EN, FR, ES, PT
- Developed by [Technology Innovation Institute](https://www.tii.ae)
- License: TII Falcon-LLM License 2.0
- Model Release Date: December 2024


## Getting started

<details>
<summary> Click to expand </summary>

```python
import torch
from transformers import pipeline

pipe = pipeline(
    "text-generation", 
    model="tiiuae/Falcon3-3B-Base", 
    torch_dtype=torch.bfloat16, 
    device_map="auto"
)
response = pipe("Question: How many hours in one day? Answer: ")
print(response[0]['generated_text'])
```

</details>

<br>

## Benchmarks
We report in the following table our internal pipeline benchmarks.
 - We use [lm-evaluation harness](https://github.com/EleutherAI/lm-evaluation-harness).
 - We report **raw scores**.
 - We use same batch-size across all models.



<table border="1" style="width: 100%; text-align: center; border-collapse: collapse;">
    <colgroup>
        <col style="width: 10%;">
        <col style="width: 10%;">
        <col style="width: 7%;">
        <col style="width: 7%;">
        <col style="width: 7%;">
        <col style="background-color: rgba(80, 15, 213, 0.5); width: 7%;">
    </colgroup>
    <thead>
        <tr>
            <th>Category</th>
            <th>Benchmark</th>
            <th>Llama3.2-3B</th>
            <th>Qwen2.5-3B</th>
            <th>Minitron-4B</th>
            <th>Falcon3-3B-Base</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td rowspan="3">General</td>
            <td>MMLU (5-shot)</td>
            <td>56.1</td>
            <td><b>65.6</b></td>
            <td>58.7</td>
            <td>55.5</td>
        </tr>
        <tr>
            <td>MMLU-PRO (5-shot)</td>
            <td>24.9</td>
            <td><b>32</b></td>
            <td>26.2</td>
            <td>28.8</td>
        </tr>
        <tr>
            <td>IFEval</td>
            <td>12.8</td>
            <td>27</td>
            <td>22.8</td>
            <td><b>27.7</b></td>
        </tr>
        <tr>
            <td rowspan="2">Math</td>
            <td>GSM8K (5-shot)</td>
            <td>26.7</td>
            <td><b>69</b></td>
            <td>25.7</td>
            <td>63.9</td>
        </tr>
        <tr>
            <td>MATH Lvl-5 (4-shot)</td>
            <td>1.4</td>
            <td>8.4</td>
            <td>1.7</td>
            <td><b>9.4</b></td>
        </tr>
        <tr>
            <td rowspan="4">Reasoning</td>
            <td>Arc Challenge (25-shot)</td>
            <td>50.8</td>
            <td><b>55.5</b></td>
            <td>50.3</td>
            <td>54.9</td>
        </tr>
        <tr>
            <td>GPQA (0-shot)</td>
            <td>27.5</td>
            <td>27.5</td>
            <td>28.6</td>
            <td><b>31.2</b></td>
        </tr>
        <tr>
            <td>MUSR (0-shot)</td>
            <td>35.2</td>
            <td><b>43</b></td>
            <td>42.1</td>
            <td>37.5</td>
        </tr>
        <tr>
            <td>BBH (3-shot)</td>
            <td>38.6</td>
            <td><b>46.1</b></td>
            <td>40.9</td>
            <td>44.2</td>
        </tr>
        <tr>
            <td rowspan="4">CommonSense Understanding</td>
            <td>PIQA (0-shot)</td>
            <td>77.4</td>
            <td><b>78.9</b></td>
            <td>78.3</td>
            <td>75.6</td>
        </tr>
        <tr>
            <td>SciQ (0-shot)</td>
            <td>92.7</td>
            <td>95.6</td>
            <td><b>96.1</b></td>
            <td>93.1</td>
        </tr>
        <tr>
            <td>Winogrande (0-shot)</td>
            <td><b>69.7</b></td>
            <td>68.8</td>
            <td>68.4</td>
            <td>64.6</td>
        </tr>
        <tr>
            <td>OpenbookQA (0-shot)</td>
            <td><b>43.2</b></td>
            <td>42.2</td>
            <td>43</td>
            <td>39.4</td>
        </tr>
    </tbody>
</table>

## Useful links
- View our [release blogpost](https://huggingface.co/blog/falcon3).
- Feel free to join [our discord server](https://discord.gg/fwXpMyGc) if you have any questions or to interact with our researchers and developers.

## Technical Report
Coming soon....

## Citation
If the Falcon3 family of models were helpful to your work, feel free to give us a cite.
 
```
@misc{Falcon3,
    title = {The Falcon 3 Family of Open Models},
    url = {https://huggingface.co/blog/falcon3},
    author = {Falcon-LLM Team},
    month = {December},
    year = {2024}
}
```