Text Generation
Transformers
Safetensors
Portuguese
llama
text-generation-inference
Eval Results (legacy)
nicholasKluge commited on
Commit
55a3a2d
·
verified ·
1 Parent(s): eed2108

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -171
README.md CHANGED
@@ -10,18 +10,6 @@ datasets:
10
  metrics:
11
  - perplexity
12
  pipeline_tag: text-generation
13
- widget:
14
- - text: "A capital do Brasil é"
15
- example_title: Exemplo
16
- - text: "O principal rio do Brasil é"
17
- example_title: Exemplo
18
- inference:
19
- parameters:
20
- repetition_penalty: 1.2
21
- temperature: 0.1
22
- top_k: 50
23
- top_p: 1.0
24
- max_new_tokens: 150
25
  co2_eq_emissions:
26
  emissions: 124630
27
  source: CodeCarbon
@@ -29,7 +17,7 @@ co2_eq_emissions:
29
  geographical_location: Germany
30
  hardware_used: NVIDIA A40
31
  model-index:
32
- - name: Gigaverbo-v2-ablation-Synth-1.5B
33
  results:
34
  - task:
35
  type: text-generation
@@ -58,7 +46,7 @@ model-index:
58
  num_few_shot: 5
59
  metrics:
60
  - type: acc_norm
61
- value: 43.9
62
  name: accuracy (normalized)
63
  source:
64
  url: https://github.com/Nkluge-correa/lm-evaluation-harness
@@ -74,7 +62,7 @@ model-index:
74
  num_few_shot: 5
75
  metrics:
76
  - type: acc
77
- value: 56.1 z
78
  name: accuracy
79
  source:
80
  url: https://github.com/Nkluge-correa/lm-evaluation-harness
@@ -117,7 +105,7 @@ model-index:
117
 
118
  ## Model Summary
119
 
120
- **[Gigaverbo-v2-ablation-Synth-1.5B](https://huggingface.co/Polygl0t/Gigaverbo-v2-ablation-Synth-1.5B)** is a decoder-transformer natively pretrained in Portuguese. This model is part of an ablation study to measure the impact of our educational data filtering/augmentation strategy on the dowstream performance of models trained with [Gigaverbo-v2](https://huggingface.co/datasets/Polygl0t/gigaverbo-v2) and [Gigaverbo-v2-synth](https://huggingface.co/datasets/Polygl0t/gigaverbo-v2-synth). Gigaverbo-v2-ablation-Synth-1.5B was trained with ~46 billion tokens, those being a repetition of the synthetic data from Gigaverbo-v2-synth. This model has 1.5 billion parameters and a context length of 4096 tokens.
121
 
122
  ## Details
123
 
@@ -134,7 +122,7 @@ model-index:
134
  - **Emissions:** 124 KgCO2 (Germany)
135
  - **Total energy consumption:** 327 kWh
136
 
137
- This repository has the [source code](https://github.com/Nkluge-correa/polyglot) used to train this model. The full configuration used for training is available in the following config file:
138
 
139
  - Single stage (linear warmup with cosine decay): [training_config.yaml](training_config.yaml)
140
 
@@ -143,7 +131,7 @@ The main branch of this repository contains the final checkpoint saved at step 2
143
  ```python
144
  from transformers import AutoModelForCausalLM, AutoTokenizer
145
 
146
- model_id = "Polygl0t/Gigaverbo-v2-ablation-Synth-1.5B"
147
  revision = "step-2000" # Change this to the desired checkpoint branch
148
  tokenizer = AutoTokenizer.from_pretrained(model_id)
149
  model = AutoModelForCausalLM.from_pretrained(model_id, revision=revision)
@@ -153,49 +141,23 @@ Or, you can access all the revisions for the models via the following code snipp
153
 
154
  ```python
155
  from huggingface_hub import list_repo_refs
156
- out = list_repo_refs("Polygl0t/Gigaverbo-v2-ablation-Synth-1.5B")
157
  branches = [b.name for b in out.branches]
158
  print(branches)
159
  ```
160
 
161
- <details>
162
- <summary><b>Learning Curves 📈</b></summary>
163
-
164
- ![Learning Curves](./learning_curves.png)
165
-
166
- This plot illustrates the evolution of model performance (measured by loss and perplexity) as a function of training time, measured in tokens seen during training.
167
-
168
- </details>
169
-
170
  ## Intended Uses
171
 
172
- The primary intended use of this model is to serve as a baseline for evaluating the impact of data quality and filtering on Portuguese language model performance. Researchers and practitioners can utilize this model as a reference point for further ablation studies or to compare against other models trained with different data mixtures.
173
 
174
  ## Basic usage
175
 
176
- ### Via HuggingFace Transformers
177
-
178
- Using the `pipeline`:
179
-
180
- ```python
181
- from transformers import pipeline
182
-
183
- generator = pipeline("text-generation", model="Polygl0t/Gigaverbo-v2-ablation-Synth-1.5B")
184
-
185
- completions = generator("A capital de Portugal é", num_return_sequences=2, max_new_tokens=150)
186
-
187
- for comp in completions:
188
- print(f"🤖 {comp['generated_text']}")
189
- ```
190
-
191
- Using the `AutoTokenizer` and `AutoModelForCausalLM`:
192
-
193
  ```python
194
  from transformers import GenerationConfig, TextGenerationPipeline, AutoTokenizer, AutoModelForCausalLM
195
  import torch
196
 
197
  # Specify the model and tokenizer
198
- model_id = "Polygl0t/Gigaverbo-v2-ablation-Synth-1.5B"
199
  tokenizer = AutoTokenizer.from_pretrained(model_id)
200
  model = AutoModelForCausalLM.from_pretrained(model_id)
201
 
@@ -222,132 +184,33 @@ completion = generator(prompt, generation_config=generation_config)
222
  print(completion[0]['generated_text'])
223
  ```
224
 
225
- ### Via vLLM Inference
226
-
227
- ```python
228
- from vllm import LLM, SamplingParams
229
- from transformers import AutoTokenizer
230
- import torch
231
-
232
- model_id = "Polygl0t/Gigaverbo-v2-ablation-Synth-1.5B"
233
- prompt = "A capital de Portugal é"
234
-
235
- tokenizer = AutoTokenizer.from_pretrained(
236
- model_id,
237
- use_fast=True,
238
- )
239
-
240
- model = LLM(
241
- model=model_id,
242
- )
243
-
244
- sampling_params = SamplingParams(
245
- max_tokens=150,
246
- stop=[tokenizer.eos_token],
247
- stop_token_ids=[tokenizer.eos_token_id],
248
- n=2,
249
- temperature=0.1,
250
- repetition_penalty=1.2,
251
- top_k=50,
252
- top_p=1.0
253
- )
254
-
255
- outputs = model.generate([prompt], sampling_params)
256
-
257
- for output in outputs:
258
- print(f"🤖 {output.outputs[0].text}")
259
- ```
260
-
261
  ## Evaluations
262
 
263
- The table below compares our ablation models with checkpoints from the first [Tucano series](https://huggingface.co/TucanoBR). Given that Tucanos have also have (1) been trained on Portuguese data of a similar nature, and (2) provide several checkpoints at different training stages. To keep our comparison fair, we selected Tucano checkpoints that are closest in terms of training tokens seen (31B and 52B tokens) to our ablation models (46B tokens), and that are of similar size (1.1B and 2.4B parameters).
264
-
265
- | | ARC Challenge | Calame | Global PIQA | HellaSwag | Lambada |
266
- | :----------------------------------------- | ------------: | --------: | ----------: | --------: | -------: |
267
- | Gigaverbo-v2-ablation-EDU+Synth-1.5B (46B) | **0.344** | **0.579** | 0.75 | **0.46** | **0.39** |
268
- | Gigaverbo-v2-ablation-NonEDU-1.5B (46B) | 0.256 | 0.565 | 0.65 | 0.383 | 0.352 |
269
- | Gigaverbo-v2-ablation-EDU-1.5B (46B) | 0.328 | 0.579 | **0.82** | 0.449 | 0.377 |
270
- | Gigaverbo-v2-ablation-Synth-1.5B (46B) | 0.326 | 0.561 | 0.72 | 0.439 | 0.339 |
271
- | Tucano-1b1 (52B) | 0.284 | 0.464 | 0.64 | 0.401 | 0.257 |
272
- | Tucano-2b4 (52B) | 0.274 | 0.456 | 0.71 | 0.412 | 0.248 |
273
- | Tucano-1b1 (31B) | 0.286 | 0.447 | 0.63 | 0.38 | 0.235 |
274
- | Tucano-2b4 (31B) | 0.275 | 0.462 | 0.61 | 0.394 | 0.274 |
275
-
276
- Below are detailed plots for each benchmark, as well as a consolidated comparison table including other relevant models trained on Portuguese data.
277
-
278
- - **Note:** We selected these specific benchmarks (ARC Challenge, Calame, Global PIQA, HellaSwag, and Lambada) because they provide a good signal, eve at early training stages, of how well the models are learning to reason, understand context, and generate coherent text in Portuguese. Unlike oter benchmarks (e.g., ENEM, OAB, MMLU) that require more extensive training to see meaningful differences, these benchmarks are sensitive enough to capture the impact of our educational data mixture even at the 1.5B parameter scale and with a relatively modest training budget (~46B tokens).
279
-
280
- <details>
281
- <summary><b>ARC Challenge ⭐</b></summary>
282
-
283
- ![](./arc.png)
284
-
285
- Arc is perhaps where we see the most significant difference between data mixtures. The EDU+Synth model achieves a score (34%) that substantially outperforms the NonEDU mixture (25%), and also surpasses both the EDU-only (32%) and Synth-only (32%) mixtures. This suggests that the combination of high-quality educational web data and the synthetic portion of GigaVerbo-v2 provides complementary benefits that enhance the model's reasoning capabilities in QA tasks.
286
-
287
- </details>
288
-
289
- <details>
290
- <summary><b>Calame ⭐</b></summary>
291
-
292
- ![](./calame.png)
293
-
294
- For Calame, much like Lambada, is where we see a less pronounced advantage coming from the EDU portion of GigaVerbo-v2. We hypothesize that this is due to the nature of these benchmarks (i.e., predict the last word of a passage), which may not benefit as much from educational content as other benchmarks focused on reasoning or commonsense understanding. Nevertheless, the EDU+Synth model still outperforms the NonEDU model (57.9% vs 56.5%), indicating that educational data does contribute positively even in this context.
295
-
296
- </details>
297
-
298
- <details>
299
- <summary><b>Global PIQA ⭐</b></summary>
300
-
301
- ![](./global_piqa.png)
302
-
303
- On Global PIQA, we see that the adition of synthetic data to the educational portion of GigaVerbo-v2 yields a decrease in performance (75% vs 82%). However, both models still significantly outperform the NonEDU model (65%). Given that the synthetic data was not specifically tailored for physical commonsense reasoning tasks (or cultal knowledge tasks in general), this result is not entirely surprising. It does, however, highlight some shortcomings of our synthetic dataset that we aim to address in future iterations.
304
-
305
- </details>
306
-
307
- <details>
308
- <summary><b>HellaSwag ⭐</b></summary>
309
-
310
- ![](./hellaswag.png)
311
-
312
- Lambada is the only benchmark where the NonEdua mixture outperforms the Synth-only mixture (35.2% vs 33.9%). However, the Edu+Synth mixture still achieves the best performance (39%), followed closely by the Edu-only mixture (37.7%). Again, we hypothesize that this is due to the nature of the benchmark, which focuses on predicting the last word of a passage, a task that may not benefit as much from the repetitive patterns found in our synthetic data.
313
-
314
- </details>
315
-
316
- <details>
317
- <summary><b>Lambada ⭐</b></summary>
318
-
319
- ![](./lambada.png)
320
-
321
- Like in the case of Calame, the GigaVerbo-v2-Synth model shows a clear advantage over the Non-EDU model on Lambada (39% vs 35.2%), albeit by a smaller margin.
322
-
323
- </details>
324
-
325
- <details>
326
- <summary><b>More Comparisons 📊</b></summary>
327
-
328
- | | ARC Challenge | Calame | Global PIQA | HellaSwag | Lambada |
329
- | :----------------------------------------- | ------------: | --------: | ----------: | --------: | --------: |
330
- | Gigaverbo-v2-ablation-EDU+Synth-1.5B (46B) | **0.344** | 0.579 | 0.75 | 0.46 | 0.39 |
331
- | Gigaverbo-v2-ablation-NonEDU-1.5B (46B) | 0.256 | 0.565 | 0.65 | 0.383 | 0.352 |
332
- | Gigaverbo-v2-ablation-EDU-1.5B (46B) | 0.328 | 0.579 | **0.82** | 0.449 | 0.377 |
333
- | Gigaverbo-v2-ablation-Synth-1.5B (46B) | 0.326 | 0.561 | 0.72 | 0.439 | 0.339 |
334
- | Carvalho_pt-gl-1.3B (26B + 5B) | 0.27 | 0.534 | 0.63 | 0.385 | 0.336 |
335
- | Curio-1.1b (1T + 150B) | 0.304 | 0.592 | 0.75 | **0.495** | 0.467 |
336
- | Curio-1.1b (1T + 100B) | 0.309 | **0.599** | 0.74 | 0.489 | 0.468 |
337
- | Curio-1.1b (1T + 50B) | 0.294 | 0.589 | 0.74 | 0.48 | **0.469** |
338
- | Curio-edu-1b1 (1T + ?) | 0.322 | 0.549 | 0.69 | 0.463 | 0.429 |
339
- | GlorIA-1.3B (35B) | 0.264 | 0.547 | 0.64 | 0.364 | 0.367 |
340
- | Llama-3.2-1B (9T) | 0.317 | 0.5 | 0.55 | 0.453 | 0.456 |
341
- | Tucano-1b1 (250B) | 0.301 | 0.489 | 0.68 | 0.441 | 0.284 |
342
- | Tucano-1b1 (31B) | 0.286 | 0.447 | 0.63 | 0.38 | 0.235 |
343
- | Tucano-1b1 (52B) | 0.284 | 0.464 | 0.64 | 0.401 | 0.257 |
344
- | Tucano-2b4 (31B) | 0.275 | 0.462 | 0.61 | 0.394 | 0.274 |
345
- | Tucano-2b4 (500B) | 0.304 | 0.503 | 0.73 | 0.488 | 0.324 |
346
- | Tucano-2b4 (52B) | 0.274 | 0.456 | 0.71 | 0.412 | 0.248 |
347
-
348
- Even with a much smaller compute budget (~46B tokens) compared to other models (e.g., Curio seen 1 trillion tokens of pretraining and 150 billion tokens of continual pretraining, Llama-3.2-1B seen 9 trillion tokens of pretraining), the models trained on the Educational (and synthetic) portions of GigaVerbo-v2 are able to achieve competitive performance across all evaluated benchmarks. Moreover, the results from our ablation study clearly indicate a signifcant improvment in terms of GigaVerbo-v1, given that the models trained on GigaVerbo-v2 consistently outperform the first iteration of the Tucano models across all benchmarks.
349
-
350
- </details>
351
 
352
  ## Cite as 🤗
353
 
 
10
  metrics:
11
  - perplexity
12
  pipeline_tag: text-generation
 
 
 
 
 
 
 
 
 
 
 
 
13
  co2_eq_emissions:
14
  emissions: 124630
15
  source: CodeCarbon
 
17
  geographical_location: Germany
18
  hardware_used: NVIDIA A40
19
  model-index:
20
+ - name: GigaVerbo-v2-ablation-Synth-1.5B
21
  results:
22
  - task:
23
  type: text-generation
 
46
  num_few_shot: 5
47
  metrics:
48
  - type: acc_norm
49
+ value: 43.9
50
  name: accuracy (normalized)
51
  source:
52
  url: https://github.com/Nkluge-correa/lm-evaluation-harness
 
62
  num_few_shot: 5
63
  metrics:
64
  - type: acc
65
+ value: 56.1
66
  name: accuracy
67
  source:
68
  url: https://github.com/Nkluge-correa/lm-evaluation-harness
 
105
 
106
  ## Model Summary
107
 
108
+ **[GigaVerbo-v2-ablation-Synth-1.5B](https://huggingface.co/Polygl0t/GigaVerbo-v2-ablation-Synth-1.5B)** is a decoder-transformer natively pretrained in Portuguese. This model is part of an ablation study to measure the impact of our educational data filtering/augmentation strategy on the downstream performance of models trained with [GigaVerbo-v2](https://huggingface.co/datasets/Polygl0t/gigaverbo-v2) and [GigaVerbo-v2-synth](https://huggingface.co/datasets/Polygl0t/gigaverbo-v2-synth). Gigaverbo-v2-ablation-Synth-1.5B was trained with ~46 billion tokens, those being a repetition of the synthetic data from Gigaverbo-v2-synth. This model has 1.5 billion parameters and a context length of 4096 tokens.
109
 
110
  ## Details
111
 
 
122
  - **Emissions:** 124 KgCO2 (Germany)
123
  - **Total energy consumption:** 327 kWh
124
 
125
+ This repository has the [source code](https://github.com/Polygl0t/Polygl0t) used to train this model. The complete configuration used for training is available in the following config file:
126
 
127
  - Single stage (linear warmup with cosine decay): [training_config.yaml](training_config.yaml)
128
 
 
131
  ```python
132
  from transformers import AutoModelForCausalLM, AutoTokenizer
133
 
134
+ model_id = "Polygl0t/GigaVerbo-v2-ablation-Synth-1.5B"
135
  revision = "step-2000" # Change this to the desired checkpoint branch
136
  tokenizer = AutoTokenizer.from_pretrained(model_id)
137
  model = AutoModelForCausalLM.from_pretrained(model_id, revision=revision)
 
141
 
142
  ```python
143
  from huggingface_hub import list_repo_refs
144
+ out = list_repo_refs("Polygl0t/GigaVerbo-v2-ablation-Synth-1.5B")
145
  branches = [b.name for b in out.branches]
146
  print(branches)
147
  ```
148
 
 
 
 
 
 
 
 
 
 
149
  ## Intended Uses
150
 
151
+ The primary intended use of this model is to serve as a baseline for evaluating the impact of data quality and filtering on Portuguese language model performance. Researchers and practitioners can use this model as a reference point for further ablation studies or for comparison with other models trained on different data mixtures.
152
 
153
  ## Basic usage
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  ```python
156
  from transformers import GenerationConfig, TextGenerationPipeline, AutoTokenizer, AutoModelForCausalLM
157
  import torch
158
 
159
  # Specify the model and tokenizer
160
+ model_id = "Polygl0t/GigaVerbo-v2-ablation-Synth-1.5B"
161
  tokenizer = AutoTokenizer.from_pretrained(model_id)
162
  model = AutoModelForCausalLM.from_pretrained(model_id)
163
 
 
184
  print(completion[0]['generated_text'])
185
  ```
186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
187
  ## Evaluations
188
 
189
+ The table below compares our ablation models with checkpoints from the first [Tucano series](https://huggingface.co/TucanoBR). Tucano models are a natural point of comparison because they were trained on Portuguese data of a similar nature and provide multiple checkpoints across different stages of training. To ensure a fair comparison, we select Tucano checkpoints that are closest to our ablation models in terms of both the number of training tokens seen (31B and 52B vs. 46B) and model size (1.1B and 2.4B parameters). We also include additional models for which reliable information on training data volume and model size is available and whose sizes are comparable to our ablation models. Performance is summarized using the NPM (Normalized Performance Metric), which provides a balanced aggregate view across tasks by normalizing each task’s score relative to its random baseline, thereby accounting for differences in task difficulty.
190
+
191
+ | | NPM | ARC Challenge | Calame | Global PIQA | HellaSwag | Lambada |
192
+ | ------------------------------ | ------ | ------------- | ------ | ----------- | --------- | ------- |
193
+ | GigaVerbo-v2 (EDU) | 39.306 | 0.328 | 0.579 | 0.82 | 0.449 | 0.377 |
194
+ | Curio-1.1b (1T + 150B) | 39.156 | 0.304 | 0.592 | 0.75 | 0.495 | 0.467 |
195
+ | Curio-1.1b (1T + 100B) | 38.88 | 0.309 | 0.599 | 0.74 | 0.489 | 0.468 |
196
+ | Curio-1.1b (1T + 50B) | 38.057 | 0.294 | 0.589 | 0.74 | 0.48 | 0.469 |
197
+ | GigaVerbo-v2 (EDU+Synth) | 37.49 | 0.344 | 0.579 | 0.75 | 0.46 | 0.39 |
198
+ | Curio-edu-1b1 (1T + 20B) | 34.774 | 0.322 | 0.549 | 0.69 | 0.463 | 0.429 |
199
+ | GigaVerbo-v2 (Synth) | 33.864 | 0.326 | 0.561 | 0.72 | 0.439 | 0.339 |
200
+ | Tucano-2b4 (500B) | 33.551 | 0.304 | 0.503 | 0.73 | 0.488 | 0.324 |
201
+ | Tucano-1b1 (250B) | 29.124 | 0.301 | 0.489 | 0.68 | 0.441 | 0.284 |
202
+ | Llama-3.2-1B (9T) | 28.315 | 0.317 | 0.5 | 0.55 | 0.453 | 0.456 |
203
+ | GigaVerbo-v2 (NonEDU) | 28.049 | 0.256 | 0.565 | 0.65 | 0.383 | 0.352 |
204
+ | Tucano-2b4 (52B) | 27.433 | 0.274 | 0.456 | 0.71 | 0.412 | 0.248 |
205
+ | GlorIA-1.3B (35B) | 27.274 | 0.264 | 0.547 | 0.64 | 0.364 | 0.367 |
206
+ | Carvalho_pt-gl-1.3B (26B + 5B) | 26.746 | 0.27 | 0.534 | 0.63 | 0.385 | 0.336 |
207
+ | Tucano-1b1 (52B) | 24.927 | 0.284 | 0.464 | 0.64 | 0.401 | 0.257 |
208
+
209
+ ### ⭐ GigaVerbo-v2 Ablations: The Impact of 46B Tokens of Educational & Synthetic Data ⭐
210
+
211
+ All individual benchmark scores and their evolution across training time can be found in the [.plots](https://huggingface.co/Polygl0t/GigaVerbo-v2-ablation-Synth-1.5B/tree/main/.plots) folder.
212
+
213
+ ![GigaVerbo-v2 Ablation: Impact of Educational & Synthetic Data (46B tokens)](./.plots/gigaverbo_v2_ablation_comparison.png)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
 
215
  ## Cite as 🤗
216