Fazzioni commited on
Commit
a7407c5
·
verified ·
1 Parent(s): b761868

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +59 -155
README.md CHANGED
@@ -1,214 +1,118 @@
1
  ---
2
  library_name: transformers
3
- tags: []
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
 
8
- <!-- Provide a quick summary of what the model is/does. -->
9
 
 
10
 
 
11
 
12
  ## Model Details
13
 
14
  ### Model Description
15
 
16
- <!-- Provide a longer summary of what this model is. -->
17
 
18
- This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
 
 
19
 
20
- - **Developed by:** [More Information Needed]
21
- - **Funded by [optional]:** [More Information Needed]
22
- - **Shared by [optional]:** [More Information Needed]
23
- - **Model type:** [More Information Needed]
24
- - **Language(s) (NLP):** [More Information Needed]
25
- - **License:** [More Information Needed]
26
- - **Finetuned from model [optional]:** [More Information Needed]
27
 
28
- ### Model Sources [optional]
29
 
30
- <!-- Provide the basic links for the model. -->
31
-
32
- - **Repository:** [More Information Needed]
33
- - **Paper [optional]:** [More Information Needed]
34
- - **Demo [optional]:** [More Information Needed]
35
 
36
  ## Uses
37
 
38
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
39
- ```python
40
- from transformers import AutoTokenizer, AutoModelForCausalLM
41
-
42
- model = AutoModelForCausalLM.from_pretrained("CEIA-UFG/gemma-3-4b-it-pt", torch_dtype='bfloat16')
43
- tokenizer = AutoTokenizer.from_pretrained("CEIA-UFG/gemma-3-4b-it-pt")
44
-
45
-
46
- prompt = [[{'role':'user', 'content': 'por que a atmosfera é azul?'}]]
47
- input_ids = tokenizer.apply_chat_template(prompt, return_tensors="pt", add_special_tokens=True, add_generation_prompt=True)
48
- outputs = model.generate(input_ids=input_ids, max_new_tokens=2048)
49
-
50
-
51
- for sample in tokenizer.batch_decode(outputs, skip_special_tokens=True):
52
- print(sample)
53
- ```
54
 
55
  ### Direct Use
56
 
57
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
58
-
59
- [More Information Needed]
60
-
61
- ### Downstream Use [optional]
62
 
63
- <!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
64
 
65
- [More Information Needed]
 
 
 
 
66
 
67
  ### Out-of-Scope Use
68
 
69
- <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
70
-
71
- [More Information Needed]
72
 
73
  ## Bias, Risks, and Limitations
74
 
75
- <!-- This section is meant to convey both technical and sociotechnical limitations. -->
76
 
77
- [More Information Needed]
78
 
79
  ### Recommendations
80
 
81
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
82
-
83
- Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
84
-
85
- ## How to Get Started with the Model
86
-
87
- Use the code below to get started with the model.
88
-
89
- [More Information Needed]
90
 
91
  ## Training Details
92
 
93
  ### Training Data
94
 
95
- <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
 
 
96
 
97
- [More Information Needed]
98
 
99
  ### Training Procedure
100
 
101
- <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
102
-
103
- #### Preprocessing [optional]
104
-
105
- [More Information Needed]
106
-
107
 
108
  #### Training Hyperparameters
109
 
110
- - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
111
-
112
- #### Speeds, Sizes, Times [optional]
113
-
114
- <!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
115
-
116
- [More Information Needed]
117
 
118
  ## Evaluation
119
 
120
- <!-- This section describes the evaluation protocols and provides the results. -->
121
-
122
- ### Testing Data, Factors & Metrics
123
-
124
- #### Testing Data
125
-
126
- <!-- This should link to a Dataset Card if possible. -->
127
-
128
- [More Information Needed]
129
-
130
- #### Factors
131
-
132
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
133
-
134
- [More Information Needed]
135
-
136
- #### Metrics
137
-
138
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
139
-
140
- [More Information Needed]
141
 
142
  ### Results
143
 
144
- [More Information Needed]
 
 
 
 
 
145
 
146
  #### Summary
147
 
 
148
 
 
149
 
150
- ## Model Examination [optional]
151
-
152
- <!-- Relevant interpretability work for the model goes here -->
153
-
154
- [More Information Needed]
155
-
156
- ## Environmental Impact
157
-
158
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
159
-
160
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
161
-
162
- - **Hardware Type:** [More Information Needed]
163
- - **Hours used:** [More Information Needed]
164
- - **Cloud Provider:** [More Information Needed]
165
- - **Compute Region:** [More Information Needed]
166
- - **Carbon Emitted:** [More Information Needed]
167
-
168
- ## Technical Specifications [optional]
169
-
170
- ### Model Architecture and Objective
171
-
172
- [More Information Needed]
173
-
174
- ### Compute Infrastructure
175
-
176
- [More Information Needed]
177
-
178
- #### Hardware
179
-
180
- [More Information Needed]
181
-
182
- #### Software
183
-
184
- [More Information Needed]
185
-
186
- ## Citation [optional]
187
-
188
- <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
189
 
190
  **BibTeX:**
191
-
192
- [More Information Needed]
193
-
194
- **APA:**
195
-
196
- [More Information Needed]
197
-
198
- ## Glossary [optional]
199
-
200
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
201
-
202
- [More Information Needed]
203
-
204
- ## More Information [optional]
205
-
206
- [More Information Needed]
207
-
208
- ## Model Card Authors [optional]
209
-
210
- [More Information Needed]
211
-
212
- ## Model Card Contact
213
-
214
- [More Information Needed]
 
1
  ---
2
  library_name: transformers
3
+ license: gemma
4
+ language:
5
+ - pt
6
+ base_model:
7
+ - google/gemma-3-4b-pt
8
  ---
9
 
 
10
 
11
+ # Model Card for GAIA (gemma-3-4b-it-pt)
12
 
13
+ **GAIA** is an open, state-of-the-art language model for Brazilian Portuguese. It was developed by continuously pre-training the `google/gemma-3-4b-pt` model on an extensive, high-quality corpus of Portuguese data.
14
 
15
+ The goal of GAIA is to democratize access to cutting-edge AI technology in Brazil, enabling developers, researchers, and organizations to build innovative solutions on a robust and reliable technological foundation.
16
 
17
  ## Model Details
18
 
19
  ### Model Description
20
 
21
+ **GAIA** was developed through a partnership between **The Brazilian Association of AI (ABRIA)**, the **Center of Excellence in Artificial Intelligence (CEIA) at the Federal University of Goiás (UFG)**, startups **Nama** and **Amadeus AI**, and **Google DeepMind**.
22
 
23
+ The development process started with the base model `google/gemma-3-4b-pt` and involved two main stages:
24
+ 1. **Continuous Pre-training:** The model was trained on a large, high-quality Portuguese dataset totaling approximately **13 billion tokens**. This corpus includes a variety of domains, such as scientific articles and Wikipedia data in Portuguese, ensuring a deep understanding of the language and its contexts.
25
+ 2. **Instruction-Following Capability Restoration:** To enable the model to follow instructions without traditional supervised fine-tuning (SFT), a weight merging operation was applied. This technique, described in the paper *“Balancing Continuous Pre-Training and Instruction Fine-Tuning: Optimizing Instruction-Following in LLMs”*, allows the model to integrate the knowledge acquired during continuous pre-training with the ability to interact in a chat format and follow instructions.
26
 
27
+ - **Developed by:** The Brazilian Association of AI (ABRIA), the Center of Excellence in Artificial Intelligence (CEIA-UFG), Nama, Amadeus AI, and Google DeepMind.
28
+ - **Model:** GAIA (gemma-3-4b-it-pt)
29
+ - **Model type:** Causal decoder-only Transformer-based language model.
30
+ - **Language(s):** Brazilian Portuguese (pt-BR)
31
+ - **License:** Gemma
32
+ - **Based on:** `google/gemma-3-4b-pt`
 
33
 
34
+ ### Model Sources
35
 
36
+ - **Repository:** [CEIA-UFG/gemma-3-4b-it-pt](https://huggingface.co/CEIA-UFG/gemma-3-4b-it-pt)
37
+ - **Paper (Merge Methodology):** [Balancing Continuous Pre-Training and Instruction Fine-Tuning: Optimizing Instruction-Following in LLMs](https://arxiv.org/pdf/2410.10739)
 
 
 
38
 
39
  ## Uses
40
 
41
+ The model is designed for text generation and conversational tasks in Portuguese.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  ### Direct Use
44
 
45
+ GAIA can be used directly for chat, question answering, summarization, creative content generation, and other tasks requiring natural language understanding and generation in Portuguese.
 
 
 
 
46
 
47
+ ### Downstream Use
48
 
49
+ GAIA serves as an excellent base model for fine-tuning on specific tasks, such as:
50
+ - Sentiment analysis in Portuguese.
51
+ - Retrieval-Augmented Generation (RAG) systems for corporate knowledge bases.
52
+ - Document classification.
53
+ - Specialized customer service chatbots.
54
 
55
  ### Out-of-Scope Use
56
 
57
+ This model should not be used for high-stakes, critical decisions without human oversight. Its use for generating malicious, offensive, or illegal content, or for deceptively impersonating a human, is outside the intended scope. The model's performance in languages other than Portuguese will be significantly degraded.
 
 
58
 
59
  ## Bias, Risks, and Limitations
60
 
61
+ Like any language model, GAIA reflects the biases present in its training data. Although the training corpus was curated with a focus on high quality, it may contain social and cultural biases from sources like Wikipedia and scientific articles. Therefore, the model may generate content that perpetuates existing stereotypes.
62
 
63
+ Furthermore, the model can "hallucinate," meaning it can generate information that appears factual but is not true. We strongly recommend verifying critical facts generated by the model before any use.
64
 
65
  ### Recommendations
66
 
67
+ Users (both direct and downstream) should be aware of the model's risks, biases, and limitations. Implementing safeguards and content moderation is recommended, especially in public-facing applications. Human supervision is crucial for sensitive use cases.
 
 
 
 
 
 
 
 
68
 
69
  ## Training Details
70
 
71
  ### Training Data
72
 
73
+ The continuous pre-training was performed on a corpus of approximately **13 billion tokens** in Portuguese. The data selection prioritized high quality and diversity, including sources such as:
74
+ - **Scientific Articles in Portuguese:** To provide the model with more formal and technical knowledge.
75
+ - **Portuguese Wikipedia:** To cover a wide range of general knowledge.
76
 
77
+ A rigorous cleaning and filtering process was applied to ensure the highest possible data quality.
78
 
79
  ### Training Procedure
80
 
81
+ The training was conducted on a **DGX infrastructure with NVIDIA H100 GPUs**, using between 3 and 5 GPUs in parallel.
 
 
 
 
 
82
 
83
  #### Training Hyperparameters
84
 
85
+ - **Training regime:** Mixed Precision (bf16)
86
+ - **Global Batch Size:** 4 million tokens
 
 
 
 
 
87
 
88
  ## Evaluation
89
 
90
+ The model was evaluated on a set of multiple-choice benchmarks in Portuguese, comparing its performance against the base model, `google/gemma-3-4b-it`. The benchmarks include BlueX (a compilation of multiple-choice questions), and questions from the ENEM (Brazilian High School National Exam) and OAB (Brazilian Bar Exam).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
  ### Results
93
 
94
+ | Benchmark | `google/gemma-3-4b-it` (Baseline) | GAIA (Our Model) |
95
+ |------------------|-----------------------------------|------------------|
96
+ | BlueX | 0.6630 | 0.6575 |
97
+ | ENEM 2024 | 0.6556 | **0.7000** |
98
+ | ENEM (General) | 0.7416 | 0.7486 |
99
+ | OAB (Bar Exam) | **0.4502** | 0.4416 |
100
 
101
  #### Summary
102
 
103
+ The results indicate that continuous pre-training on Portuguese data had a notable impact on the model's performance. **GAIA** showed a significant improvement on the **ENEM 2024** benchmark, outperforming the Google base model. On other benchmarks like BlueX and OAB, its performance is competitive and very close to the original model's, suggesting that the additional training process maintained the model's general capabilities while enhancing its knowledge in specific Portuguese-language domains.
104
 
105
+ ## Citation
106
 
107
+ If you use this model in your research or application, please cite our work.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
  **BibTeX:**
110
+ ```bibtex
111
+ @misc{gaia-gemma-3-4b-2025,
112
+ title={GAIA: An Open Language Model for Brazilian Portuguese},
113
+ author={Center of Excellence in Artificial Intelligence (CEIA-UFG) and The Brazilian Association of AI (ABRIA) and Nama and Amadeus AI and Google DeepMind},
114
+ year={2025},
115
+ publisher={Hugging Face},
116
+ journal={Hugging Face repository},
117
+ howpublished={\url{[https://huggingface.co/CEIA-UFG/gemma-3-4b-it-pt](https://huggingface.co/CEIA-UFG/gemma-3-4b-it-pt)}}
118
+ }