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