Severino commited on
Commit
00d3d0b
1 Parent(s): da9b9a7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -6
README.md CHANGED
@@ -83,17 +83,61 @@ This model is a new result towards the long-run problem of "What is the best str
83
 
84
  This model adapts the [falcon-7b](https://huggingface.co/tiiuae/falcon-7b) to the new target languages Spanish and Catalan by swapping the tokenizer and adjusting the embedding layer before training with 26B tokens in the target language.
85
 
86
- ## Embedding layer adaptation
87
 
88
  When adapting a model from English to other languages the tokenizer plays a crucial role.
89
 
90
  If the tokenizer does not include the target language in its training data, the resulting model will need many more tokens to perform the same task.
91
- We solve this problem by creating a new tokenizer in the target languages (Spanish and Catalan) and adapting the embedding layer by only reordering the embeddings of the shared tokens of both tokenizers and initializing the rest to the average of all embeddings.
 
 
92
 
93
- fine-tuned version of [/bscdata/models/falcon_7b_balanced_tokenizer_fp16/](https://huggingface.co//bscdata/models/falcon_7b_balanced_tokenizer_fp16/) on the /bscdata/data/open_data_26B_tokens_balanced_es_ca/open_data_26B_tokens_balanced_es_ca.py default dataset.
94
- It achieves the following results on the evaluation set:
95
- - Loss: 2.1504
96
- - Accuracy: 0.5258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
 
98
  ## Model description
99
 
@@ -804,6 +848,12 @@ The following hyperparameters were used during training:
804
  | 2.1227 | 1.0 | 3335000 | 0.5258 | 2.1504 |
805
 
806
 
 
 
 
 
 
 
807
  ### Framework versions
808
 
809
  - Transformers 4.30.2
 
83
 
84
  This model adapts the [falcon-7b](https://huggingface.co/tiiuae/falcon-7b) to the new target languages Spanish and Catalan by swapping the tokenizer and adjusting the embedding layer before training with 26B tokens in the target language.
85
 
86
+ ## Language Adaptation
87
 
88
  When adapting a model from English to other languages the tokenizer plays a crucial role.
89
 
90
  If the tokenizer does not include the target language in its training data, the resulting model will need many more tokens to perform the same task.
91
+ We solve this problem by creating a new tokenizer in the target languages (Spanish and Catalan) and adapting the embedding layer to it.
92
+ ESTO QUE HACE AQUI??
93
+ It is a fine-tuned version of [/bscdata/models/falcon_7b_balanced_tokenizer_fp16/](https://huggingface.co//bscdata/models/falcon_7b_balanced_tokenizer_fp16/) on the /bscdata/data/open_data_26B_tokens_balanced_es_ca/open_data_26B_tokens_balanced_es_ca.py default dataset.
94
 
95
+ ### New Tokenizer
96
+ We trained a new BPE Tokenizer for the Catalan and Spanish languages (equal representation). We shuffle a small amount of English in the mixture (since English is in the model training data).
97
+ The resulting data has the following language distribution:
98
+
99
+ |Language|%|
100
+ |---|---|
101
+ |En|16.84%|
102
+ |Es|41.38%|
103
+ |Ca|41.79%|
104
+
105
+ *P.D: It was meant to be the same distribution as the model train data (presented in Continual Pre-Training section)*
106
+
107
+ This reduces drastically the amount of tokens required to tokenize a text in the target languages (~70 %) while the English tokenization shows a small increase (~115 %).
108
+
109
+ ### Embedding Layer Initialization
110
+ In order to fully take advantage of the English Pre-Training of the original Falcon model, we decided to re-use the embedding weights of the original model for those tokens shared between the two Tokenizers (the new and the old one). The rest of the embedding weights are initialized as the mean value of the weights of the original Tokenizer.
111
+
112
+ ### Continual Pre-Training
113
+ Once the model has been successfully initialized, we continue its pre-training in the two target languages: Catalan and Spanish. We also shuffle a small amount of English in order to avoid catastrophic forgetting. The datasets used to train this model follow:
114
+
115
+ | Dataset | Language | Tokens (pre-epoch) | Epochs |
116
+ |---------------------|----------|--------------------|--------------|
117
+ | Wikipedia | en | 2169.97M | 1.428144485 |
118
+ | Lyrics | en | 100.60M | 0.7140722425 |
119
+ | C4_es | es | 53709.80M | 0.1049686196 |
120
+ | Biomedical | es | 455.03M | 0.7140722425 |
121
+ | Legal | es | 995.70M | 0.7140722425 |
122
+ | Wikipedia | es | 693.60M | 1.428144485 |
123
+ | Lyrics | es | 125.93M | 0.7140722425 |
124
+ | Gutenberg | es | 53.18M | 0.7140722425 |
125
+ | C4_ca | ca | 2826.00M | 2.142216727 |
126
+ | Biomedical | ca | 11.80M | 1.428144485 |
127
+ | RacoCatalá Noticias | ca | 17.16M | 2.142216727 |
128
+ | RacoCatalá Forums | ca | 333.73M | 2.142216727 |
129
+ | CaWaC | ca | 57.79M | 2.142216727 |
130
+ | Wikipedia | ca | 228.01M | 3.570361212 |
131
+ | Vilaweb | ca | 50.34M | 2.142216727 |
132
+ | Lyrics | ca | 0.50M | 2.142216727 |
133
+
134
+ The resulting dataset has the following language distribution:
135
+
136
+ |Language|%|
137
+ |---|---|
138
+ |En|16.84%|
139
+ |Es|41.38%|
140
+ |Ca|41.79%|
141
 
142
  ## Model description
143
 
 
848
  | 2.1227 | 1.0 | 3335000 | 0.5258 | 2.1504 |
849
 
850
 
851
+ ## Eval results
852
+
853
+ It achieves the following results on the evaluation set:
854
+ - Loss: 2.1504
855
+ - Accuracy: 0.5258
856
+
857
  ### Framework versions
858
 
859
  - Transformers 4.30.2