LoneStriker commited on
Commit
9d83c21
1 Parent(s): ba02b21

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -1,35 +1,5 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tar filter=lfs diff=lfs merge=lfs -text
29
- *.tflite filter=lfs diff=lfs merge=lfs -text
30
- *.tgz filter=lfs diff=lfs merge=lfs -text
31
- *.wasm filter=lfs diff=lfs merge=lfs -text
32
- *.xz filter=lfs diff=lfs merge=lfs -text
33
- *.zip filter=lfs diff=lfs merge=lfs -text
34
- *.zst filter=lfs diff=lfs merge=lfs -text
35
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ gemma-1.1-7b-it-Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
2
+ gemma-1.1-7b-it-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
3
+ gemma-1.1-7b-it-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
4
+ gemma-1.1-7b-it-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
5
+ gemma-1.1-7b-it-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md ADDED
@@ -0,0 +1,612 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ widget:
4
+ - messages:
5
+ - role: user
6
+ content: How does the brain work?
7
+ inference:
8
+ parameters:
9
+ max_new_tokens: 200
10
+ extra_gated_heading: Access Gemma on Hugging Face
11
+ extra_gated_prompt: >-
12
+ To access Gemma on Hugging Face, you’re required to review and agree to
13
+ Google’s usage license. To do this, please ensure you’re logged-in to Hugging
14
+ Face and click below. Requests are processed immediately.
15
+ extra_gated_button_content: Acknowledge license
16
+ license: gemma
17
+ ---
18
+
19
+ # Gemma Model Card
20
+
21
+ **Model Page**: [Gemma](https://ai.google.dev/gemma/docs)
22
+
23
+ This model card corresponds to the latest 7B instruct version of the Gemma model. Here you can find other models in the Gemma family:
24
+
25
+ | | Base | Instruct |
26
+ |----|----------------------------------------------------|----------------------------------------------------------------------|
27
+ | 2B | [gemma-2b](https://huggingface.co/google/gemma-2b) | [gemma-1.1-2b-it](https://huggingface.co/google/gemma-1.1-2b-it) |
28
+ | 7B | [gemma-7b](https://huggingface.co/google/gemma-7b) | [**gemma-1.1-7b-it**](https://huggingface.co/google/gemma-1.1-7b-it) |
29
+
30
+ **Release Notes**
31
+
32
+ This is Gemma 1.1 7B (IT), an update over the original instruction-tuned Gemma release.
33
+
34
+ Gemma 1.1 was trained using a novel RLHF method, leading to substantial gains on quality, coding capabilities, factuality, instruction following and multi-turn conversation quality. We also fixed a bug in multi-turn conversations, and made sure that model responses don't always start with `"Sure,"`.
35
+
36
+ We believe this release represents an improvement for most use cases, but we encourage users to test in their particular applications. The previous model [will continue to be available in the same repo](https://huggingface.co/google/gemma-7b-it). We appreciate the enthusiastic adoption of Gemma, and we continue to welcome all feedback from the community.
37
+
38
+ **Resources and Technical Documentation**:
39
+
40
+ * [Responsible Generative AI Toolkit](https://ai.google.dev/responsible)
41
+ * [Gemma on Kaggle](https://www.kaggle.com/models/google/gemma)
42
+ * [Gemma on Vertex Model Garden](https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/335)
43
+
44
+ **Terms of Use**: [Terms](https://www.kaggle.com/models/google/gemma/license/consent)
45
+
46
+ **Authors**: Google
47
+
48
+ ## Model Information
49
+
50
+ Summary description and brief definition of inputs and outputs.
51
+
52
+ ### Description
53
+
54
+ Gemma is a family of lightweight, state-of-the-art open models from Google,
55
+ built from the same research and technology used to create the Gemini models.
56
+ They are text-to-text, decoder-only large language models, available in English,
57
+ with open weights, pre-trained variants, and instruction-tuned variants. Gemma
58
+ models are well-suited for a variety of text generation tasks, including
59
+ question answering, summarization, and reasoning. Their relatively small size
60
+ makes it possible to deploy them in environments with limited resources such as
61
+ a laptop, desktop or your own cloud infrastructure, democratizing access to
62
+ state of the art AI models and helping foster innovation for everyone.
63
+
64
+ ### Usage
65
+
66
+ 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.
67
+
68
+ #### Running the model on a CPU
69
+
70
+ As explained below, we recommend `torch.bfloat16` as the default dtype. You can use [a different precision](#precisions) if necessary.
71
+
72
+ ```python
73
+ from transformers import AutoTokenizer, AutoModelForCausalLM
74
+ import torch
75
+
76
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-1.1-7b-it")
77
+ model = AutoModelForCausalLM.from_pretrained(
78
+ "google/gemma-1.1-7b-it",
79
+ torch_dtype=torch.bfloat16
80
+ )
81
+
82
+ input_text = "Write me a poem about Machine Learning."
83
+ input_ids = tokenizer(input_text, return_tensors="pt")
84
+
85
+ outputs = model.generate(**input_ids, max_new_tokens=50)
86
+ print(tokenizer.decode(outputs[0]))
87
+ ```
88
+
89
+ #### Running the model on a single / multi GPU
90
+
91
+
92
+ ```python
93
+ # pip install accelerate
94
+ from transformers import AutoTokenizer, AutoModelForCausalLM
95
+ import torch
96
+
97
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-1.1-7b-it")
98
+ model = AutoModelForCausalLM.from_pretrained(
99
+ "google/gemma-1.1-7b-it",
100
+ device_map="auto",
101
+ torch_dtype=torch.bfloat16
102
+ )
103
+
104
+ input_text = "Write me a poem about Machine Learning."
105
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
106
+
107
+ outputs = model.generate(**input_ids)
108
+ print(tokenizer.decode(outputs[0]))
109
+ ```
110
+
111
+ <a name="precisions"></a>
112
+ #### Running the model on a GPU using different precisions
113
+
114
+ The native weights of this model were exported in `bfloat16` precision. You can use `float16`, which may be faster on certain hardware, indicating the `torch_dtype` when loading the model. For convenience, the `float16` revision of the repo contains a copy of the weights already converted to that precision.
115
+
116
+ You can also use `float32` if you skip the dtype, but no precision increase will occur (model weights will just be upcasted to `float32`). See examples below.
117
+
118
+ * _Using `torch.float16`_
119
+
120
+ ```python
121
+ # pip install accelerate
122
+ from transformers import AutoTokenizer, AutoModelForCausalLM
123
+ import torch
124
+
125
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-1.1-7b-it")
126
+ model = AutoModelForCausalLM.from_pretrained(
127
+ "google/gemma-1.1-7b-it",
128
+ device_map="auto",
129
+ torch_dtype=torch.float16,
130
+ revision="float16",
131
+ )
132
+
133
+ input_text = "Write me a poem about Machine Learning."
134
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
135
+
136
+ outputs = model.generate(**input_ids)
137
+ print(tokenizer.decode(outputs[0]))
138
+ ```
139
+
140
+ * _Using `torch.bfloat16`_
141
+
142
+ ```python
143
+ # pip install accelerate
144
+ from transformers import AutoTokenizer, AutoModelForCausalLM
145
+ import torch
146
+
147
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-2b-it")
148
+ model = AutoModelForCausalLM.from_pretrained(
149
+ "google/gemma-1.1-7b-it",
150
+ device_map="auto",
151
+ torch_dtype=torch.bfloat16
152
+ )
153
+
154
+ input_text = "Write me a poem about Machine Learning."
155
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
156
+
157
+ outputs = model.generate(**input_ids)
158
+ print(tokenizer.decode(outputs[0]))
159
+ ```
160
+
161
+ * _Upcasting to `torch.float32`_
162
+
163
+ ```python
164
+ # pip install accelerate
165
+ from transformers import AutoTokenizer, AutoModelForCausalLM
166
+
167
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-1.1-7b-it")
168
+ model = AutoModelForCausalLM.from_pretrained(
169
+ "google/gemma-1.1-7b-it",
170
+ device_map="auto"
171
+ )
172
+
173
+ input_text = "Write me a poem about Machine Learning."
174
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
175
+
176
+ outputs = model.generate(**input_ids)
177
+ print(tokenizer.decode(outputs[0]))
178
+ ```
179
+
180
+ #### Quantized Versions through `bitsandbytes`
181
+
182
+ * _Using 8-bit precision (int8)_
183
+
184
+ ```python
185
+ # pip install bitsandbytes accelerate
186
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
187
+
188
+ quantization_config = BitsAndBytesConfig(load_in_8bit=True)
189
+
190
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-1.1-7b-it")
191
+ model = AutoModelForCausalLM.from_pretrained(
192
+ "google/gemma-1.1-7b-it",
193
+ quantization_config=quantization_config
194
+ )
195
+
196
+ input_text = "Write me a poem about Machine Learning."
197
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
198
+
199
+ outputs = model.generate(**input_ids)
200
+ print(tokenizer.decode(outputs[0]))
201
+ ```
202
+
203
+ * _Using 4-bit precision_
204
+
205
+ ```python
206
+ # pip install bitsandbytes accelerate
207
+ from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
208
+
209
+ quantization_config = BitsAndBytesConfig(load_in_4bit=True)
210
+
211
+ tokenizer = AutoTokenizer.from_pretrained("google/gemma-1.1-7b-it")
212
+ model = AutoModelForCausalLM.from_pretrained(
213
+ "google/gemma-1.1-7b-it",
214
+ quantization_config=quantization_config
215
+ )
216
+
217
+ input_text = "Write me a poem about Machine Learning."
218
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
219
+
220
+ outputs = model.generate(**input_ids)
221
+ print(tokenizer.decode(outputs[0]))
222
+ ```
223
+
224
+
225
+ #### Other optimizations
226
+
227
+ * _Flash Attention 2_
228
+
229
+ First make sure to install `flash-attn` in your environment `pip install flash-attn`
230
+
231
+ ```diff
232
+ model = AutoModelForCausalLM.from_pretrained(
233
+ model_id,
234
+ torch_dtype=torch.float16,
235
+ + attn_implementation="flash_attention_2"
236
+ ).to(0)
237
+ ```
238
+
239
+ #### Running the model in JAX / Flax
240
+
241
+ Use the `flax` branch of the repository:
242
+
243
+ ```python
244
+ import jax.numpy as jnp
245
+ from transformers import AutoTokenizer, FlaxGemmaForCausalLM
246
+
247
+ model_id = "google/gemma-1.1-7b-it"
248
+
249
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
250
+ tokenizer.padding_side = "left"
251
+
252
+ model, params = FlaxGemmaForCausalLM.from_pretrained(
253
+ model_id,
254
+ dtype=jnp.bfloat16,
255
+ revision="flax",
256
+ _do_init=False,
257
+ )
258
+
259
+ inputs = tokenizer("Valencia and Málaga are", return_tensors="np", padding=True)
260
+ output = model.generate(**inputs, params=params, max_new_tokens=20, do_sample=False)
261
+ output_text = tokenizer.batch_decode(output.sequences, skip_special_tokens=True)
262
+ ```
263
+
264
+ [Check this notebook](https://colab.research.google.com/github/sanchit-gandhi/notebooks/blob/main/jax_gemma.ipynb) for a comprehensive walkthrough on how to parallelize JAX inference.
265
+
266
+
267
+ ### Chat Template
268
+
269
+ The instruction-tuned models use a chat template that must be adhered to for conversational use.
270
+ The easiest way to apply it is using the tokenizer's built-in chat template, as shown in the following snippet.
271
+
272
+ Let's load the model and apply the chat template to a conversation. In this example, we'll start with a single user interaction:
273
+
274
+ ```py
275
+ from transformers import AutoTokenizer, AutoModelForCausalLM
276
+ import transformers
277
+ import torch
278
+
279
+ model_id = "google/gemma-1.1-7b-it"
280
+ dtype = torch.bfloat16
281
+
282
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
283
+ model = AutoModelForCausalLM.from_pretrained(
284
+ model_id,
285
+ device_map="cuda",
286
+ torch_dtype=dtype,
287
+ )
288
+
289
+ chat = [
290
+ { "role": "user", "content": "Write a hello world program" },
291
+ ]
292
+ prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
293
+ ```
294
+
295
+ At this point, the prompt contains the following text:
296
+
297
+ ```
298
+ <bos><start_of_turn>user
299
+ Write a hello world program<end_of_turn>
300
+ <start_of_turn>model
301
+ ```
302
+
303
+ As you can see, each turn is preceded by a `<start_of_turn>` delimiter and then the role of the entity
304
+ (either `user`, for content supplied by the user, or `model` for LLM responses). Turns finish with
305
+ the `<end_of_turn>` token.
306
+
307
+ You can follow this format to build the prompt manually, if you need to do it without the tokenizer's
308
+ chat template.
309
+
310
+ After the prompt is ready, generation can be performed like this:
311
+
312
+ ```py
313
+ inputs = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
314
+ outputs = model.generate(input_ids=inputs.to(model.device), max_new_tokens=150)
315
+ ```
316
+
317
+ ### Fine-tuning
318
+
319
+ You can find some fine-tuning scripts 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 them to this model, simply change the model-id to `google/gemma-1.1-7b-it`.
320
+
321
+ We provide:
322
+
323
+ * A script to perform Supervised Fine-Tuning (SFT) on UltraChat dataset using QLoRA
324
+ * A script to perform SFT using FSDP on TPU devices
325
+ * A notebook that you can run on a free-tier Google Colab instance to perform SFT on the English quotes dataset
326
+
327
+ ### Inputs and outputs
328
+
329
+ * **Input:** Text string, such as a question, a prompt, or a document to be
330
+ summarized.
331
+ * **Output:** Generated English-language text in response to the input, such
332
+ as an answer to a question, or a summary of a document.
333
+
334
+ ## Model Data
335
+
336
+ Data used for model training and how the data was processed.
337
+
338
+ ### Training Dataset
339
+
340
+ These models were trained on a dataset of text data that includes a wide variety
341
+ of sources, totaling 6 trillion tokens. Here are the key components:
342
+
343
+ * Web Documents: A diverse collection of web text ensures the model is exposed
344
+ to a broad range of linguistic styles, topics, and vocabulary. Primarily
345
+ English-language content.
346
+ * Code: Exposing the model to code helps it to learn the syntax and patterns of
347
+ programming languages, which improves its ability to generate code or
348
+ understand code-related questions.
349
+ * Mathematics: Training on mathematical text helps the model learn logical
350
+ reasoning, symbolic representation, and to address mathematical queries.
351
+
352
+ The combination of these diverse data sources is crucial for training a powerful
353
+ language model that can handle a wide variety of different tasks and text
354
+ formats.
355
+
356
+ ### Data Preprocessing
357
+
358
+ Here are the key data cleaning and filtering methods applied to the training
359
+ data:
360
+
361
+ * CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering was
362
+ applied at multiple stages in the data preparation process to ensure the
363
+ exclusion of harmful and illegal content
364
+ * Sensitive Data Filtering: As part of making Gemma pre-trained models safe and
365
+ reliable, automated techniques were used to filter out certain personal
366
+ information and other sensitive data from training sets.
367
+ * Additional methods: Filtering based on content quality and safely in line with
368
+ [our policies](https://storage.googleapis.com/gweb-uniblog-publish-prod/documents/2023_Google_AI_Principles_Progress_Update.pdf#page=11).
369
+
370
+ ## Implementation Information
371
+
372
+ Details about the model internals.
373
+
374
+ ### Hardware
375
+
376
+ Gemma was trained using the latest generation of
377
+ [Tensor Processing Unit (TPU)](https://cloud.google.com/tpu/docs/intro-to-tpu) hardware (TPUv5e).
378
+
379
+ Training large language models requires significant computational power. TPUs,
380
+ designed specifically for matrix operations common in machine learning, offer
381
+ several advantages in this domain:
382
+
383
+ * Performance: TPUs are specifically designed to handle the massive computations
384
+ involved in training LLMs. They can speed up training considerably compared to
385
+ CPUs.
386
+ * Memory: TPUs often come with large amounts of high-bandwidth memory, allowing
387
+ for the handling of large models and batch sizes during training. This can
388
+ lead to better model quality.
389
+ * Scalability: TPU Pods (large clusters of TPUs) provide a scalable solution for
390
+ handling the growing complexity of large foundation models. You can distribute
391
+ training across multiple TPU devices for faster and more efficient processing.
392
+ * Cost-effectiveness: In many scenarios, TPUs can provide a more cost-effective
393
+ solution for training large models compared to CPU-based infrastructure,
394
+ especially when considering the time and resources saved due to faster
395
+ training.
396
+ * These advantages are aligned with
397
+ [Google's commitments to operate sustainably](https://sustainability.google/operating-sustainably/).
398
+
399
+ ### Software
400
+
401
+ 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).
402
+
403
+ JAX allows researchers to take advantage of the latest generation of hardware,
404
+ including TPUs, for faster and more efficient training of large models.
405
+
406
+ ML Pathways is Google's latest effort to build artificially intelligent systems
407
+ capable of generalizing across multiple tasks. This is specially suitable for
408
+ [foundation models](https://ai.google/discover/foundation-models/), including large language models like
409
+ these ones.
410
+
411
+ Together, JAX and ML Pathways are used as described in the
412
+ [paper about the Gemini family of models](https://arxiv.org/abs/2312.11805); "the 'single
413
+ controller' programming model of Jax and Pathways allows a single Python
414
+ process to orchestrate the entire training run, dramatically simplifying the
415
+ development workflow."
416
+
417
+ ## Evaluation
418
+
419
+ Model evaluation metrics and results.
420
+
421
+ ### Benchmark Results
422
+
423
+ The pre-trained base models were evaluated against a large collection of different datasets and
424
+ metrics to cover different aspects of text generation:
425
+
426
+ | Benchmark | Metric | Gemma PT 2B | Gemma PT 7B |
427
+ | ------------------------------ | ------------- | ----------- | ----------- |
428
+ | [MMLU](https://arxiv.org/abs/2009.03300) | 5-shot, top-1 | 42.3 | 64.3 |
429
+ | [HellaSwag](https://arxiv.org/abs/1905.07830) | 0-shot | 71.4 | 81.2 |
430
+ | [PIQA](https://arxiv.org/abs/1911.11641) | 0-shot | 77.3 | 81.2 |
431
+ | [SocialIQA](https://arxiv.org/abs/1904.09728) | 0-shot | 49.7 | 51.8 |
432
+ | [BoolQ](https://arxiv.org/abs/1905.10044) | 0-shot | 69.4 | 83.2 |
433
+ | [WinoGrande](https://arxiv.org/abs/1907.10641) | partial score | 65.4 | 72.3 |
434
+ | [CommonsenseQA](https://arxiv.org/abs/1811.00937) | 7-shot | 65.3 | 71.3 |
435
+ | [OpenBookQA](https://arxiv.org/abs/1809.02789) | | 47.8 | 52.8 |
436
+ | [ARC-e](https://arxiv.org/abs/1911.01547) | | 73.2 | 81.5 |
437
+ | [ARC-c](https://arxiv.org/abs/1911.01547) | | 42.1 | 53.2 |
438
+ | [TriviaQA](https://arxiv.org/abs/1705.03551) | 5-shot | 53.2 | 63.4 |
439
+ | [Natural Questions](https://github.com/google-research-datasets/natural-questions) | 5-shot | 12.5 | 23.0 |
440
+ | [HumanEval](https://arxiv.org/abs/2107.03374) | pass@1 | 22.0 | 32.3 |
441
+ | [MBPP](https://arxiv.org/abs/2108.07732) | 3-shot | 29.2 | 44.4 |
442
+ | [GSM8K](https://arxiv.org/abs/2110.14168) | maj@1 | 17.7 | 46.4 |
443
+ | [MATH](https://arxiv.org/abs/2108.07732) | 4-shot | 11.8 | 24.3 |
444
+ | [AGIEval](https://arxiv.org/abs/2304.06364) | | 24.2 | 41.7 |
445
+ | [BIG-Bench](https://arxiv.org/abs/2206.04615) | | 35.2 | 55.1 |
446
+ | ------------------------------ | ------------- | ----------- | ----------- |
447
+ | **Average** | | **44.9** | **56.4** |
448
+
449
+ ## Ethics and Safety
450
+
451
+ Ethics and safety evaluation approach and results.
452
+
453
+ ### Evaluation Approach
454
+
455
+ Our evaluation methods include structured evaluations and internal red-teaming
456
+ testing of relevant content policies. Red-teaming was conducted by a number of
457
+ different teams, each with different goals and human evaluation metrics. These
458
+ models were evaluated against a number of different categories relevant to
459
+ ethics and safety, including:
460
+
461
+ * Text-to-Text Content Safety: Human evaluation on prompts covering safety
462
+ policies including child sexual abuse and exploitation, harassment, violence
463
+ and gore, and hate speech.
464
+ * Text-to-Text Representational Harms: Benchmark against relevant academic
465
+ datasets such as [WinoBias](https://arxiv.org/abs/1804.06876) and [BBQ Dataset](https://arxiv.org/abs/2110.08193v2).
466
+ * Memorization: Automated evaluation of memorization of training data, including
467
+ the risk of personally identifiable information exposure.
468
+ * Large-scale harm: Tests for "dangerous capabilities," such as chemical,
469
+ biological, radiological, and nuclear (CBRN) risks.
470
+
471
+ ### Evaluation Results
472
+
473
+ The results of ethics and safety evaluations are within acceptable thresholds
474
+ 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
475
+ safety, content safety, representational harms, memorization, large-scale harms.
476
+ On top of robust internal evaluations, the results of well known safety
477
+ benchmarks like BBQ, BOLD, Winogender, Winobias, RealToxicity, and TruthfulQA
478
+ are shown here.
479
+
480
+ #### Gemma 1.0
481
+
482
+ | Benchmark | Metric | Gemma 1.0 IT 2B | Gemma 1.0 IT 7B |
483
+ | ------------------------ | ------------- | --------------- | --------------- |
484
+ | [RealToxicity][realtox] | average | 6.86 | 7.90 |
485
+ | [BOLD][bold] | | 45.57 | 49.08 |
486
+ | [CrowS-Pairs][crows] | top-1 | 45.82 | 51.33 |
487
+ | [BBQ Ambig][bbq] | 1-shot, top-1 | 62.58 | 92.54 |
488
+ | [BBQ Disambig][bbq] | top-1 | 54.62 | 71.99 |
489
+ | [Winogender][winogender] | top-1 | 51.25 | 54.17 |
490
+ | [TruthfulQA][truthfulqa] | | 44.84 | 31.81 |
491
+ | [Winobias 1_2][winobias] | | 56.12 | 59.09 |
492
+ | [Winobias 2_2][winobias] | | 91.10 | 92.23 |
493
+ | [Toxigen][toxigen] | | 29.77 | 39.59 |
494
+ | ------------------------ | ------------- | --------------- | --------------- |
495
+
496
+ #### Gemma 1.1
497
+
498
+ | Benchmark | Metric | Gemma 1.1 IT 2B | Gemma 1.1 IT 7B |
499
+ | ------------------------ | ------------- | --------------- | --------------- |
500
+ | [RealToxicity][realtox] | average | 7.03 | 8.04 |
501
+ | [BOLD][bold] | | 47.76 | |
502
+ | [CrowS-Pairs][crows] | top-1 | 45.89 | 49.67 |
503
+ | [BBQ Ambig][bbq] | 1-shot, top-1 | 58.97 | 86.06 |
504
+ | [BBQ Disambig][bbq] | top-1 | 53.90 | 85.08 |
505
+ | [Winogender][winogender] | top-1 | 50.14 | 57.64 |
506
+ | [TruthfulQA][truthfulqa] | | 44.24 | 45.34 |
507
+ | [Winobias 1_2][winobias] | | 55.93 | 59.22 |
508
+ | [Winobias 2_2][winobias] | | 89.46 | 89.2 |
509
+ | [Toxigen][toxigen] | | 29.64 | 38.75 |
510
+ | ------------------------ | ------------- | --------------- | --------------- |
511
+
512
+
513
+ ## Usage and Limitations
514
+
515
+ These models have certain limitations that users should be aware of.
516
+
517
+ ### Intended Usage
518
+
519
+ Open Large Language Models (LLMs) have a wide range of applications across
520
+ various industries and domains. The following list of potential uses is not
521
+ comprehensive. The purpose of this list is to provide contextual information
522
+ about the possible use-cases that the model creators considered as part of model
523
+ training and development.
524
+
525
+ * Content Creation and Communication
526
+ * Text Generation: These models can be used to generate creative text formats
527
+ such as poems, scripts, code, marketing copy, and email drafts.
528
+ * Chatbots and Conversational AI: Power conversational interfaces for customer
529
+ service, virtual assistants, or interactive applications.
530
+ * Text Summarization: Generate concise summaries of a text corpus, research
531
+ papers, or reports.
532
+ * Research and Education
533
+ * Natural Language Processing (NLP) Research: These models can serve as a
534
+ foundation for researchers to experiment with NLP techniques, develop
535
+ algorithms, and contribute to the advancement of the field.
536
+ * Language Learning Tools: Support interactive language learning experiences,
537
+ aiding in grammar correction or providing writing practice.
538
+ * Knowledge Exploration: Assist researchers in exploring large bodies of text
539
+ by generating summaries or answering questions about specific topics.
540
+
541
+ ### Limitations
542
+
543
+ * Training Data
544
+ * The quality and diversity of the training data significantly influence the
545
+ model's capabilities. Biases or gaps in the training data can lead to
546
+ limitations in the model's responses.
547
+ * The scope of the training dataset determines the subject areas the model can
548
+ handle effectively.
549
+ * Context and Task Complexity
550
+ * LLMs are better at tasks that can be framed with clear prompts and
551
+ instructions. Open-ended or highly complex tasks might be challenging.
552
+ * A model's performance can be influenced by the amount of context provided
553
+ (longer context generally leads to better outputs, up to a certain point).
554
+ * Language Ambiguity and Nuance
555
+ * Natural language is inherently complex. LLMs might struggle to grasp subtle
556
+ nuances, sarcasm, or figurative language.
557
+ * Factual Accuracy
558
+ * LLMs generate responses based on information they learned from their
559
+ training datasets, but they are not knowledge bases. They may generate
560
+ incorrect or outdated factual statements.
561
+ * Common Sense
562
+ * LLMs rely on statistical patterns in language. They might lack the ability
563
+ to apply common sense reasoning in certain situations.
564
+
565
+ ### Ethical Considerations and Risks
566
+
567
+ The development of large language models (LLMs) raises several ethical concerns.
568
+ In creating an open model, we have carefully considered the following:
569
+
570
+ * Bias and Fairness
571
+ * LLMs trained on large-scale, real-world text data can reflect socio-cultural
572
+ biases embedded in the training material. These models underwent careful
573
+ scrutiny, input data pre-processing described and posterior evaluations
574
+ reported in this card.
575
+ * Misinformation and Misuse
576
+ * LLMs can be misused to generate text that is false, misleading, or harmful.
577
+ * Guidelines are provided for responsible use with the model, see the
578
+ [Responsible Generative AI Toolkit](http://ai.google.dev/gemma/responsible).
579
+ * Transparency and Accountability:
580
+ * This model card summarizes details on the models' architecture,
581
+ capabilities, limitations, and evaluation processes.
582
+ * A responsibly developed open model offers the opportunity to share
583
+ innovation by making LLM technology accessible to developers and researchers
584
+ across the AI ecosystem.
585
+
586
+ Risks identified and mitigations:
587
+
588
+ * Perpetuation of biases: It's encouraged to perform continuous monitoring
589
+ (using evaluation metrics, human review) and the exploration of de-biasing
590
+ techniques during model training, fine-tuning, and other use cases.
591
+ * Generation of harmful content: Mechanisms and guidelines for content safety
592
+ are essential. Developers are encouraged to exercise caution and implement
593
+ appropriate content safety safeguards based on their specific product policies
594
+ and application use cases.
595
+ * Misuse for malicious purposes: Technical limitations and developer and
596
+ end-user education can help mitigate against malicious applications of LLMs.
597
+ Educational resources and reporting mechanisms for users to flag misuse are
598
+ provided. Prohibited uses of Gemma models are outlined in the
599
+ [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy).
600
+ * Privacy violations: Models were trained on data filtered for removal of PII
601
+ (Personally Identifiable Information). Developers are encouraged to adhere to
602
+ privacy regulations with privacy-preserving techniques.
603
+
604
+ ### Benefits
605
+
606
+ At the time of release, this family of models provides high-performance open
607
+ large language model implementations designed from the ground up for Responsible
608
+ AI development compared to similarly sized models.
609
+
610
+ Using the benchmark evaluation metrics described in this document, these models
611
+ have shown to provide superior performance to other, comparably-sized open model
612
+ alternatives.
gemma-1.1-7b-it-Q3_K_L.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e10b878057ec814b1a34e4c344a2d6a1f2526bfa663a99852ad116d52754b163
3
+ size 4709067744
gemma-1.1-7b-it-Q4_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:47821da72ee9e80b6fd43c6190ad751b485fb61fa5664590f7a73246bcd8332e
3
+ size 5329759200
gemma-1.1-7b-it-Q5_K_M.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:890caf19faf204cf5dffd0af384cf1b5c5108f403c5ef70c864262514c4f8ac4
3
+ size 6144502752
gemma-1.1-7b-it-Q6_K.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b073e047c021a4c41c0a429b04e96f1449b11e7be83e8109a846b10a465b7914
3
+ size 7010167776
gemma-1.1-7b-it-Q8_0.gguf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:70840b7af2b7191b0088c7c2139e9f829324c03ad808f52db5578b4d03e9272c
3
+ size 9077844960