Xenova HF staff commited on
Commit
4251d94
1 Parent(s): 2b6ac3f

Update README.md (#4)

Browse files

- Update README.md (96b15e8d2f74052b6e917b389b98d66d6aff6fe1)
- Update README.md (4fc1136e9541f90035d604550864fc6828b0b758)

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