RichardErkhov commited on
Commit
5bc4bec
1 Parent(s): 3d6258f

uploaded readme

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