ThiloteE commited on
Commit
e8eef68
·
verified ·
1 Parent(s): 751ae73

Update README.md

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