reach-vb HF staff osanseviero merve HF staff michellecasbon commited on
Commit
6c0ce4e
·
verified ·
0 Parent(s):

Super-squash branch 'main' using huggingface_hub

Browse files

Co-authored-by: osanseviero <[email protected]>
Co-authored-by: merve <[email protected]>
Co-authored-by: michellecasbon <[email protected]>

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