Edit model card

You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

FLOR-6.3B

Table of Contents

Click to expand

Model description

FLOR-6.3B is a 6.3B-parameter transformer-based causal language model for Catalan, Spanish, and English. It is the result of a language adaptation technique performed on BLOOM-7.1B, which involves modifying the model's vocabulary and embedding layer, and continuously pre-training the model with 140B tokens in our target languages.

For more details, take a look at this blogpost about the project.

Intended uses and limitations

The FLOR-6.3B model is ready-to-use only for causal language modeling. It can perform text-generation tasks and be fine-tuned for specific scenarios.

How to use

import torch
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM

input_text = "Sovint em trobo pensant en tot allò que"

model_id  = "projecte-aina/FLOR-6.3B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
generator = pipeline(
    "text-generation",
    model=model_id,
    tokenizer=tokenizer,
    torch_dtype=torch.bfloat16,
    trust_remote_code=True,
    device_map="auto",
)
generation = generator(
    input_text,
    do_sample=True,
    top_k=10,
    eos_token_id=tokenizer.eos_token_id,
)

print(f"Result: {generation[0]['generated_text']}")

Limitations and bias

At the time of submission, no measures have been taken to estimate the bias and toxicity embedded in the model. However, we are well aware that our models may be biased since the corpora have been collected using crawling techniques on multiple web sources. We intend to conduct research in these areas in the future, and if completed, this model card will be updated.

Training

Language adaptation and training

The language adaptation technique used to create FLOR-6.3B requires the vocabulary of the source model to be adapted before continuing its pre-training with data in the target languages. Specifically, we proceeded as follows:

  1. We trained our own BPE tokenizer for Catalan, Spanish, and English, and replaced the original BLOOM tokenizer and vocabulary with it. This procedure implied a downsizing of the original BLOOM's embedding layer and, therefore, a model compression from 7.1B parameters to 6.3B.
  2. The embeddings corresponding to tokens that are present in both the original and the target vocabulary (matching tokens) were used for initialization.
  3. The embeddings from tokens not present in BLOOM's original vocabulary were initialized as the average of all embeddings.
  4. The model was initialized with the weights from BLOOM-7.1B, and with our adapted tokenizer (step 1) and embeddings (steps 2-3).
  5. The model was then trained on a corpus that contains a mixture of Catalan, Spanish, and English data.

Training data

The training corpus is composed of 140B tokens gathered from web crawlings and public domain data. Most of the sources in Catalan have been obtained from the CATalog 1.0 dataset, filtered with a minimum threshold of 0.6 and oversampling some of the sources it integrates to different extents.

Dataset Language Words (per-epoch) Epochs Total Tokens
mc4 ca 5,861.79M 1.5 13,452.81M
MaCoCu ca 1,658.89M 2 5,076.21M
CaWac ca 1,286.83M 2.5 4,922.14M
oscar-2301 ca 1,784.57M 1.75 4,778.17M
RacoCatala Articles ca 358.57M 4 2,194.42M
RacoCatala Forums ca 1,301.12M 1 1,990.71M
Tesis (TDX) ca 323.60M 4 1,980.46M
oscar-2201 ca 1,155.35M 1 1,767.69M
Wikipedia ca 266.69M 4 1,632.17M
Nació Digital ca 216.27M 4 1,323.59M
colossal-oscar-05-06-23 ca 207.59M 4 1,270.43M
colossal-oscar-03-04-23 ca 195.43M 4 1,196.01M
colossal-oscar-2022-27 ca 195.03M 4 1,193.59M
Crawling populars ca 683.25M 1 1,045.38M
El Món ca 85.27M 4 521.85M
ACN ca 81.25M 4 497.22M
DOGV ca 76.48M 4 468.05M
DOGC ca 70.51M 4 431.51M
Vilaweb ca 46.90M 4 287.04M
hplt ca 160.27M 1 245.21M
Les Corts Valencianes ca 26.88M 4 164.53M
IB3 ca 15.82M 4 96.82M
BOUA ca 13.42M 4 82.13M
Parlament ca 10.09M 4 61.77M
Aquí Berguedà ca 8.23M 4 50.34M
Wikimedia ca 3.90M 4 23.88M
Gutenberg ca 1.29M 4 7.87M
OSCAR 23.01 es 53,244.56M 0.303 23,070.34M
colossal_oscar_05-06-23 es 5,548.27M 1 7,934.02M
colossal_oscar_03-04-23 es 5,090.46M 1 7,279.36M
All_bio_corpora es 954.85M 2 2,730.88M
Wikipedia es 777.49M 2 2,223.63M
BOE es 1,031.28M 1 1,474.73M
Tesis (TDX) es 268.66M 2 768.37M
Eurlex es 459.19M 1 656.64M
CSIC es 156.76M 2 448.33M
BORME es 63.23M 1 90.42M
colossal_oscar_05-06-23 en 51,615.35M 0.25 21,162.30M
colossal_oscar_03-04-23 en 49,454.01M 0.14 11,354.64M
Wikipedia en 2,116.53M 2 6,942.23M
Gutenberg en 3,513.82M 1 5,762.66M
Eurlex en 438.92M 1 719.83M
legal-mc4 en 417.97M 1 685.47M

Languages

The training data has the same amount of Catalan, Spanish, and English texts. The table below shows the final language distribution:

Language Percentage
Catalan (CA) 33.39%
Spanish (ES) 33.32%
English (EN) 33.29%

Framework

The training was conducted in 16 Cerebras' CS-2 systems using the cs-2.0.2 release of their software.

Evaluation

FLOR-6.3B has been evaluated in a 5-shot setting, using EleutherAI's LM Evaluation Harness. The evaluation benchmark includes tasks in Catalan, Spanish, and English, with particular emphasis on Catalan datasets.

The tasks were chosen to cover several evaluation areas in order to provide a comprehensive overview of the model's capabilities. The baselines used to compare our results are multilingual and English open-source 7B models and smaller models of the FLOR family of models: TBC.

Our implementation of EleutherAI's LM Evaluation Harness can be found here.

The following is a list of evaluation areas and their respective datasets:

Results

Dataset Lang. Task FLOR-6.3B BLOOM-7.1B
Teca ca Natural Language Inference 49.79🔥 46.91
XNLI ca Natural Language Inference 51.70🔥 49.20
XNLI es Natural Language Inference 50.28🔥 47.62
XNLI en Natural Language Inference 52.55🔥 51.96
Belebele ca Reading Comprehension 48.98🔥 48.57
Belebele es Reading Comprehension 48.16 48.16
Belebele en Reading Comprehension 49.80 50.20🔥
CatalanQA ca Question Answering 71.80🔥 69.54
CoQCat ca Question Answering 65.96🔥 58.49
XQuAD ca Question Answering 59.01 60.94🔥
XQuAD es Question Answering 63.80🔥 61.76
XQuAD en Question Answering 70.02🔥 69.76
COPA ca Question Answering 78.00🔥 72.60
COPA en Question Answering 81.00🔥 79.00
XStoryCloze es Question Answering 69.82🔥 66.45
XStoryCloze en Question Answering 74.45🔥 70.81
Parafraseja ca Paraphrase Identification 62.88🔥 60.27
PAWS-X ca Paraphrase Identification 59.70🔥 59.35
PAWS-X es Paraphrase Identification 57.70 58.65🔥
PAWS-X en Paraphrase Identification 59.65 62.85🔥
FLoRes ca->es Machine Translation 24.98🔥 24.21
FLoRes es->ca Machine Translation 25.24🔥 23.19
FLoRes ca->en Machine Translation 42.89🔥 40.93
FLoRes en->ca Machine Translation 39.29🔥 34.30
FLoRes es->en Machine Translation 28.61🔥 27.48
FLoRes en->es Machine Translation 25.35🔥 23.72

Note: The metrics are F1-score for question-answering tasks, BLEU for translation, and accuracy for the rest.

Additional information

Author

The Language Technologies Unit from Barcelona Supercomputing Center.

Contact

For further information, please send an email to [email protected].

Copyright

Copyright(c) 2023 by Language Technologies Unit, Barcelona Supercomputing Center.

License

Apache License, Version 2.0

Funding

This work was funded by Departament de la Vicepresidència i de Polítiques Digitals i Territori de la Generalitat de Catalunya within the framework of Projecte AINA.

Disclaimer

Click to expand

The model published in this repository is intended for a generalist purpose and is available to third parties under a permissive Apache License, Version 2.0.

Be aware that the model may have biases and/or any other undesirable distortions.

When third parties deploy or provide systems and/or services to other parties using this model (or any system based on it) or become users of the model, they should note that it is their responsibility to mitigate the risks arising from its use and, in any event, to comply with applicable regulations, including regulations regarding the use of Artificial Intelligence.

In no event shall the owner and creator of the model (Barcelona Supercomputing Center) be liable for any results arising from the use made by third parties.

Downloads last month
242
Safetensors
Model size
6.25B params
Tensor type
FP16
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for projecte-aina/FLOR-6.3B

Finetunes
3 models
Quantizations
5 models

Dataset used to train projecte-aina/FLOR-6.3B

Spaces using projecte-aina/FLOR-6.3B 3

Collection including projecte-aina/FLOR-6.3B