RichardErkhov commited on
Commit
025e975
·
verified ·
1 Parent(s): 28cafe7

uploaded readme

Browse files
Files changed (1) hide show
  1. README.md +427 -0
README.md ADDED
@@ -0,0 +1,427 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Quantization made by Richard Erkhov.
2
+
3
+ [Github](https://github.com/RichardErkhov)
4
+
5
+ [Discord](https://discord.gg/pvy7H8DZMG)
6
+
7
+ [Request more models](https://github.com/RichardErkhov/quant_request)
8
+
9
+
10
+ TeenyTinyLlama-160m - GGUF
11
+ - Model creator: https://huggingface.co/nicholasKluge/
12
+ - Original model: https://huggingface.co/nicholasKluge/TeenyTinyLlama-160m/
13
+
14
+
15
+ | Name | Quant method | Size |
16
+ | ---- | ---- | ---- |
17
+ | [TeenyTinyLlama-160m.Q2_K.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q2_K.gguf) | Q2_K | 0.07GB |
18
+ | [TeenyTinyLlama-160m.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.IQ3_XS.gguf) | IQ3_XS | 0.07GB |
19
+ | [TeenyTinyLlama-160m.IQ3_S.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.IQ3_S.gguf) | IQ3_S | 0.07GB |
20
+ | [TeenyTinyLlama-160m.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q3_K_S.gguf) | Q3_K_S | 0.07GB |
21
+ | [TeenyTinyLlama-160m.IQ3_M.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.IQ3_M.gguf) | IQ3_M | 0.08GB |
22
+ | [TeenyTinyLlama-160m.Q3_K.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q3_K.gguf) | Q3_K | 0.08GB |
23
+ | [TeenyTinyLlama-160m.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q3_K_M.gguf) | Q3_K_M | 0.08GB |
24
+ | [TeenyTinyLlama-160m.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q3_K_L.gguf) | Q3_K_L | 0.08GB |
25
+ | [TeenyTinyLlama-160m.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.IQ4_XS.gguf) | IQ4_XS | 0.09GB |
26
+ | [TeenyTinyLlama-160m.Q4_0.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q4_0.gguf) | Q4_0 | 0.09GB |
27
+ | [TeenyTinyLlama-160m.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.IQ4_NL.gguf) | IQ4_NL | 0.09GB |
28
+ | [TeenyTinyLlama-160m.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q4_K_S.gguf) | Q4_K_S | 0.09GB |
29
+ | [TeenyTinyLlama-160m.Q4_K.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q4_K.gguf) | Q4_K | 0.1GB |
30
+ | [TeenyTinyLlama-160m.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q4_K_M.gguf) | Q4_K_M | 0.1GB |
31
+ | [TeenyTinyLlama-160m.Q4_1.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q4_1.gguf) | Q4_1 | 0.1GB |
32
+ | [TeenyTinyLlama-160m.Q5_0.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q5_0.gguf) | Q5_0 | 0.11GB |
33
+ | [TeenyTinyLlama-160m.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q5_K_S.gguf) | Q5_K_S | 0.11GB |
34
+ | [TeenyTinyLlama-160m.Q5_K.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q5_K.gguf) | Q5_K | 0.11GB |
35
+ | [TeenyTinyLlama-160m.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q5_K_M.gguf) | Q5_K_M | 0.11GB |
36
+ | [TeenyTinyLlama-160m.Q5_1.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q5_1.gguf) | Q5_1 | 0.12GB |
37
+ | [TeenyTinyLlama-160m.Q6_K.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q6_K.gguf) | Q6_K | 0.12GB |
38
+ | [TeenyTinyLlama-160m.Q8_0.gguf](https://huggingface.co/RichardErkhov/nicholasKluge_-_TeenyTinyLlama-160m-gguf/blob/main/TeenyTinyLlama-160m.Q8_0.gguf) | Q8_0 | 0.16GB |
39
+
40
+
41
+
42
+
43
+ Original model description:
44
+ ---
45
+ language:
46
+ - pt
47
+ license: apache-2.0
48
+ library_name: transformers
49
+ tags:
50
+ - text-generation-inference
51
+ datasets:
52
+ - nicholasKluge/Pt-Corpus-Instruct
53
+ metrics:
54
+ - perplexity
55
+ pipeline_tag: text-generation
56
+ widget:
57
+ - text: 'A PUCRS é uma universidade '
58
+ example_title: Exemplo
59
+ - text: A muitos anos atrás, em uma galáxia muito distante, vivia uma raça de
60
+ example_title: Exemplo
61
+ - text: Em meio a um escândalo, a frente parlamentar pediu ao Senador Silva para
62
+ example_title: Exemplo
63
+ inference:
64
+ parameters:
65
+ repetition_penalty: 1.2
66
+ temperature: 0.2
67
+ top_k: 20
68
+ top_p: 0.2
69
+ max_new_tokens: 150
70
+ co2_eq_emissions:
71
+ emissions: 5600
72
+ source: CodeCarbon
73
+ training_type: pre-training
74
+ geographical_location: Germany
75
+ hardware_used: NVIDIA A100-SXM4-40GB
76
+ model-index:
77
+ - name: TeenyTinyLlama-160m
78
+ results:
79
+ - task:
80
+ type: text-generation
81
+ name: Text Generation
82
+ dataset:
83
+ name: ENEM Challenge (No Images)
84
+ type: eduagarcia/enem_challenge
85
+ split: train
86
+ args:
87
+ num_few_shot: 3
88
+ metrics:
89
+ - type: acc
90
+ value: 19.24
91
+ name: accuracy
92
+ source:
93
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
94
+ name: Open Portuguese LLM Leaderboard
95
+ - task:
96
+ type: text-generation
97
+ name: Text Generation
98
+ dataset:
99
+ name: BLUEX (No Images)
100
+ type: eduagarcia-temp/BLUEX_without_images
101
+ split: train
102
+ args:
103
+ num_few_shot: 3
104
+ metrics:
105
+ - type: acc
106
+ value: 23.09
107
+ name: accuracy
108
+ source:
109
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
110
+ name: Open Portuguese LLM Leaderboard
111
+ - task:
112
+ type: text-generation
113
+ name: Text Generation
114
+ dataset:
115
+ name: OAB Exams
116
+ type: eduagarcia/oab_exams
117
+ split: train
118
+ args:
119
+ num_few_shot: 3
120
+ metrics:
121
+ - type: acc
122
+ value: 22.37
123
+ name: accuracy
124
+ source:
125
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
126
+ name: Open Portuguese LLM Leaderboard
127
+ - task:
128
+ type: text-generation
129
+ name: Text Generation
130
+ dataset:
131
+ name: Assin2 RTE
132
+ type: assin2
133
+ split: test
134
+ args:
135
+ num_few_shot: 15
136
+ metrics:
137
+ - type: f1_macro
138
+ value: 53.97
139
+ name: f1-macro
140
+ source:
141
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
142
+ name: Open Portuguese LLM Leaderboard
143
+ - task:
144
+ type: text-generation
145
+ name: Text Generation
146
+ dataset:
147
+ name: Assin2 STS
148
+ type: eduagarcia/portuguese_benchmark
149
+ split: test
150
+ args:
151
+ num_few_shot: 15
152
+ metrics:
153
+ - type: pearson
154
+ value: 0.24
155
+ name: pearson
156
+ source:
157
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
158
+ name: Open Portuguese LLM Leaderboard
159
+ - task:
160
+ type: text-generation
161
+ name: Text Generation
162
+ dataset:
163
+ name: FaQuAD NLI
164
+ type: ruanchaves/faquad-nli
165
+ split: test
166
+ args:
167
+ num_few_shot: 15
168
+ metrics:
169
+ - type: f1_macro
170
+ value: 43.97
171
+ name: f1-macro
172
+ source:
173
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
174
+ name: Open Portuguese LLM Leaderboard
175
+ - task:
176
+ type: text-generation
177
+ name: Text Generation
178
+ dataset:
179
+ name: HateBR Binary
180
+ type: ruanchaves/hatebr
181
+ split: test
182
+ args:
183
+ num_few_shot: 25
184
+ metrics:
185
+ - type: f1_macro
186
+ value: 36.92
187
+ name: f1-macro
188
+ source:
189
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
190
+ name: Open Portuguese LLM Leaderboard
191
+ - task:
192
+ type: text-generation
193
+ name: Text Generation
194
+ dataset:
195
+ name: PT Hate Speech Binary
196
+ type: hate_speech_portuguese
197
+ split: test
198
+ args:
199
+ num_few_shot: 25
200
+ metrics:
201
+ - type: f1_macro
202
+ value: 42.63
203
+ name: f1-macro
204
+ source:
205
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
206
+ name: Open Portuguese LLM Leaderboard
207
+ - task:
208
+ type: text-generation
209
+ name: Text Generation
210
+ dataset:
211
+ name: tweetSentBR
212
+ type: eduagarcia-temp/tweetsentbr
213
+ split: test
214
+ args:
215
+ num_few_shot: 25
216
+ metrics:
217
+ - type: f1_macro
218
+ value: 11.39
219
+ name: f1-macro
220
+ source:
221
+ url: https://huggingface.co/spaces/eduagarcia/open_pt_llm_leaderboard?query=nicholasKluge/TeenyTinyLlama-160m
222
+ name: Open Portuguese LLM Leaderboard
223
+ ---
224
+ # TeenyTinyLlama-160m
225
+
226
+ <img src="./logo.png" alt="A little llama wearing a mushroom hat and a monocle." height="200">
227
+
228
+ ## Model Summary
229
+
230
+ Large language models (LLMs) have significantly advanced natural language processing, but their progress has yet to be equal across languages. While most LLMs are trained in high-resource languages like English, multilingual models generally underperform monolingual ones. Additionally, aspects of their multilingual foundation sometimes restrict the byproducts they produce, like computational demands and licensing regimes. Hence, we developed the _TeenyTinyLlama_ pair: two compact models for Brazilian Portuguese text generation.
231
+
232
+ Read our preprint on [Article](https://www.sciencedirect.com/science/article/pii/S2666827024000343).
233
+
234
+ ## Details
235
+
236
+ - **Architecture:** a Transformer-based model pre-trained via causal language modeling
237
+ - **Size:** 162,417,408 parameters
238
+ - **Context length:** 2048 tokens
239
+ - **Dataset:** [Pt-Corpus Instruct](https://huggingface.co/datasets/nicholasKluge/Pt-Corpus-Instruct) (6.2B tokens)
240
+ - **Language:** Portuguese
241
+ - **Number of steps:** 458,000
242
+ - **GPU:** 1 NVIDIA A100-SXM4-40GB
243
+ - **Training time**: ~ 36 hours
244
+ - **Emissions:** 5.6 KgCO2 (Germany)
245
+ - **Total energy consumption:** 15.5 kWh
246
+
247
+ This repository has the [source code](https://github.com/Nkluge-correa/TeenyTinyLlama) used to train this model. The main libraries used are:
248
+
249
+ - [Transformers](https://github.com/huggingface/transformers)
250
+ - [PyTorch](https://github.com/pytorch/pytorch)
251
+ - [Datasets](https://github.com/huggingface/datasets)
252
+ - [Tokenizers](https://github.com/huggingface/tokenizers)
253
+ - [Sentencepiece](https://github.com/google/sentencepiece)
254
+ - [Accelerate](https://github.com/huggingface/accelerate)
255
+ - [FlashAttention](https://github.com/Dao-AILab/flash-attention)
256
+ - [Codecarbon](https://github.com/mlco2/codecarbon)
257
+
258
+ ## Intended Uses
259
+
260
+ The primary intended use of TeenyTinyLlama is to research the challenges related to developing language models for low-resource languages. Checkpoints saved during training are intended to provide a controlled setting for performing scientific experiments. You may also further fine-tune and adapt TeenyTinyLlama for deployment, as long as your use is following the Apache 2.0 license. If you decide to use pre-trained TeenyTinyLlama as a basis for your fine-tuned model, please conduct your own risk and bias assessment.
261
+
262
+ ## Out-of-scope Use
263
+
264
+ TeenyTinyLlama is not intended for deployment. It is not a product and should not be used for human-facing interactions.
265
+
266
+ TeenyTinyLlama models are Brazilian Portuguese language only and are not suitable for translation or generating text in other languages.
267
+
268
+ TeenyTinyLlama has not been fine-tuned for downstream contexts in which language models are commonly deployed.
269
+
270
+ ## Basic usage
271
+
272
+ Using the `pipeline`:
273
+
274
+ ```python
275
+ from transformers import pipeline
276
+
277
+ generator = pipeline("text-generation", model="nicholasKluge/TeenyTinyLlama-160m")
278
+
279
+ completions = generator("Astronomia é a ciência", num_return_sequences=2, max_new_tokens=100)
280
+
281
+ for comp in completions:
282
+ print(f"🤖 {comp['generated_text']}")
283
+ ```
284
+
285
+ Using the `AutoTokenizer` and `AutoModelForCausalLM`:
286
+
287
+ ```python
288
+ from transformers import AutoTokenizer, AutoModelForCausalLM
289
+ import torch
290
+
291
+ # Load model and the tokenizer
292
+ tokenizer = AutoTokenizer.from_pretrained("nicholasKluge/TeenyTinyLlama-160m", revision='main')
293
+ model = AutoModelForCausalLM.from_pretrained("nicholasKluge/TeenyTinyLlama-160m", revision='main')
294
+
295
+ # Pass the model to your device
296
+ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
297
+
298
+ model.eval()
299
+ model.to(device)
300
+
301
+ # Tokenize the inputs and pass them to the device
302
+ inputs = tokenizer("Astronomia é a ciência", return_tensors="pt").to(device)
303
+
304
+ # Generate some text
305
+ completions = model.generate(**inputs, num_return_sequences=2, max_new_tokens=100)
306
+
307
+ # Print the generated text
308
+ for i, completion in enumerate(completions):
309
+ print(f'🤖 {tokenizer.decode(completion)}')
310
+ ```
311
+
312
+ ## Limitations
313
+
314
+ Like almost all other language models trained on large text datasets scraped from the web, the TTL pair exhibited behavior that does not make them an out-of-the-box solution to many real-world applications, especially those requiring factual, reliable, nontoxic text generation. Our models are all subject to the following:
315
+
316
+ - **Hallucinations:** This model can produce content that can be mistaken for truth but is, in fact, misleading or entirely false, i.e., hallucination.
317
+
318
+ - **Biases and Toxicity:** This model inherits the social and historical stereotypes from the data used to train it. Given these biases, the model can produce toxic content, i.e., harmful, offensive, or detrimental to individuals, groups, or communities.
319
+
320
+ - **Unreliable Code:** The model may produce incorrect code snippets and statements. These code generations should not be treated as suggestions or accurate solutions.
321
+
322
+ - **Language Limitations:** The model is primarily designed to understand standard Brazilian Portuguese. Other languages might challenge its comprehension, leading to potential misinterpretations or errors in response.
323
+
324
+ - **Repetition and Verbosity:** The model may get stuck on repetition loops (especially if the repetition penalty during generations is set to a meager value) or produce verbose responses unrelated to the prompt it was given.
325
+
326
+ Hence, even though our models are released with a permissive license, we urge users to perform their risk analysis on these models if intending to use them for real-world applications and also have humans moderating the outputs of these models in applications where they will interact with an audience, guaranteeing users are always aware they are interacting with a language model.
327
+
328
+ ## Evaluations
329
+
330
+ During our training runs, both models showed consistent convergence. At no point did our evaluation curves show signs of overfitting or saturation. In the case of our 460m parameter model, we intentionally trained past the optimal point by approximately 75,000 steps to assess if there were any signs of saturation, but our evaluations consistently gave better results. We hypothesize that our models are under-trained but can improve if further trained to pass the Chinchilla optimal range.
331
+
332
+ | Processed Tokens | Perplexity | Energy Consumption (kWh) | Emissions (KgCO2eq) |
333
+ |------------------|------------|---------------------------|----------------------|
334
+ | 8.1M | 20.49 | 9.40 | 3.34 |
335
+ | 1.6B | 16.90 | 18.82 | 6.70 |
336
+ | 2.4B | 15.43 | 28.59 | 10.16 |
337
+ | 3.2B | 14.64 | 38.20 | 13.57 |
338
+ | 4.0B | 14.08 | 48.04 | 17.07 |
339
+ | 4.9B | 13.61 | 57.74 | 20.52 |
340
+ | 5.7B | 13.25 | 67.32 | 23.92 |
341
+ | 6.5B | 12.87 | 76.84 | 27.30 |
342
+ | 7.3B | 12.57 | 86.40 | 30.70 |
343
+ | 8.1B | 12.27 | 96.19 | 34.18 |
344
+ | 9.0B | 11.96 | 106.06 | 37.70 |
345
+ | 9.8B | 11.77 | 115.69 | 41.31 |
346
+
347
+ ## Benchmarks
348
+
349
+ Evaluations on benchmarks were performed using the [Language Model Evaluation Harness](https://github.com/EleutherAI/lm-evaluation-harness) (by [EleutherAI](https://www.eleuther.ai/)). [Laiviet](https://github.com/laiviet/lm-evaluation-harness) translated the tasks from the LM-Evaluation-Harness we used. The results of models marked with an "*" were extracted from the [Open LLM Leaderboard](https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard).
350
+
351
+ | | **ARC** | **HellaSwag** | **MMLU** | **TruthfulQA** | **Average** |
352
+ |------------------|-----------|---------------|-----------|----------------|-------------|
353
+ | Pythia-410m | 24.83* | 41.29* | 25.99* | 40.95* | 33.26 |
354
+ | **TTL-460m** | 29.40 | 33.00 | 28.55 | 41.10 | 33.01 |
355
+ | Bloom-560m | 24.74* | 37.15* | 24.22* | 42.44* | 32.13 |
356
+ | Xglm-564M | 25.56 | 34.64* | 25.18* | 42.53 | 31.97 |
357
+ | OPT-350m | 23.55* | 36.73* | 26.02* | 40.83* | 31.78 |
358
+ | **TTL-160m** | 26.15 | 29.29 | 28.11 | 41.12 | 31.16 |
359
+ | Pythia-160m | 24.06* | 31.39* | 24.86* | 44.34* | 31.16 |
360
+ | OPT-125m | 22.87* | 31.47* | 26.02* | 42.87* | 30.80 |
361
+ | GPorTuguese-2 | 22.48 | 29.62 | 27.36 | 41.44 | 30.22 |
362
+ | Gpt2-small | 21.48* | 31.60* | 25.79* | 40.65* | 29.97 |
363
+ | Multilingual GPT | 23.81 | 26.37* | 25.17* | 39.62 | 28.73 |
364
+
365
+ Evaluations on Brazilian Portuguese benchmarks were performed using a [Portuguese implementation of the EleutherAI LM Evaluation Harness](https://github.com/eduagarcia/lm-evaluation-harness-pt) (created by [Eduardo Garcia](https://github.com/eduagarcia/lm-evaluation-harness-pt)).
366
+
367
+ | | **ASSIN2 RTE** | **ASSIN2 STS** | **BLUEX** | **ENEM** | **FAQUAD NLI** | **HateBR** | **OAB Exams** | **Average** |
368
+ |----------------|----------------|----------------|-----------|----------|----------------|------------|---------------|-------------|
369
+ | Qwen-1.8B | 64.83 | 19.53 | 26.15 | 30.23 | 43.97 | 33.33 | 27.20 | 35.03 |
370
+ | TinyLlama-1.1B | 58.93 | 13.57 | 22.81 | 22.25 | 43.97 | 36.92 | 23.64 | 31.72 |
371
+ | **TTL-460m** | 53.93 | 12.66 | 22.81 | 19.87 | 49.01 | 33.59 | 27.06 | 31.27 |
372
+ | XGLM-564m | 49.61 | 22.91 | 19.61 | 19.38 | 43.97 | 33.99 | 23.42 | 30.41 |
373
+ | Bloom-1b7 | 53.60 | 4.81 | 21.42 | 18.96 | 43.97 | 34.89 | 23.05 | 28.67 |
374
+ | **TTL-160m** | 53.36 | 2.58 | 21.84 | 18.75 | 43.97 | 36.88 | 22.60 | 28.56 |
375
+ | OPT-125m | 39.77 | 2.00 | 21.84 | 17.42 | 43.97 | 47.04 | 22.78 | 27.83 |
376
+ | Pythia-160 | 33.33 | 12.81 | 16.13 | 16.66 | 50.36 | 41.09 | 22.82 | 27.60 |
377
+ | OLMo-1b | 34.12 | 9.28 | 18.92 | 20.29 | 43.97 | 41.33 | 22.96 | 27.26 |
378
+ | Bloom-560m | 33.33 | 8.48 | 18.92 | 19.03 | 43.97 | 37.07 | 23.05 | 26.26 |
379
+ | Pythia-410m | 33.33 | 4.80 | 19.47 | 19.45 | 43.97 | 33.33 | 23.01 | 25.33 |
380
+ | OPT-350m | 33.33 | 3.65 | 20.72 | 17.35 | 44.71 | 33.33 | 23.01 | 25.15 |
381
+ | GPT-2 small | 33.26 | 0.00 | 10.43 | 11.20 | 43.52 | 33.68 | 13.12 | 20.74 |
382
+ | GPorTuguese | 33.33 | 3.85 | 14.74 | 3.01 | 28.81 | 33.33 | 21.23 | 19.75 |
383
+ | Samba-1.1B | 33.33 | 1.30 | 8.07 | 10.22 | 17.72 | 35.79 | 15.03 | 17.35 |
384
+
385
+ ## Fine-Tuning Comparisons
386
+
387
+ To further evaluate the downstream capabilities of our models, we decided to employ a basic fine-tuning procedure for our TTL pair on a subset of tasks from the Poeta benchmark. We apply the same procedure for comparison purposes on both [BERTimbau](https://huggingface.co/neuralmind/bert-base-portuguese-cased) models, given that they are also LLM trained from scratch in Brazilian Portuguese and have a similar size range to our models. We used these comparisons to assess if our pre-training runs produced LLM capable of producing good results ("good" here means "close to BERTimbau") when utilized for downstream applications.
388
+
389
+ | Models | IMDB | FaQuAD-NLI | HateBr | Assin2 | AgNews | Average |
390
+ |-----------------|-----------|------------|-----------|-----------|-----------|---------|
391
+ | BERTimbau-large | **93.58** | 92.26 | 91.57 | **88.97** | 94.11 | 92.10 |
392
+ | BERTimbau-small | 92.22 | **93.07** | 91.28 | 87.45 | 94.19 | 91.64 |
393
+ | **TTL-460m** | 91.64 | 91.18 | **92.28** | 86.43 | **94.42** | 91.19 |
394
+ | **TTL-160m** | 91.14 | 90.00 | 90.71 | 85.78 | 94.05 | 90.34 |
395
+
396
+ All the shown results are the higher accuracy scores achieved on the respective task test sets after fine-tuning the models on the training sets. All fine-tuning runs used the same hyperparameters, and the code implementation can be found in the [model cards](https://huggingface.co/nicholasKluge/TeenyTinyLlama-460m-HateBR) of our fine-tuned models.
397
+
398
+ ## Cite as 🤗
399
+
400
+ ```latex
401
+ @misc{correa24ttllama,
402
+ title = {TeenyTinyLlama: open-source tiny language models trained in Brazilian Portuguese},
403
+ author = {Corr{\^e}a, Nicholas Kluge and Falk, Sophia and Fatimah, Shiza and Sen, Aniket and De Oliveira, Nythamar},
404
+ journal={arXiv preprint arXiv:2401.16640},
405
+ year={2024}
406
+ }
407
+
408
+ @misc{correa24ttllama,
409
+ doi = {10.1016/j.mlwa.2024.100558},
410
+ url = {https://www.sciencedirect.com/science/article/pii/S2666827024000343},
411
+ title = {TeenyTinyLlama: open-source tiny language models trained in Brazilian Portuguese},
412
+ author = {Corr{\^e}a, Nicholas Kluge and Falk, Sophia and Fatimah, Shiza and Sen, Aniket and De Oliveira, Nythamar},
413
+ journal={Machine Learning With Applications},
414
+ publisher = {Springer},
415
+ year={2024}
416
+ }
417
+ ```
418
+
419
+ ## Funding
420
+
421
+ This repository was built as part of the RAIES ([Rede de Inteligência Artificial Ética e Segura](https://www.raies.org/)) initiative, a project supported by FAPERGS - ([Fundação de Amparo à Pesquisa do Estado do Rio Grande do Sul](https://fapergs.rs.gov.br/inicial)), Brazil.
422
+
423
+ ## License
424
+
425
+ TeenyTinyLlama-160m is licensed under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for more details.
426
+
427
+