slippylolo
commited on
Commit
•
670d848
1
Parent(s):
c09fd96
Update model card significantly
Browse files
README.md
CHANGED
@@ -9,43 +9,175 @@ language:
|
|
9 |
|
10 |
**Falcon-RW-7B is a 7B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on 350B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb). It is made available under the [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-rw-7b/blob/main/LICENSE.txt).**
|
11 |
|
|
|
|
|
12 |
RefinedWeb is a high-quality web dataset built by leveraging stringent filtering and large-scale deduplication. Falcon-RW-7B, trained on RefinedWeb only, matches or outperforms comparable models trained on curated data.
|
13 |
|
14 |
-
This model is intended for use as a research artifact
|
15 |
|
|
|
|
|
|
|
|
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
## Model Details
|
21 |
|
22 |
### Model Description
|
23 |
|
24 |
-
- **Developed by:** [https://www.tii.ae](https://www.tii.ae)
|
25 |
-
- **Model type:** Causal decoder-only
|
26 |
-
- **Language(s) (NLP):** English
|
27 |
-
- **License:** TII Falcon LLM License
|
28 |
|
29 |
### Model Source
|
30 |
|
31 |
-
- **Paper:** coming soon
|
32 |
-
- **Demo:** coming soon
|
33 |
|
34 |
## Uses
|
35 |
|
36 |
### Direct Use
|
37 |
|
38 |
-
Research on large language models,
|
39 |
|
40 |
### Out-of-Scope Use
|
41 |
|
42 |
-
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful
|
|
|
|
|
43 |
|
44 |
## Bias, Risks, and Limitations
|
45 |
|
46 |
-
Falcon-RW
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
|
49 |
-
##
|
|
|
50 |
|
51 |
-
More details coming soon in the paper.
|
|
|
9 |
|
10 |
**Falcon-RW-7B is a 7B parameters causal decoder-only model built by [TII](https://www.tii.ae) and trained on 350B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb). It is made available under the [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-rw-7b/blob/main/LICENSE.txt).**
|
11 |
|
12 |
+
*Paper coming soon 😊.*
|
13 |
+
|
14 |
RefinedWeb is a high-quality web dataset built by leveraging stringent filtering and large-scale deduplication. Falcon-RW-7B, trained on RefinedWeb only, matches or outperforms comparable models trained on curated data.
|
15 |
|
16 |
+
⚠️ This model is intended for use as a **research artifact**, to study the influence of training on web data alone. **If you are interested in state-of-the-art models, we recommend using Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b), both trained on >1,000 billion tokens.**
|
17 |
|
18 |
+
```python
|
19 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
20 |
+
import transformers
|
21 |
+
import torch
|
22 |
|
23 |
+
model = "tiiuae/falcon-rw-7b"
|
24 |
+
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
26 |
+
pipeline = transformers.pipeline(
|
27 |
+
"text-generation",
|
28 |
+
model=model,
|
29 |
+
tokenizer=tokenizer,
|
30 |
+
torch_dtype=torch.bfloat16,
|
31 |
+
trust_remote_code=True,
|
32 |
+
device_map="auto",
|
33 |
+
)
|
34 |
+
sequences = pipeline(
|
35 |
+
"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:",
|
36 |
+
max_length=200,
|
37 |
+
do_sample=True,
|
38 |
+
top_k=10,
|
39 |
+
num_return_sequences=1,
|
40 |
+
eos_token_id=tokenizer.eos_token_id,
|
41 |
+
)
|
42 |
+
for seq in sequences:
|
43 |
+
print(f"Result: {seq['generated_text']}")
|
44 |
|
45 |
+
```
|
46 |
+
|
47 |
+
|
48 |
+
|
49 |
+
# Model Card for Falcon-RW-7B
|
50 |
|
51 |
## Model Details
|
52 |
|
53 |
### Model Description
|
54 |
|
55 |
+
- **Developed by:** [https://www.tii.ae](https://www.tii.ae);
|
56 |
+
- **Model type:** Causal decoder-only;
|
57 |
+
- **Language(s) (NLP):** English;
|
58 |
+
- **License:** [TII Falcon LLM License](https://huggingface.co/tiiuae/falcon-rw-7b/blob/main/LICENSE.txt).
|
59 |
|
60 |
### Model Source
|
61 |
|
62 |
+
- **Paper:** *coming soon*.
|
|
|
63 |
|
64 |
## Uses
|
65 |
|
66 |
### Direct Use
|
67 |
|
68 |
+
Research on large language models, specifically the influence of adequately filtered and deduplicated web data on the properties of large language models (fairness, safety, limitations, capabilities, etc.).
|
69 |
|
70 |
### Out-of-Scope Use
|
71 |
|
72 |
+
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
|
73 |
+
|
74 |
+
Broadly speaking, we would recommend Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) for any use not directly related to research on web data pipelines.
|
75 |
|
76 |
## Bias, Risks, and Limitations
|
77 |
|
78 |
+
Falcon-RW-7B is trained on English data only, and 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.
|
79 |
+
|
80 |
+
### Recommendations
|
81 |
+
|
82 |
+
We recommend users of Falcon-RW-7B 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.
|
83 |
+
|
84 |
+
## How to Get Started with the Model
|
85 |
+
|
86 |
+
|
87 |
+
```python
|
88 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
89 |
+
import transformers
|
90 |
+
import torch
|
91 |
+
|
92 |
+
model = "tiiuae/falcon-rw-7b"
|
93 |
+
|
94 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
95 |
+
pipeline = transformers.pipeline(
|
96 |
+
"text-generation",
|
97 |
+
model=model,
|
98 |
+
tokenizer=tokenizer,
|
99 |
+
torch_dtype=torch.bfloat16,
|
100 |
+
trust_remote_code=True,
|
101 |
+
device_map="auto",
|
102 |
+
)
|
103 |
+
sequences = pipeline(
|
104 |
+
"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:",
|
105 |
+
max_length=200,
|
106 |
+
do_sample=True,
|
107 |
+
top_k=10,
|
108 |
+
num_return_sequences=1,
|
109 |
+
eos_token_id=tokenizer.eos_token_id,
|
110 |
+
)
|
111 |
+
for seq in sequences:
|
112 |
+
print(f"Result: {seq['generated_text']}")
|
113 |
+
|
114 |
+
```
|
115 |
+
|
116 |
+
## Training Details
|
117 |
+
|
118 |
+
### Training Data
|
119 |
+
|
120 |
+
Falcon-RW-7B was trained on 350B tokens of [RefinedWeb](https://huggingface.co/datasets/tiiuae/falcon-refinedweb), a high-quality filtered and deduplicated web dataset. The data was tokenized with the Falcon-[7B](https://huggingface.co/tiiuae/falcon-7b)/[40B](https://huggingface.co/tiiuae/falcon-40b) tokenizer.
|
121 |
+
|
122 |
+
### Training Procedure
|
123 |
+
|
124 |
+
Falcon-RW-7B was trained on 256 A100 40GB GPUs, using a 3D parallelism strategy (TP=2, PP=2, DP=64) combined with ZeRO.
|
125 |
+
|
126 |
+
#### Training Hyperparameters
|
127 |
+
|
128 |
+
Hyperparameters were adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)).
|
129 |
+
|
130 |
+
| **Hyperparameter** | **Value** | **Comment** |
|
131 |
+
|--------------------|------------|-------------------------------------------|
|
132 |
+
| Precision | `bfloat16` | |
|
133 |
+
| Optimizer | AdamW | |
|
134 |
+
| Learning rate | 1.2e-4 | 500M tokens warm-up, cosine decay to 1.2e-5 |
|
135 |
+
| Weight decay | 1e-1 | |
|
136 |
+
| Batch size | 1024 | 4B tokens ramp-up |
|
137 |
+
|
138 |
+
|
139 |
+
#### Speeds, Sizes, Times
|
140 |
+
|
141 |
+
Training happened in early January 2023 and took about five days.
|
142 |
+
|
143 |
+
|
144 |
+
## Evaluation
|
145 |
+
|
146 |
+
*Paper coming soon.*
|
147 |
+
|
148 |
+
|
149 |
+
## Technical Specifications
|
150 |
+
|
151 |
+
### Model Architecture and Objective
|
152 |
+
|
153 |
+
Falcon-RW-7B is a causal decoder-only model trained on a causal language modeling task (i.e., predict the next token).
|
154 |
+
|
155 |
+
The architecture is adapted from the GPT-3 paper ([Brown et al., 2020](https://arxiv.org/abs/2005.14165)), but uses ALiBi ([Ofir et al., 2021](https://arxiv.org/abs/2108.12409)) and FlashAttention ([Dao et al., 2022](https://arxiv.org/abs/2205.14135)).
|
156 |
+
|
157 |
+
| **Hyperparameter** | **Value** | **Comment** |
|
158 |
+
|--------------------|-----------|----------------------------------------|
|
159 |
+
| Layers | 36 | Increased due to a config error when switching from a multi-query architecture |
|
160 |
+
| `d_model` | 4096 | |
|
161 |
+
| `head_dim` | 64 | Reduced to optimise for FlashAttention |
|
162 |
+
| Vocabulary | 65024 | |
|
163 |
+
| Sequence length | 2048 | |
|
164 |
+
|
165 |
+
### Compute Infrastructure
|
166 |
+
|
167 |
+
#### Hardware
|
168 |
+
|
169 |
+
Falcon-RW-7B was trained on AWS SageMaker, on 256 A100 40GB GPUs in P4d instances.
|
170 |
+
|
171 |
+
#### Software
|
172 |
+
|
173 |
+
Falcon-RW-7B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
|
174 |
+
|
175 |
+
|
176 |
+
## Citation
|
177 |
+
|
178 |
+
*Paper coming soon 😊.*
|
179 |
|
180 |
|
181 |
+
## Contact
|
182 |
+
falconllm@tii.ae
|
183 |
|
|