RichardErkhov commited on
Commit
1ec1fae
·
verified ·
1 Parent(s): cc4a5ea

uploaded readme

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