RichardErkhov commited on
Commit
fbb7d67
·
verified ·
1 Parent(s): b2a2a72

uploaded readme

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