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