danielhanchen commited on
Commit
03a2758
·
verified ·
1 Parent(s): c01f1d7

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,454 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model:
3
+ - google/gemma-3-27b-it-qat-q4_0-unquantized
4
+ license: gemma
5
+ tags:
6
+ - gemma3
7
+ - unsloth
8
+ - gemma
9
+ - google
10
+ pipeline_tag: image-text-to-text
11
+ library_name: transformers
12
+ extra_gated_heading: Access Gemma on Hugging Face
13
+ extra_gated_prompt: >-
14
+ To access Gemma on Hugging Face, you’re required to review and agree to
15
+ Google’s usage license. To do this, please ensure you’re logged in to Hugging
16
+ Face and click below. Requests are processed immediately.
17
+ extra_gated_button_content: Acknowledge license
18
+ ---
19
+
20
+ # Gemma 3 model card
21
+
22
+ **Model Page**: [Gemma](https://ai.google.dev/gemma/docs/core)
23
+
24
+ > [!Note]
25
+ > This repository corresponds to the 27B **instruction-tuned** version of the Gemma 3 model using Quantization Aware Training (QAT).
26
+ >
27
+ > **The checkpoint in this repository is unquantized, please make sure to quantize with Q4_0 with your favorite tool**
28
+ >
29
+ > Thanks to QAT, the model is able to preserve similar quality as `bfloat16` while significantly reducing the memory requirements
30
+ > to load the model.
31
+
32
+
33
+ **Resources and Technical Documentation**:
34
+
35
+ * [Gemma 3 Technical Report][g3-tech-report]
36
+ * [Responsible Generative AI Toolkit][rai-toolkit]
37
+ * [Gemma on Kaggle][kaggle-gemma]
38
+ * [Gemma on Vertex Model Garden][vertex-mg-gemma3]
39
+
40
+ **Terms of Use**: [Terms][terms]
41
+
42
+ **Authors**: Google DeepMind
43
+
44
+ ## Model Information
45
+
46
+ Summary description and brief definition of inputs and outputs.
47
+
48
+ ### Description
49
+
50
+ Gemma is a family of lightweight, state-of-the-art open models from Google,
51
+ built from the same research and technology used to create the Gemini models.
52
+ Gemma 3 models are multimodal, handling text and image input and generating text
53
+ output, with open weights for both pre-trained variants and instruction-tuned
54
+ variants. Gemma 3 has a large, 128K context window, multilingual support in over
55
+ 140 languages, and is available in more sizes than previous versions. Gemma 3
56
+ models are well-suited for a variety of text generation and image understanding
57
+ tasks, including question answering, summarization, and reasoning. Their
58
+ relatively small size makes it possible to deploy them in environments with
59
+ limited resources such as laptops, desktops or your own cloud infrastructure,
60
+ democratizing access to state of the art AI models and helping foster innovation
61
+ for everyone.
62
+
63
+ ### Inputs and outputs
64
+
65
+ - **Input:**
66
+ - Text string, such as a question, a prompt, or a document to be summarized
67
+ - Images, normalized to 896 x 896 resolution and encoded to 256 tokens
68
+ each
69
+ - Total input context of 128K tokens for the 4B, 12B, and 27B sizes, and
70
+ 32K tokens for the 1B size
71
+
72
+ - **Output:**
73
+ - Generated text in response to the input, such as an answer to a
74
+ question, analysis of image content, or a summary of a document
75
+ - Total output context of 8192 tokens
76
+
77
+ ### Citation
78
+
79
+ ```none
80
+ @article{gemma_2025,
81
+ title={Gemma 3},
82
+ url={https://goo.gle/Gemma3Report},
83
+ publisher={Kaggle},
84
+ author={Gemma Team},
85
+ year={2025}
86
+ }
87
+ ```
88
+
89
+ ## Model Data
90
+
91
+ Data used for model training and how the data was processed.
92
+
93
+ ### Training Dataset
94
+
95
+ These models were trained on a dataset of text data that includes a wide variety
96
+ of sources. The 27B model was trained with 14 trillion tokens, the 12B model was
97
+ trained with 12 trillion tokens, 4B model was trained with 4 trillion tokens and
98
+ 1B with 2 trillion tokens. Here are the key components:
99
+
100
+ - Web Documents: A diverse collection of web text ensures the model is
101
+ exposed to a broad range of linguistic styles, topics, and vocabulary. The
102
+ training dataset includes content in over 140 languages.
103
+ - Code: Exposing the model to code helps it to learn the syntax and
104
+ patterns of programming languages, which improves its ability to generate
105
+ code and understand code-related questions.
106
+ - Mathematics: Training on mathematical text helps the model learn logical
107
+ reasoning, symbolic representation, and to address mathematical queries.
108
+ - Images: A wide range of images enables the model to perform image
109
+ analysis and visual data extraction tasks.
110
+
111
+ The combination of these diverse data sources is crucial for training a powerful
112
+ multimodal model that can handle a wide variety of different tasks and data
113
+ formats.
114
+
115
+ ### Data Preprocessing
116
+
117
+ Here are the key data cleaning and filtering methods applied to the training
118
+ data:
119
+
120
+ - CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering
121
+ was applied at multiple stages in the data preparation process to ensure
122
+ the exclusion of harmful and illegal content.
123
+ - Sensitive Data Filtering: As part of making Gemma pre-trained models
124
+ safe and reliable, automated techniques were used to filter out certain
125
+ personal information and other sensitive data from training sets.
126
+ - Additional methods: Filtering based on content quality and safety in
127
+ line with [our policies][safety-policies].
128
+
129
+ ## Implementation Information
130
+
131
+ Details about the model internals.
132
+
133
+ ### Hardware
134
+
135
+ Gemma was trained using [Tensor Processing Unit (TPU)][tpu] hardware (TPUv4p,
136
+ TPUv5p and TPUv5e). Training vision-language models (VLMS) requires significant
137
+ computational power. TPUs, designed specifically for matrix operations common in
138
+ machine learning, offer several advantages in this domain:
139
+
140
+ - Performance: TPUs are specifically designed to handle the massive
141
+ computations involved in training VLMs. They can speed up training
142
+ considerably compared to CPUs.
143
+ - Memory: TPUs often come with large amounts of high-bandwidth memory,
144
+ allowing for the handling of large models and batch sizes during training.
145
+ This can lead to better model quality.
146
+ - Scalability: TPU Pods (large clusters of TPUs) provide a scalable
147
+ solution for handling the growing complexity of large foundation models.
148
+ You can distribute training across multiple TPU devices for faster and more
149
+ efficient processing.
150
+ - Cost-effectiveness: In many scenarios, TPUs can provide a more
151
+ cost-effective solution for training large models compared to CPU-based
152
+ infrastructure, especially when considering the time and resources saved
153
+ due to faster training.
154
+ - These advantages are aligned with
155
+ [Google's commitments to operate sustainably][sustainability].
156
+
157
+ ### Software
158
+
159
+ Training was done using [JAX][jax] and [ML Pathways][ml-pathways].
160
+
161
+ JAX allows researchers to take advantage of the latest generation of hardware,
162
+ including TPUs, for faster and more efficient training of large models. ML
163
+ Pathways is Google's latest effort to build artificially intelligent systems
164
+ capable of generalizing across multiple tasks. This is specially suitable for
165
+ foundation models, including large language models like these ones.
166
+
167
+ Together, JAX and ML Pathways are used as described in the
168
+ [paper about the Gemini family of models][gemini-2-paper]; *"the 'single
169
+ controller' programming model of Jax and Pathways allows a single Python
170
+ process to orchestrate the entire training run, dramatically simplifying the
171
+ development workflow."*
172
+
173
+ ## Evaluation
174
+
175
+ > [!Note]
176
+ > The evaluation in this section correspond to the original checkpoint, not the QAT checkpoint.
177
+ >
178
+
179
+ Model evaluation metrics and results.
180
+
181
+ ### Benchmark Results
182
+
183
+ These models were evaluated against a large collection of different datasets and
184
+ metrics to cover different aspects of text generation:
185
+
186
+ #### Reasoning and factuality
187
+
188
+ | Benchmark | Metric | Gemma 3 PT 1B | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
189
+ | ------------------------------ |----------------|:--------------:|:-------------:|:--------------:|:--------------:|
190
+ | [HellaSwag][hellaswag] | 10-shot | 62.3 | 77.2 | 84.2 | 85.6 |
191
+ | [BoolQ][boolq] | 0-shot | 63.2 | 72.3 | 78.8 | 82.4 |
192
+ | [PIQA][piqa] | 0-shot | 73.8 | 79.6 | 81.8 | 83.3 |
193
+ | [SocialIQA][socialiqa] | 0-shot | 48.9 | 51.9 | 53.4 | 54.9 |
194
+ | [TriviaQA][triviaqa] | 5-shot | 39.8 | 65.8 | 78.2 | 85.5 |
195
+ | [Natural Questions][naturalq] | 5-shot | 9.48 | 20.0 | 31.4 | 36.1 |
196
+ | [ARC-c][arc] | 25-shot | 38.4 | 56.2 | 68.9 | 70.6 |
197
+ | [ARC-e][arc] | 0-shot | 73.0 | 82.4 | 88.3 | 89.0 |
198
+ | [WinoGrande][winogrande] | 5-shot | 58.2 | 64.7 | 74.3 | 78.8 |
199
+ | [BIG-Bench Hard][bbh] | few-shot | 28.4 | 50.9 | 72.6 | 77.7 |
200
+ | [DROP][drop] | 1-shot | 42.4 | 60.1 | 72.2 | 77.2 |
201
+
202
+ [hellaswag]: https://arxiv.org/abs/1905.07830
203
+ [boolq]: https://arxiv.org/abs/1905.10044
204
+ [piqa]: https://arxiv.org/abs/1911.11641
205
+ [socialiqa]: https://arxiv.org/abs/1904.09728
206
+ [triviaqa]: https://arxiv.org/abs/1705.03551
207
+ [naturalq]: https://github.com/google-research-datasets/natural-questions
208
+ [arc]: https://arxiv.org/abs/1911.01547
209
+ [winogrande]: https://arxiv.org/abs/1907.10641
210
+ [bbh]: https://paperswithcode.com/dataset/bbh
211
+ [drop]: https://arxiv.org/abs/1903.00161
212
+
213
+ #### STEM and code
214
+
215
+ | Benchmark | Metric | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
216
+ | ------------------------------ |----------------|:-------------:|:--------------:|:--------------:|
217
+ | [MMLU][mmlu] | 5-shot | 59.6 | 74.5 | 78.6 |
218
+ | [MMLU][mmlu] (Pro COT) | 5-shot | 29.2 | 45.3 | 52.2 |
219
+ | [AGIEval][agieval] | 3-5-shot | 42.1 | 57.4 | 66.2 |
220
+ | [MATH][math] | 4-shot | 24.2 | 43.3 | 50.0 |
221
+ | [GSM8K][gsm8k] | 8-shot | 38.4 | 71.0 | 82.6 |
222
+ | [GPQA][gpqa] | 5-shot | 15.0 | 25.4 | 24.3 |
223
+ | [MBPP][mbpp] | 3-shot | 46.0 | 60.4 | 65.6 |
224
+ | [HumanEval][humaneval] | 0-shot | 36.0 | 45.7 | 48.8 |
225
+
226
+ [mmlu]: https://arxiv.org/abs/2009.03300
227
+ [agieval]: https://arxiv.org/abs/2304.06364
228
+ [math]: https://arxiv.org/abs/2103.03874
229
+ [gsm8k]: https://arxiv.org/abs/2110.14168
230
+ [gpqa]: https://arxiv.org/abs/2311.12022
231
+ [mbpp]: https://arxiv.org/abs/2108.07732
232
+ [humaneval]: https://arxiv.org/abs/2107.03374
233
+
234
+ #### Multilingual
235
+
236
+ | Benchmark | Gemma 3 PT 1B | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
237
+ | ------------------------------------ |:-------------:|:-------------:|:--------------:|:--------------:|
238
+ | [MGSM][mgsm] | 2.04 | 34.7 | 64.3 | 74.3 |
239
+ | [Global-MMLU-Lite][global-mmlu-lite] | 24.9 | 57.0 | 69.4 | 75.7 |
240
+ | [WMT24++][wmt24pp] (ChrF) | 36.7 | 48.4 | 53.9 | 55.7 |
241
+ | [FloRes][flores] | 29.5 | 39.2 | 46.0 | 48.8 |
242
+ | [XQuAD][xquad] (all) | 43.9 | 68.0 | 74.5 | 76.8 |
243
+ | [ECLeKTic][eclektic] | 4.69 | 11.0 | 17.2 | 24.4 |
244
+ | [IndicGenBench][indicgenbench] | 41.4 | 57.2 | 61.7 | 63.4 |
245
+
246
+ [mgsm]: https://arxiv.org/abs/2210.03057
247
+ [flores]: https://arxiv.org/abs/2106.03193
248
+ [xquad]: https://arxiv.org/abs/1910.11856v3
249
+ [global-mmlu-lite]: https://huggingface.co/datasets/CohereForAI/Global-MMLU-Lite
250
+ [wmt24pp]: https://arxiv.org/abs/2502.12404v1
251
+ [eclektic]: https://arxiv.org/abs/2502.21228
252
+ [indicgenbench]: https://arxiv.org/abs/2404.16816
253
+
254
+ #### Multimodal
255
+
256
+ | Benchmark | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
257
+ | ------------------------------ |:-------------:|:--------------:|:--------------:|
258
+ | [COCOcap][coco-cap] | 102 | 111 | 116 |
259
+ | [DocVQA][docvqa] (val) | 72.8 | 82.3 | 85.6 |
260
+ | [InfoVQA][info-vqa] (val) | 44.1 | 54.8 | 59.4 |
261
+ | [MMMU][mmmu] (pt) | 39.2 | 50.3 | 56.1 |
262
+ | [TextVQA][textvqa] (val) | 58.9 | 66.5 | 68.6 |
263
+ | [RealWorldQA][realworldqa] | 45.5 | 52.2 | 53.9 |
264
+ | [ReMI][remi] | 27.3 | 38.5 | 44.8 |
265
+ | [AI2D][ai2d] | 63.2 | 75.2 | 79.0 |
266
+ | [ChartQA][chartqa] | 63.6 | 74.7 | 76.3 |
267
+ | [VQAv2][vqav2] | 63.9 | 71.2 | 72.9 |
268
+ | [BLINK][blinkvqa] | 38.0 | 35.9 | 39.6 |
269
+ | [OKVQA][okvqa] | 51.0 | 58.7 | 60.2 |
270
+ | [TallyQA][tallyqa] | 42.5 | 51.8 | 54.3 |
271
+ | [SpatialSense VQA][ss-vqa] | 50.9 | 60.0 | 59.4 |
272
+ | [CountBenchQA][countbenchqa] | 26.1 | 17.8 | 68.0 |
273
+
274
+ [coco-cap]: https://cocodataset.org/#home
275
+ [docvqa]: https://www.docvqa.org/
276
+ [info-vqa]: https://arxiv.org/abs/2104.12756
277
+ [mmmu]: https://arxiv.org/abs/2311.16502
278
+ [textvqa]: https://textvqa.org/
279
+ [realworldqa]: https://paperswithcode.com/dataset/realworldqa
280
+ [remi]: https://arxiv.org/html/2406.09175v1
281
+ [ai2d]: https://allenai.org/data/diagrams
282
+ [chartqa]: https://arxiv.org/abs/2203.10244
283
+ [vqav2]: https://visualqa.org/index.html
284
+ [blinkvqa]: https://arxiv.org/abs/2404.12390
285
+ [okvqa]: https://okvqa.allenai.org/
286
+ [tallyqa]: https://arxiv.org/abs/1810.12440
287
+ [ss-vqa]: https://arxiv.org/abs/1908.02660
288
+ [countbenchqa]: https://github.com/google-research/big_vision/blob/main/big_vision/datasets/countbenchqa/
289
+
290
+ ## Ethics and Safety
291
+
292
+ Ethics and safety evaluation approach and results.
293
+
294
+ ### Evaluation Approach
295
+
296
+ Our evaluation methods include structured evaluations and internal red-teaming
297
+ testing of relevant content policies. Red-teaming was conducted by a number of
298
+ different teams, each with different goals and human evaluation metrics. These
299
+ models were evaluated against a number of different categories relevant to
300
+ ethics and safety, including:
301
+
302
+ - **Child Safety**: Evaluation of text-to-text and image to text prompts
303
+ covering child safety policies, including child sexual abuse and
304
+ exploitation.
305
+ - **Content Safety:** Evaluation of text-to-text and image to text prompts
306
+ covering safety policies including, harassment, violence and gore, and hate
307
+ speech.
308
+ - **Representational Harms**: Evaluation of text-to-text and image to text
309
+ prompts covering safety policies including bias, stereotyping, and harmful
310
+ associations or inaccuracies.
311
+
312
+ In addition to development level evaluations, we conduct "assurance
313
+ evaluations" which are our 'arms-length' internal evaluations for responsibility
314
+ governance decision making. They are conducted separately from the model
315
+ development team, to inform decision making about release. High level findings
316
+ are fed back to the model team, but prompt sets are held-out to prevent
317
+ overfitting and preserve the results' ability to inform decision making.
318
+ Assurance evaluation results are reported to our Responsibility & Safety Council
319
+ as part of release review.
320
+
321
+ ### Evaluation Results
322
+
323
+ For all areas of safety testing, we saw major improvements in the categories of
324
+ child safety, content safety, and representational harms relative to previous
325
+ Gemma models. All testing was conducted without safety filters to evaluate the
326
+ model capabilities and behaviors. For both text-to-text and image-to-text, and
327
+ across all model sizes, the model produced minimal policy violations, and showed
328
+ significant improvements over previous Gemma models' performance with respect
329
+ to ungrounded inferences. A limitation of our evaluations was they included only
330
+ English language prompts.
331
+
332
+ ## Usage and Limitations
333
+
334
+ These models have certain limitations that users should be aware of.
335
+
336
+ ### Intended Usage
337
+
338
+ Open vision-language models (VLMs) models have a wide range of applications
339
+ across various industries and domains. The following list of potential uses is
340
+ not comprehensive. The purpose of this list is to provide contextual information
341
+ about the possible use-cases that the model creators considered as part of model
342
+ training and development.
343
+
344
+ - Content Creation and Communication
345
+ - Text Generation: These models can be used to generate creative text
346
+ formats such as poems, scripts, code, marketing copy, and email drafts.
347
+ - Chatbots and Conversational AI: Power conversational interfaces
348
+ for customer service, virtual assistants, or interactive applications.
349
+ - Text Summarization: Generate concise summaries of a text corpus,
350
+ research papers, or reports.
351
+ - Image Data Extraction: These models can be used to extract,
352
+ interpret, and summarize visual data for text communications.
353
+ - Research and Education
354
+ - Natural Language Processing (NLP) and VLM Research: These
355
+ models can serve as a foundation for researchers to experiment with VLM
356
+ and NLP techniques, develop algorithms, and contribute to the
357
+ advancement of the field.
358
+ - Language Learning Tools: Support interactive language learning
359
+ experiences, aiding in grammar correction or providing writing practice.
360
+ - Knowledge Exploration: Assist researchers in exploring large
361
+ bodies of text by generating summaries or answering questions about
362
+ specific topics.
363
+
364
+ ### Limitations
365
+
366
+ - Training Data
367
+ - The quality and diversity of the training data significantly
368
+ influence the model's capabilities. Biases or gaps in the training data
369
+ can lead to limitations in the model's responses.
370
+ - The scope of the training dataset determines the subject areas
371
+ the model can handle effectively.
372
+ - Context and Task Complexity
373
+ - Models are better at tasks that can be framed with clear
374
+ prompts and instructions. Open-ended or highly complex tasks might be
375
+ challenging.
376
+ - A model's performance can be influenced by the amount of context
377
+ provided (longer context generally leads to better outputs, up to a
378
+ certain point).
379
+ - Language Ambiguity and Nuance
380
+ - Natural language is inherently complex. Models might struggle
381
+ to grasp subtle nuances, sarcasm, or figurative language.
382
+ - Factual Accuracy
383
+ - Models generate responses based on information they learned
384
+ from their training datasets, but they are not knowledge bases. They
385
+ may generate incorrect or outdated factual statements.
386
+ - Common Sense
387
+ - Models rely on statistical patterns in language. They might
388
+ lack the ability to apply common sense reasoning in certain situations.
389
+
390
+ ### Ethical Considerations and Risks
391
+
392
+ The development of vision-language models (VLMs) raises several ethical
393
+ concerns. In creating an open model, we have carefully considered the following:
394
+
395
+ - Bias and Fairness
396
+ - VLMs trained on large-scale, real-world text and image data can
397
+ reflect socio-cultural biases embedded in the training material. These
398
+ models underwent careful scrutiny, input data pre-processing described
399
+ and posterior evaluations reported in this card.
400
+ - Misinformation and Misuse
401
+ - VLMs can be misused to generate text that is false, misleading,
402
+ or harmful.
403
+ - Guidelines are provided for responsible use with the model, see the
404
+ [Responsible Generative AI Toolkit][rai-toolkit].
405
+ - Transparency and Accountability:
406
+ - This model card summarizes details on the models' architecture,
407
+ capabilities, limitations, and evaluation processes.
408
+ - A responsibly developed open model offers the opportunity to
409
+ share innovation by making VLM technology accessible to developers and
410
+ researchers across the AI ecosystem.
411
+
412
+ Risks identified and mitigations:
413
+
414
+ - **Perpetuation of biases**: It's encouraged to perform continuous
415
+ monitoring (using evaluation metrics, human review) and the exploration of
416
+ de-biasing techniques during model training, fine-tuning, and other use
417
+ cases.
418
+ - **Generation of harmful content**: Mechanisms and guidelines for content
419
+ safety are essential. Developers are encouraged to exercise caution and
420
+ implement appropriate content safety safeguards based on their specific
421
+ product policies and application use cases.
422
+ - **Misuse for malicious purposes**: Technical limitations and developer
423
+ and end-user education can help mitigate against malicious applications of
424
+ VLMs. Educational resources and reporting mechanisms for users to flag
425
+ misuse are provided. Prohibited uses of Gemma models are outlined in the
426
+ [Gemma Prohibited Use Policy][prohibited-use].
427
+ - **Privacy violations**: Models were trained on data filtered for removal
428
+ of certain personal information and other sensitive data. Developers are
429
+ encouraged to adhere to privacy regulations with privacy-preserving
430
+ techniques.
431
+
432
+ ### Benefits
433
+
434
+ At the time of release, this family of models provides high-performance open
435
+ vision-language model implementations designed from the ground up for
436
+ responsible AI development compared to similarly sized models.
437
+
438
+ Using the benchmark evaluation metrics described in this document, these models
439
+ have shown to provide superior performance to other, comparably-sized open model
440
+ alternatives.
441
+
442
+ [g3-tech-report]: https://goo.gle/Gemma3Report
443
+ [rai-toolkit]: https://ai.google.dev/responsible
444
+ [kaggle-gemma]: https://www.kaggle.com/models/google/gemma-3
445
+ [vertex-mg-gemma3]: https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/gemma3
446
+ [terms]: https://ai.google.dev/gemma/terms
447
+ [safety-policies]: https://ai.google/static/documents/ai-responsibility-update-published-february-2025.pdf
448
+ [prohibited-use]: https://ai.google.dev/gemma/prohibited_use_policy
449
+ [tpu]: https://cloud.google.com/tpu/docs/intro-to-tpu
450
+ [sustainability]: https://sustainability.google/operating-sustainably/
451
+ [jax]: https://github.com/jax-ml/jax
452
+ [ml-pathways]: https://blog.google/technology/ai/introducing-pathways-next-generation-ai-architecture/
453
+ [sustainability]: https://sustainability.google/operating-sustainably/
454
+ [gemini-2-paper]: https://arxiv.org/abs/2312.11805
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<image_soft_token>": 262144
3
+ }
chat_template.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "chat_template": "{{ bos_token }}\n{%- if messages[0]['role'] == 'system' -%}\n {%- if messages[0]['content'] is string -%}\n {%- set first_user_prefix = messages[0]['content'] + '\n\n' -%}\n {%- else -%}\n {%- set first_user_prefix = messages[0]['content'][0]['text'] + '\n\n' -%}\n {%- endif -%}\n {%- set loop_messages = messages[1:] -%}\n{%- else -%}\n {%- set first_user_prefix = \"\" -%}\n {%- set loop_messages = messages -%}\n{%- endif -%}\n{%- for message in loop_messages -%}\n {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}\n {{ raise_exception(\"Conversation roles must alternate user/assistant/user/assistant/...\") }}\n {%- endif -%}\n {%- if (message['role'] == 'assistant') -%}\n {%- set role = \"model\" -%}\n {%- else -%}\n {%- set role = message['role'] -%}\n {%- endif -%}\n {{ '<start_of_turn>' + role + '\n' + (first_user_prefix if loop.first else \"\") }}\n {%- if message['content'] is string -%}\n {{ message['content'] | trim }}\n {%- elif message['content'] is iterable -%}\n {%- for item in message['content'] -%}\n {%- if item['type'] == 'image' -%}\n {{ '<start_of_image>' }}\n {%- elif item['type'] == 'text' -%}\n {{ item['text'] | trim }}\n {%- endif -%}\n {%- endfor -%}\n {%- else -%}\n {{ raise_exception(\"Invalid content type\") }}\n {%- endif -%}\n {{ '<end_of_turn>\n' }}\n{%- endfor -%}\n{%- if add_generation_prompt -%}\n {{'<start_of_turn>model\n'}}\n{%- endif -%}\n"
3
+ }
config.json ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "Gemma3ForConditionalGeneration"
4
+ ],
5
+ "boi_token_index": 255999,
6
+ "bos_token_id": 2,
7
+ "eoi_token_index": 256000,
8
+ "eos_token_id": 106,
9
+ "image_token_index": 262144,
10
+ "initializer_range": 0.02,
11
+ "mm_tokens_per_image": 256,
12
+ "model_type": "gemma3",
13
+ "pad_token_id": 0,
14
+ "quantization_config": {
15
+ "_load_in_4bit": true,
16
+ "_load_in_8bit": false,
17
+ "bnb_4bit_compute_dtype": "bfloat16",
18
+ "bnb_4bit_quant_storage": "uint8",
19
+ "bnb_4bit_quant_type": "nf4",
20
+ "bnb_4bit_use_double_quant": true,
21
+ "llm_int8_enable_fp32_cpu_offload": false,
22
+ "llm_int8_has_fp16_weight": false,
23
+ "llm_int8_skip_modules": [
24
+ "lm_head",
25
+ "multi_modal_projector",
26
+ "merger",
27
+ "modality_projection",
28
+ "language_model.model.layers.11.mlp",
29
+ "language_model.model.layers.23.self_attn",
30
+ "language_model.model.layers.23.mlp",
31
+ "language_model.model.layers.20.mlp",
32
+ "language_model.model.layers.25.self_attn",
33
+ "language_model.model.layers.16.mlp",
34
+ "language_model.model.layers.4.mlp",
35
+ "vision_tower.vision_model.encoder.layers.22.self_attn",
36
+ "vision_tower.vision_model.encoder.layers.17.self_attn",
37
+ "vision_tower.vision_model.encoder.layers.25.mlp",
38
+ "language_model.model.layers.24.mlp",
39
+ "vision_tower.vision_model.encoder.layers.18.mlp",
40
+ "language_model.model.layers.16.self_attn",
41
+ "language_model.model.layers.9.mlp",
42
+ "vision_tower.vision_model.encoder.layers.11.self_attn",
43
+ "vision_tower.vision_model.encoder.layers.2.mlp",
44
+ "vision_tower.vision_model.encoder.layers.20.self_attn",
45
+ "language_model.model.layers.5.mlp",
46
+ "language_model.model.layers.15.mlp",
47
+ "language_model.model.layers.10.self_attn",
48
+ "language_model.model.layers.11.self_attn",
49
+ "vision_tower.vision_model.encoder.layers.19.self_attn",
50
+ "vision_tower.vision_model.encoder.layers.1.mlp",
51
+ "vision_tower.vision_model.encoder.layers.21.mlp",
52
+ "language_model.model.layers.8.mlp",
53
+ "language_model.model.layers.10.mlp",
54
+ "vision_tower.vision_model.encoder.layers.21.self_attn",
55
+ "vision_tower.vision_model.encoder.layers.10.self_attn",
56
+ "vision_tower.vision_model.encoder.layers.24.self_attn",
57
+ "vision_tower.vision_model.encoder.layers.15.self_attn",
58
+ "vision_tower.vision_model.encoder.layers.5.mlp",
59
+ "language_model.model.layers.12.mlp",
60
+ "vision_tower.vision_model.encoder.layers.17.mlp",
61
+ "vision_tower.vision_model.encoder.layers.25.self_attn",
62
+ "vision_tower.vision_model.encoder.layers.19.mlp",
63
+ "vision_tower.vision_model.encoder.layers.16.self_attn",
64
+ "vision_tower.vision_model.encoder.layers.22.mlp",
65
+ "vision_tower.vision_model.encoder.layers.14.self_attn",
66
+ "vision_tower.vision_model.encoder.layers.23.mlp",
67
+ "vision_tower.vision_model.encoder.layers.9.mlp",
68
+ "vision_tower.vision_model.encoder.layers.13.mlp",
69
+ "vision_tower.vision_model.encoder.layers.8.mlp",
70
+ "vision_tower.vision_model.encoder.layers.14.mlp",
71
+ "vision_tower.vision_model.encoder.layers.20.mlp",
72
+ "vision_tower.vision_model.encoder.layers.15.mlp",
73
+ "language_model.model.layers.8.self_attn",
74
+ "vision_tower.vision_model.encoder.layers.3.mlp",
75
+ "vision_tower.vision_model.encoder.layers.23.self_attn",
76
+ "vision_tower.vision_model.encoder.layers.9.self_attn",
77
+ "vision_tower.vision_model.encoder.layers.1.self_attn",
78
+ "vision_tower.vision_model.encoder.layers.26.self_attn",
79
+ "vision_tower.vision_model.encoder.layers.18.self_attn",
80
+ "vision_tower.vision_model.encoder.layers.0.self_attn",
81
+ "vision_tower.vision_model.encoder.layers.16.mlp",
82
+ "vision_tower.vision_model.encoder.layers.6.mlp",
83
+ "vision_tower.vision_model.encoder.layers.8.self_attn",
84
+ "vision_tower.vision_model.encoder.layers.13.self_attn",
85
+ "vision_tower.vision_model.encoder.layers.6.self_attn",
86
+ "vision_tower.vision_model.encoder.layers.7.mlp",
87
+ "vision_tower.vision_model.encoder.layers.0.mlp",
88
+ "vision_tower.vision_model.encoder.layers.7.self_attn",
89
+ "vision_tower.vision_model.encoder.layers.11.mlp",
90
+ "vision_tower.vision_model.encoder.layers.24.mlp",
91
+ "vision_tower.vision_model.encoder.layers.4.mlp",
92
+ "vision_tower.vision_model.encoder.layers.10.mlp",
93
+ "vision_tower.vision_model.encoder.layers.12.self_attn",
94
+ "vision_tower.vision_model.encoder.layers.4.self_attn",
95
+ "vision_tower.vision_model.encoder.layers.12.mlp",
96
+ "vision_tower.vision_model.encoder.layers.5.self_attn",
97
+ "vision_tower.vision_model.encoder.layers.3.self_attn",
98
+ "vision_tower.vision_model.encoder.layers.26.mlp",
99
+ "vision_tower.vision_model.encoder.layers.2.self_attn"
100
+ ],
101
+ "llm_int8_threshold": 6.0,
102
+ "load_in_4bit": true,
103
+ "load_in_8bit": false,
104
+ "quant_method": "bitsandbytes"
105
+ },
106
+ "text_config": {
107
+ "attention_bias": false,
108
+ "attention_dropout": 0.0,
109
+ "attn_logit_softcapping": null,
110
+ "cache_implementation": "hybrid",
111
+ "final_logit_softcapping": null,
112
+ "head_dim": 128,
113
+ "hidden_activation": "gelu_pytorch_tanh",
114
+ "hidden_size": 5376,
115
+ "initializer_range": 0.02,
116
+ "intermediate_size": 21504,
117
+ "max_position_embeddings": 131072,
118
+ "model_type": "gemma3_text",
119
+ "num_attention_heads": 32,
120
+ "num_hidden_layers": 62,
121
+ "num_key_value_heads": 16,
122
+ "query_pre_attn_scalar": 168,
123
+ "rms_norm_eps": 1e-06,
124
+ "rope_local_base_freq": 10000,
125
+ "rope_scaling": {
126
+ "factor": 8.0,
127
+ "rope_type": "linear"
128
+ },
129
+ "rope_theta": 1000000,
130
+ "sliding_window": 1024,
131
+ "sliding_window_pattern": 6,
132
+ "torch_dtype": "bfloat16",
133
+ "use_cache": true,
134
+ "vocab_size": 262208
135
+ },
136
+ "torch_dtype": "bfloat16",
137
+ "transformers_version": "4.51.3",
138
+ "unsloth_fixed": true,
139
+ "vision_config": {
140
+ "attention_dropout": 0.0,
141
+ "hidden_act": "gelu_pytorch_tanh",
142
+ "hidden_size": 1152,
143
+ "image_size": 896,
144
+ "intermediate_size": 4304,
145
+ "layer_norm_eps": 1e-06,
146
+ "model_type": "siglip_vision_model",
147
+ "num_attention_heads": 16,
148
+ "num_channels": 3,
149
+ "num_hidden_layers": 27,
150
+ "patch_size": 14,
151
+ "torch_dtype": "bfloat16",
152
+ "vision_use_head": false
153
+ }
154
+ }
generation_config.json ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "cache_implementation": "hybrid",
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 1,
7
+ 106
8
+ ],
9
+ "pad_token_id": 0,
10
+ "top_k": 64,
11
+ "top_p": 0.95,
12
+ "transformers_version": "4.51.3"
13
+ }
model-00001-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bdd290c43a876c7e2c807c9813389f3096caef2024edec002e1f51762250c370
3
+ size 4782937055
model-00002-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d586890636f9481db2d0998886ddd60dd86270ed9441de7e276a530a46bf524d
3
+ size 4855576984
model-00003-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c9fab6332c6c36db2219bc911c74fb265af0fc401a996624363976fc70c8c339
3
+ size 4829682085
model-00004-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60294117b053f5b9e435881e70fb1f001d8f17b7546e18c01931913d639a4f55
3
+ size 4944188729
model-00005-of-00005.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02a94e9df873ca6bc3a33123a3a98d7506e5236e964d404a1112b0e66dd7f5f4
3
+ size 4226906705
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": null,
3
+ "do_normalize": true,
4
+ "do_pan_and_scan": null,
5
+ "do_rescale": true,
6
+ "do_resize": true,
7
+ "image_mean": [
8
+ 0.5,
9
+ 0.5,
10
+ 0.5
11
+ ],
12
+ "image_processor_type": "Gemma3ImageProcessor",
13
+ "image_seq_length": 256,
14
+ "image_std": [
15
+ 0.5,
16
+ 0.5,
17
+ 0.5
18
+ ],
19
+ "pan_and_scan_max_num_crops": null,
20
+ "pan_and_scan_min_crop_size": null,
21
+ "pan_and_scan_min_ratio_to_activate": null,
22
+ "processor_class": "Gemma3Processor",
23
+ "resample": 2,
24
+ "rescale_factor": 0.00392156862745098,
25
+ "size": {
26
+ "height": 896,
27
+ "width": 896
28
+ }
29
+ }
processor_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "image_seq_length": 256,
3
+ "processor_class": "Gemma3Processor"
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "boi_token": "<start_of_image>",
3
+ "bos_token": {
4
+ "content": "<bos>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ "eoi_token": "<end_of_image>",
11
+ "eos_token": {
12
+ "content": "<end_of_turn>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "image_token": "<image_soft_token>",
19
+ "pad_token": {
20
+ "content": "<pad>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4667f2089529e8e7657cfb6d1c19910ae71ff5f28aa7ab2ff2763330affad795
3
+ size 33384568
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
3
+ size 4689074
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff