RichardErkhov commited on
Commit
f4a6d22
1 Parent(s): 3aa0317

uploaded readme

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