RichardErkhov commited on
Commit
7c3a544
1 Parent(s): 8e0dc89

uploaded readme

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