RichardErkhov commited on
Commit
3487a82
1 Parent(s): 1dca70b

uploaded readme

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