cjpais commited on
Commit
d85e602
·
verified ·
1 Parent(s): aa285b8

Update README.md

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