Daemontatox danielhanchen commited on
Commit
287770a
·
verified ·
0 Parent(s):

Duplicate from unsloth/gemma-3-27b-it

Browse files

Co-authored-by: Daniel Han-Chen <[email protected]>

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