ThomasBaruzier commited on
Commit
6a881d4
·
verified ·
1 Parent(s): 3d53d7b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +540 -3
README.md CHANGED
@@ -1,3 +1,540 @@
1
- ---
2
- license: gemma
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ ---
12
+
13
+ <hr>
14
+
15
+ # Llama.cpp imatrix quantizations of google/gemma-2-27b-it-GGUF
16
+
17
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/646410e04bf9122922289dc7/-03oAOPVN1nZjp6-2EIxD.png" alt="gemma" width="60%"/>
18
+
19
+ Using llama.cpp commit [b5e9546](https://github.com/ggerganov/llama.cpp/commit/b5e95468b1676e1e5c9d80d1eeeb26f542a38f42) for quantization.
20
+
21
+ Original model: https://huggingface.co/google/gemma-2-27b-it
22
+
23
+ All quants were made using the imatrix option and Bartowski's [calibration file](https://gist.github.com/bartowski1182/eb213dccb3571f863da82e99418f81e8).
24
+
25
+ <hr><br>
26
+
27
+ # Gemma 2 model card
28
+
29
+ **Model Page**: [Gemma](https://ai.google.dev/gemma/docs)
30
+
31
+ **Resources and Technical Documentation**:
32
+
33
+ * [Responsible Generative AI Toolkit][rai-toolkit]
34
+ * [Gemma on Kaggle][kaggle-gemma]
35
+ * [Gemma on Vertex Model Garden][vertex-mg-gemma]
36
+
37
+ **Terms of Use**: [Terms](https://www.kaggle.com/models/google/gemma/license/consent/verify/huggingface?returnModelRepoId=google/gemma-2-27b-it)
38
+
39
+ **Authors**: Google
40
+
41
+ ## Model Information
42
+
43
+ Summary description and brief definition of inputs and outputs.
44
+
45
+ ### Description
46
+
47
+ Gemma is a family of lightweight, state-of-the-art open models from Google,
48
+ built from the same research and technology used to create the Gemini models.
49
+ They are text-to-text, decoder-only large language models, available in English,
50
+ with open weights for both pre-trained variants and instruction-tuned variants.
51
+ Gemma models are well-suited for a variety of text generation tasks, including
52
+ question answering, summarization, and reasoning. Their relatively small size
53
+ makes it possible to deploy them in environments with limited resources such as
54
+ a laptop, desktop or your own cloud infrastructure, democratizing access to
55
+ state of the art AI models and helping foster innovation for everyone.
56
+
57
+ ### Usage
58
+
59
+ Below we share some code snippets on how to get quickly started with running the model. First make sure to `pip install -U transformers`, then copy the snippet from the section that is relevant for your usecase.
60
+
61
+
62
+ #### Running the model on a single / multi GPU
63
+
64
+ > [!IMPORTANT]
65
+ > Given the model instabilities with SDPA/ FA2, by default, the model inference would utilise `eager` attention.
66
+
67
+ ```python
68
+ # pip install accelerate
69
+ from transformers import AutoTokenizer, AutoModelForCausalLM
70
+ import torch
71
+
72
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-27b-it")
73
+ model = AutoModelForCausalLM.from_pretrained(
74
+ "google/gemma-2-27b-it",
75
+ device_map="auto",
76
+ torch_dtype=torch.bfloat16
77
+ )
78
+
79
+ input_text = "Write me a poem about Machine Learning."
80
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
81
+
82
+ outputs = model.generate(**input_ids)
83
+ print(tokenizer.decode(outputs[0]))
84
+ ```
85
+
86
+ <a name="precisions"></a>
87
+ #### Running the model on a GPU using different precisions
88
+
89
+ The native weights of this model were exported in `bfloat16` precision.
90
+
91
+ You can also use `float32` if you skip the dtype, but no precision increase will occur (model weights will just be upcasted to `float32`). See examples below.
92
+
93
+ * _Upcasting to `torch.float32`_
94
+
95
+ ```python
96
+ # pip install accelerate
97
+ from transformers import AutoTokenizer, AutoModelForCausalLM
98
+
99
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-27b-it")
100
+ model = AutoModelForCausalLM.from_pretrained(
101
+ "google/gemma-2-27b-it",
102
+ device_map="auto"
103
+ )
104
+
105
+ input_text = "Write me a poem about Machine Learning."
106
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
107
+
108
+ outputs = model.generate(**input_ids)
109
+ print(tokenizer.decode(outputs[0]))
110
+ ```
111
+
112
+ #### Quantized Versions through `bitsandbytes`
113
+
114
+ * _Using 8-bit precision (int8)_
115
+
116
+ ```python
117
+ # pip install bitsandbytes accelerate
118
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
119
+
120
+ quantization_config = BitsAndBytesConfig(load_in_8bit=True)
121
+
122
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-27b-it")
123
+ model = AutoModelForCausalLM.from_pretrained(
124
+ "google/gemma-2-27b-it",
125
+ quantization_config=quantization_config)
126
+
127
+ input_text = "Write me a poem about Machine Learning."
128
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
129
+
130
+ outputs = model.generate(**input_ids)
131
+ print(tokenizer.decode(outputs[0]))
132
+ ```
133
+
134
+ * _Using 4-bit precision_
135
+
136
+ ```python
137
+ # pip install bitsandbytes accelerate
138
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
139
+
140
+ quantization_config = BitsAndBytesConfig(load_in_4bit=True)
141
+
142
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-2-27b-it")
143
+ model = AutoModelForCausalLM.from_pretrained(
144
+ "google/gemma-2-27b-it",
145
+ quantization_config=quantization_config)
146
+
147
+ input_text = "Write me a poem about Machine Learning."
148
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
149
+
150
+ outputs = model.generate(**input_ids)
151
+ print(tokenizer.decode(outputs[0]))
152
+ ```
153
+
154
+
155
+ #### Other optimizations
156
+
157
+ * _Flash Attention 2_
158
+
159
+ > [!WARNING]
160
+ > Gemma 2 is currently incompatible with Flash Attention/ SDPA, using it might result in unreliable generations. Use at your own risk.
161
+
162
+ First make sure to install `flash-attn` in your environment `pip install flash-attn`
163
+
164
+ ```diff
165
+ model = AutoModelForCausalLM.from_pretrained(
166
+ model_id,
167
+ torch_dtype=torch.float16,
168
+ + attn_implementation="flash_attention_2"
169
+ ).to(0)
170
+ ```
171
+
172
+ ### Chat Template
173
+
174
+ The instruction-tuned models use a chat template that must be adhered to for conversational use.
175
+ The easiest way to apply it is using the tokenizer's built-in chat template, as shown in the following snippet.
176
+
177
+ Let's load the model and apply the chat template to a conversation. In this example, we'll start with a single user interaction:
178
+
179
+ ```py
180
+ from transformers import AutoTokenizer, AutoModelForCausalLM
181
+ import transformers
182
+ import torch
183
+
184
+ model_id = "google/gemma-2-27b-it"
185
+ dtype = torch.bfloat16
186
+
187
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
188
+ model = AutoModelForCausalLM.from_pretrained(
189
+ model_id,
190
+ device_map="cuda",
191
+ torch_dtype=dtype,
192
+ )
193
+
194
+ chat = [
195
+ { "role": "user", "content": "Write a hello world program" },
196
+ ]
197
+ prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
198
+ ```
199
+
200
+ At this point, the prompt contains the following text:
201
+
202
+ ```
203
+ <bos><start_of_turn>user
204
+ Write a hello world program<end_of_turn>
205
+ <start_of_turn>model
206
+ ```
207
+
208
+ As you can see, each turn is preceded by a `<start_of_turn>` delimiter and then the role of the entity
209
+ (either `user`, for content supplied by the user, or `model` for LLM responses). Turns finish with
210
+ the `<end_of_turn>` token.
211
+
212
+ You can follow this format to build the prompt manually, if you need to do it without the tokenizer's
213
+ chat template.
214
+
215
+ After the prompt is ready, generation can be performed like this:
216
+
217
+ ```py
218
+ inputs = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
219
+ outputs = model.generate(input_ids=inputs.to(model.device), max_new_tokens=150)
220
+ print(tokenizer.decode(outputs[0]))
221
+ ```
222
+
223
+ ### Inputs and outputs
224
+
225
+ * **Input:** Text string, such as a question, a prompt, or a document to be
226
+ summarized.
227
+ * **Output:** Generated English-language text in response to the input, such
228
+ as an answer to a question, or a summary of a document.
229
+
230
+ ### Citation
231
+
232
+ ```none
233
+ @article{gemma_2024,
234
+ title={Gemma},
235
+ url={https://www.kaggle.com/m/3301},
236
+ DOI={10.34740/KAGGLE/M/3301},
237
+ publisher={Kaggle},
238
+ author={Gemma Team},
239
+ year={2024}
240
+ }
241
+ ```
242
+
243
+ ## Model Data
244
+
245
+ Data used for model training and how the data was processed.
246
+
247
+ ### Training Dataset
248
+
249
+ These models were trained on a dataset of text data that includes a wide variety of sources. The 27B model was trained with 13 trillion tokens and the 9B model was trained with 8 trillion tokens.
250
+ Here are the key components:
251
+
252
+ * Web Documents: A diverse collection of web text ensures the model is exposed
253
+ to a broad range of linguistic styles, topics, and vocabulary. Primarily
254
+ English-language content.
255
+ * Code: Exposing the model to code helps it to learn the syntax and patterns of
256
+ programming languages, which improves its ability to generate code or
257
+ understand code-related questions.
258
+ * Mathematics: Training on mathematical text helps the model learn logical
259
+ reasoning, symbolic representation, and to address mathematical queries.
260
+
261
+ The combination of these diverse data sources is crucial for training a powerful
262
+ language model that can handle a wide variety of different tasks and text
263
+ formats.
264
+
265
+ ### Data Preprocessing
266
+
267
+ Here are the key data cleaning and filtering methods applied to the training
268
+ data:
269
+
270
+ * CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering was
271
+ applied at multiple stages in the data preparation process to ensure the
272
+ exclusion of harmful and illegal content.
273
+ * Sensitive Data Filtering: As part of making Gemma pre-trained models safe and
274
+ reliable, automated techniques were used to filter out certain personal
275
+ information and other sensitive data from training sets.
276
+ * Additional methods: Filtering based on content quality and safety in line with
277
+ [our policies][safety-policies].
278
+
279
+ ## Implementation Information
280
+
281
+ Details about the model internals.
282
+
283
+ ### Hardware
284
+
285
+ Gemma was trained using the latest generation of
286
+ [Tensor Processing Unit (TPU)][tpu] hardware (TPUv5p).
287
+
288
+ Training large language models requires significant computational power. TPUs,
289
+ designed specifically for matrix operations common in machine learning, offer
290
+ several advantages in this domain:
291
+
292
+ * Performance: TPUs are specifically designed to handle the massive computations
293
+ involved in training LLMs. They can speed up training considerably compared to
294
+ CPUs.
295
+ * Memory: TPUs often come with large amounts of high-bandwidth memory, allowing
296
+ for the handling of large models and batch sizes during training. This can
297
+ lead to better model quality.
298
+ * Scalability: TPU Pods (large clusters of TPUs) provide a scalable solution for
299
+ handling the growing complexity of large foundation models. You can distribute
300
+ training across multiple TPU devices for faster and more efficient processing.
301
+ * Cost-effectiveness: In many scenarios, TPUs can provide a more cost-effective
302
+ solution for training large models compared to CPU-based infrastructure,
303
+ especially when considering the time and resources saved due to faster
304
+ training.
305
+ * These advantages are aligned with
306
+ [Google's commitments to operate sustainably][sustainability].
307
+
308
+ ### Software
309
+
310
+ Training was done using [JAX][jax] and [ML Pathways][ml-pathways].
311
+
312
+ JAX allows researchers to take advantage of the latest generation of hardware,
313
+ including TPUs, for faster and more efficient training of large models.
314
+
315
+ ML Pathways is Google's latest effort to build artificially intelligent systems
316
+ capable of generalizing across multiple tasks. This is specially suitable for
317
+ [foundation models][foundation-models], including large language models like
318
+ these ones.
319
+
320
+ Together, JAX and ML Pathways are used as described in the
321
+ [paper about the Gemini family of models][gemini-2-paper]; "the 'single
322
+ controller' programming model of Jax and Pathways allows a single Python
323
+ process to orchestrate the entire training run, dramatically simplifying the
324
+ development workflow."
325
+
326
+ ## Evaluation
327
+
328
+ Model evaluation metrics and results.
329
+
330
+ ### Benchmark Results
331
+
332
+ These models were evaluated against a large collection of different datasets and
333
+ metrics to cover different aspects of text generation:
334
+
335
+ | Benchmark | Metric | Gemma PT 9B | Gemma PT 27B |
336
+ | ------------------------------ | ------------- | ----------- | ------------ |
337
+ | [MMLU][mmlu] | 5-shot, top-1 | 71.3 | 75.2 |
338
+ | [HellaSwag][hellaswag] | 10-shot | 81.9 | 86.4 |
339
+ | [PIQA][piqa] | 0-shot | 81.7 | 83.2 |
340
+ | [SocialIQA][socialiqa] | 0-shot | 53.4 | 53.7 |
341
+ | [BoolQ][boolq] | 0-shot | 84.2 | 84.8 |
342
+ | [WinoGrande][winogrande] | partial score | 80.6 | 83.7 |
343
+ | [ARC-e][arc] | 0-shot | 88.0 | 88.6 |
344
+ | [ARC-c][arc] | 25-shot | 68.4 | 71.4 |
345
+ | [TriviaQA][triviaqa] | 5-shot | 76.6 | 83.7 |
346
+ | [Natural Questions][naturalq] | 5-shot | 29.2 | 34.5 |
347
+ | [HumanEval][humaneval] | pass@1 | 40.2 | 51.8 |
348
+ | [MBPP][mbpp] | 3-shot | 52.4 | 62.6 |
349
+ | [GSM8K][gsm8k] | 5-shot, maj@1 | 68.6 | 74.0 |
350
+ | [MATH][math] | 4-shot | 36.6 | 42.3 |
351
+ | [AGIEval][agieval] | 3-5-shot | 52.8 | 55.1 |
352
+ | [BIG-Bench][big-bench] | 3-shot, CoT | 68.2 | 74.9 |
353
+ | ------------------------------ | ------------- | ----------- | ------------ |
354
+
355
+ ## Ethics and Safety
356
+
357
+ Ethics and safety evaluation approach and results.
358
+
359
+ ### Evaluation Approach
360
+
361
+ Our evaluation methods include structured evaluations and internal red-teaming
362
+ testing of relevant content policies. Red-teaming was conducted by a number of
363
+ different teams, each with different goals and human evaluation metrics. These
364
+ models were evaluated against a number of different categories relevant to
365
+ ethics and safety, including:
366
+
367
+ * Text-to-Text Content Safety: Human evaluation on prompts covering safety
368
+ policies including child sexual abuse and exploitation, harassment, violence
369
+ and gore, and hate speech.
370
+ * Text-to-Text Representational Harms: Benchmark against relevant academic
371
+ datasets such as [WinoBias][winobias] and [BBQ Dataset][bbq].
372
+ * Memorization: Automated evaluation of memorization of training data, including
373
+ the risk of personally identifiable information exposure.
374
+ * Large-scale harm: Tests for "dangerous capabilities," such as chemical,
375
+ biological, radiological, and nuclear (CBRN) risks.
376
+
377
+ ### Evaluation Results
378
+
379
+ The results of ethics and safety evaluations are within acceptable thresholds
380
+ for meeting [internal policies][safety-policies] for categories such as child
381
+ safety, content safety, representational harms, memorization, large-scale harms.
382
+ On top of robust internal evaluations, the results of well-known safety
383
+ benchmarks like BBQ, BOLD, Winogender, Winobias, RealToxicity, and TruthfulQA
384
+ are shown here.
385
+
386
+ #### Gemma 2.0
387
+
388
+ | Benchmark | Metric | Gemma 2 IT 9B | Gemma 2 IT 27B |
389
+ | ------------------------ | ------------- | --------------- | ---------------- |
390
+ | [RealToxicity][realtox] | average | 8.25 | 8.84 |
391
+ | [CrowS-Pairs][crows] | top-1 | 37.47 | 36.67 |
392
+ | [BBQ Ambig][bbq] | 1-shot, top-1 | 88.58 | 85.99 |
393
+ | [BBQ Disambig][bbq] | top-1 | 82.67 | 86.94 |
394
+ | [Winogender][winogender] | top-1 | 79.17 | 77.22 |
395
+ | [TruthfulQA][truthfulqa] | | 50.27 | 51.60 |
396
+ | [Winobias 1_2][winobias] | | 78.09 | 81.94 |
397
+ | [Winobias 2_2][winobias] | | 95.32 | 97.22 |
398
+ | [Toxigen][toxigen] | | 39.30 | 38.42 |
399
+ | ------------------------ | ------------- | --------------- | ---------------- |
400
+
401
+ ## Usage and Limitations
402
+
403
+ These models have certain limitations that users should be aware of.
404
+
405
+ ### Intended Usage
406
+
407
+ Open Large Language Models (LLMs) have a wide range of applications across
408
+ various industries and domains. The following list of potential uses is not
409
+ comprehensive. The purpose of this list is to provide contextual information
410
+ about the possible use-cases that the model creators considered as part of model
411
+ training and development.
412
+
413
+ * Content Creation and Communication
414
+ * Text Generation: These models can be used to generate creative text formats
415
+ such as poems, scripts, code, marketing copy, and email drafts.
416
+ * Chatbots and Conversational AI: Power conversational interfaces for customer
417
+ service, virtual assistants, or interactive applications.
418
+ * Text Summarization: Generate concise summaries of a text corpus, research
419
+ papers, or reports.
420
+ * Research and Education
421
+ * Natural Language Processing (NLP) Research: These models can serve as a
422
+ foundation for researchers to experiment with NLP techniques, develop
423
+ algorithms, and contribute to the advancement of the field.
424
+ * Language Learning Tools: Support interactive language learning experiences,
425
+ aiding in grammar correction or providing writing practice.
426
+ * Knowledge Exploration: Assist researchers in exploring large bodies of text
427
+ by generating summaries or answering questions about specific topics.
428
+
429
+ ### Limitations
430
+
431
+ * Training Data
432
+ * The quality and diversity of the training data significantly influence the
433
+ model's capabilities. Biases or gaps in the training data can lead to
434
+ limitations in the model's responses.
435
+ * The scope of the training dataset determines the subject areas the model can
436
+ handle effectively.
437
+ * Context and Task Complexity
438
+ * LLMs are better at tasks that can be framed with clear prompts and
439
+ instructions. Open-ended or highly complex tasks might be challenging.
440
+ * A model's performance can be influenced by the amount of context provided
441
+ (longer context generally leads to better outputs, up to a certain point).
442
+ * Language Ambiguity and Nuance
443
+ * Natural language is inherently complex. LLMs might struggle to grasp subtle
444
+ nuances, sarcasm, or figurative language.
445
+ * Factual Accuracy
446
+ * LLMs generate responses based on information they learned from their
447
+ training datasets, but they are not knowledge bases. They may generate
448
+ incorrect or outdated factual statements.
449
+ * Common Sense
450
+ * LLMs rely on statistical patterns in language. They might lack the ability
451
+ to apply common sense reasoning in certain situations.
452
+
453
+ ### Ethical Considerations and Risks
454
+
455
+ The development of large language models (LLMs) raises several ethical concerns.
456
+ In creating an open model, we have carefully considered the following:
457
+
458
+ * Bias and Fairness
459
+ * LLMs trained on large-scale, real-world text data can reflect socio-cultural
460
+ biases embedded in the training material. These models underwent careful
461
+ scrutiny, input data pre-processing described and posterior evaluations
462
+ reported in this card.
463
+ * Misinformation and Misuse
464
+ * LLMs can be misused to generate text that is false, misleading, 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 share
471
+ innovation by making LLM technology accessible to developers and researchers
472
+ across the AI ecosystem.
473
+
474
+ Risks identified and mitigations:
475
+
476
+ * Perpetuation of biases: It's encouraged to perform continuous monitoring
477
+ (using evaluation metrics, human review) and the exploration of de-biasing
478
+ techniques during model training, fine-tuning, and other use cases.
479
+ * Generation of harmful content: Mechanisms and guidelines for content safety
480
+ are essential. Developers are encouraged to exercise caution and implement
481
+ appropriate content safety safeguards based on their specific product policies
482
+ and application use cases.
483
+ * Misuse for malicious purposes: Technical limitations and developer and
484
+ end-user education can help mitigate against malicious applications of LLMs.
485
+ Educational resources and reporting mechanisms for users to flag misuse are
486
+ provided. Prohibited uses of Gemma models are outlined in the
487
+ [Gemma Prohibited Use Policy][prohibited-use].
488
+ * Privacy violations: Models were trained on data filtered for removal of PII
489
+ (Personally Identifiable Information). Developers are encouraged to adhere to
490
+ privacy regulations with privacy-preserving techniques.
491
+
492
+ ### Benefits
493
+
494
+ At the time of release, this family of models provides high-performance open
495
+ large language model implementations designed from the ground up for Responsible
496
+ AI development compared to similarly sized models.
497
+
498
+ Using the benchmark evaluation metrics described in this document, these models
499
+ have shown to provide superior performance to other, comparably-sized open model
500
+ alternatives.
501
+
502
+ [rai-toolkit]: https://ai.google.dev/responsible
503
+ [kaggle-gemma]: https://www.kaggle.com/models/google/gemma-2
504
+ [terms]: https://ai.google.dev/gemma/terms
505
+ [vertex-mg-gemma]: https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/335
506
+ [sensitive-info]: https://cloud.google.com/dlp/docs/high-sensitivity-infotypes-reference
507
+ [safety-policies]: https://storage.googleapis.com/gweb-uniblog-publish-prod/documents/2023_Google_AI_Principles_Progress_Update.pdf#page=11
508
+ [prohibited-use]: https://ai.google.dev/gemma/prohibited_use_policy
509
+ [tpu]: https://cloud.google.com/tpu/docs/intro-to-tpu
510
+ [sustainability]: https://sustainability.google/operating-sustainably/
511
+ [jax]: https://github.com/google/jax
512
+ [ml-pathways]: https://blog.google/technology/ai/introducing-pathways-next-generation-ai-architecture/
513
+ [sustainability]: https://sustainability.google/operating-sustainably/
514
+ [foundation-models]: https://ai.google/discover/foundation-models/
515
+ [gemini-2-paper]: https://goo.gle/gemma2report
516
+ [mmlu]: https://arxiv.org/abs/2009.03300
517
+ [hellaswag]: https://arxiv.org/abs/1905.07830
518
+ [piqa]: https://arxiv.org/abs/1911.11641
519
+ [socialiqa]: https://arxiv.org/abs/1904.09728
520
+ [boolq]: https://arxiv.org/abs/1905.10044
521
+ [winogrande]: https://arxiv.org/abs/1907.10641
522
+ [commonsenseqa]: https://arxiv.org/abs/1811.00937
523
+ [openbookqa]: https://arxiv.org/abs/1809.02789
524
+ [arc]: https://arxiv.org/abs/1911.01547
525
+ [triviaqa]: https://arxiv.org/abs/1705.03551
526
+ [naturalq]: https://github.com/google-research-datasets/natural-questions
527
+ [humaneval]: https://arxiv.org/abs/2107.03374
528
+ [mbpp]: https://arxiv.org/abs/2108.07732
529
+ [gsm8k]: https://arxiv.org/abs/2110.14168
530
+ [realtox]: https://arxiv.org/abs/2009.11462
531
+ [bold]: https://arxiv.org/abs/2101.11718
532
+ [crows]: https://aclanthology.org/2020.emnlp-main.154/
533
+ [bbq]: https://arxiv.org/abs/2110.08193v2
534
+ [winogender]: https://arxiv.org/abs/1804.09301
535
+ [truthfulqa]: https://arxiv.org/abs/2109.07958
536
+ [winobias]: https://arxiv.org/abs/1804.06876
537
+ [math]: https://arxiv.org/abs/2103.03874
538
+ [agieval]: https://arxiv.org/abs/2304.06364
539
+ [big-bench]: https://arxiv.org/abs/2206.04615
540
+ [toxigen]: https://arxiv.org/abs/2203.09509