gaunernst commited on
Commit
027d6d7
·
verified ·
1 Parent(s): c61c5da

Upload folder using huggingface_hub

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