aashish1904 commited on
Commit
b1dfb99
1 Parent(s): fc8ed1c

Upload README.md with huggingface_hub

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