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