Falcon-RW-1B is a 1B parameters causal decoder-only model built by TII and trained on 350B tokens of RefinedWeb. It is made available under the Apache 2.0 license.
RefinedWeb is a high-quality web dataset built by leveraging stringent filtering and large-scale deduplication. Falcon-RW-1B, trained on RefinedWeb only, matches or outperforms comparable models trained on curated data.
⚠️ 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/40B, both trained on >1,000 billion tokens.
python
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import transformers
3import torch
45model ="tiiuae/falcon-rw-1b"67tokenizer = AutoTokenizer.from_pretrained(model)8pipeline = transformers.pipeline(9"text-generation",10 model=model,11 tokenizer=tokenizer,12 torch_dtype=torch.bfloat16,13 trust_remote_code=True,14 device_map="auto",15)16sequences = pipeline(17"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:",18 max_length=200,19 do_sample=True,20 top_k=10,21 num_return_sequences=1,22 eos_token_id=tokenizer.eos_token_id,23)24for seq in sequences:25print(f"Result: {seq['generated_text']}")26
💥 Falcon LLMs require PyTorch 2.0 for use with transformers!
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.).
Out-of-Scope Use
Production use without adequate assessment of risks and mitigation; any use cases which may be considered irresponsible or harmful.
Broadly speaking, we would recommend Falcon-7B/40B for any use not directly related to research on web data pipelines.
Bias, Risks, and Limitations
Falcon-RW-1B 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.
Recommendations
We recommend users of Falcon-RW-1B 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.
How to Get Started with the Model
python
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import transformers
3import torch
45model ="tiiuae/falcon-rw-1b"67tokenizer = AutoTokenizer.from_pretrained(model)8pipeline = transformers.pipeline(9"text-generation",10 model=model,11 tokenizer=tokenizer,12 torch_dtype=torch.bfloat16,13 trust_remote_code=True,14 device_map="auto",15)16sequences = pipeline(17"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:",18 max_length=200,19 do_sample=True,20 top_k=10,21 num_return_sequences=1,22 eos_token_id=tokenizer.eos_token_id,23)24for seq in sequences:25print(f"Result: {seq['generated_text']}")26
Training Details
Training Data
Falcon-RW-1B was trained on 350B tokens of RefinedWeb, a high-quality filtered and deduplicated web dataset. The data was tokenized with the GPT-2 tokenizer.
Training Procedure
Falcon-RW-1B was trained on 32 A100 40GB GPUs, using only data parallelism with ZeRO.
Falcon-RW-1B was trained on AWS SageMaker, on 32 A100 40GB GPUs in P4d instances.
Software
Falcon-RW-1B was trained a custom distributed training codebase, Gigatron. It uses a 3D parallelism approach combined with ZeRO and high-performance Triton kernels (FlashAttention, etc.)
Citation
@article{refinedweb,
title={The {R}efined{W}eb dataset for {F}alcon {LLM}: outperforming curated corpora with web data, and web data only},
author={Guilherme Penedo and Quentin Malartic and Daniel Hesslow and Ruxandra Cojocaru and Alessandro Cappelli and Hamza Alobeidli and Baptiste Pannier and Ebtesam Almazrouei and Julien Launay},
journal={arXiv preprint arXiv:2306.01116},
eprint={2306.01116},
eprinttype = {arXiv},
url={https://arxiv.org/abs/2306.01116},
year={2023}
}