Add Gemma 3n E2B model for mobile
Browse files
.gitattributes
CHANGED
|
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.spm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
tokenizer.spm filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
gemma-3n-E2B-it-litert-preview/gemma-3n-E2B-it-int4.task filter=lfs diff=lfs merge=lfs -text
|
gemma-3n-E2B-it-litert-preview/.gitattributes
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
gemma-3n-E2B-it-int4.task filter=lfs diff=lfs merge=lfs -text
|
gemma-3n-E2B-it-litert-preview/LICENSE
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Gemma Terms of Use
|
| 2 |
+
|
| 3 |
+
This folder contains the Gemma 1.1 2B Instruction-Tuned model, which is governed by Google's Gemma Terms of Use.
|
| 4 |
+
|
| 5 |
+
## License
|
| 6 |
+
|
| 7 |
+
The Gemma model files in this directory are provided under and subject to the **Gemma Terms of Use**.
|
| 8 |
+
|
| 9 |
+
**Full Terms**: https://ai.google.dev/gemma/terms
|
| 10 |
+
|
| 11 |
+
## Usage Terms Summary
|
| 12 |
+
|
| 13 |
+
By downloading or using the Gemma model files from this repository, you agree to:
|
| 14 |
+
|
| 15 |
+
1. **Attribution**: Include this license notice with any distribution
|
| 16 |
+
2. **Prohibited Uses**: Not use for prohibited purposes (see full terms)
|
| 17 |
+
3. **Compliance**: Comply with all applicable laws
|
| 18 |
+
4. **Modifications**: Mark any modifications clearly
|
| 19 |
+
5. **No Warranty**: Model provided "AS IS" without warranties
|
| 20 |
+
|
| 21 |
+
## Model Files
|
| 22 |
+
|
| 23 |
+
- **gemma-1.1-2b-it-gpu-int4.bin** (1.35 GB) - Gemma 1.1 2B IT model, INT4 quantized
|
| 24 |
+
- **tokenizer.spm** (4.2 MB) - SentencePiece tokenizer
|
| 25 |
+
|
| 26 |
+
## Copyright
|
| 27 |
+
|
| 28 |
+
Copyright © Google LLC. All rights reserved.
|
| 29 |
+
|
| 30 |
+
## Model Information
|
| 31 |
+
|
| 32 |
+
- **Model Name**: Gemma 1.1 2B IT (Instruction-Tuned)
|
| 33 |
+
- **Quantization**: INT4 for mobile deployment
|
| 34 |
+
- **Format**: TFLite-compatible binary
|
| 35 |
+
- **Target Platform**: Android/Mobile (MediaPipe)
|
| 36 |
+
- **Source**: https://ai.google.dev/gemma
|
| 37 |
+
|
| 38 |
+
## Important Notes
|
| 39 |
+
|
| 40 |
+
1. **This is NOT an Apache 2.0 licensed model** - Gemma has its own terms
|
| 41 |
+
2. **Commercial use is allowed** but subject to Gemma Terms restrictions
|
| 42 |
+
3. **You must read the full terms** before using: https://ai.google.dev/gemma/terms
|
| 43 |
+
4. **Attribution required**: You must acknowledge use of Gemma in your application
|
| 44 |
+
|
| 45 |
+
## Disclaimer
|
| 46 |
+
|
| 47 |
+
This repository distributes the Gemma model for use in the M.AI application. The model is created and owned by Google LLC. This repository's maintainer makes no warranties about the model and is not responsible for how you use it. You are solely responsible for compliance with the Gemma Terms of Use.
|
| 48 |
+
|
| 49 |
+
## Questions
|
| 50 |
+
|
| 51 |
+
- **Gemma Terms Questions**: Contact Google LLC
|
| 52 |
+
- **Repository Questions**: https://huggingface.co/CgrHello/mai-models or https://github.com/adaflexer/mai-models/issues
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
**IMPORTANT**: You MUST review and agree to the complete Gemma Terms of Use before using this model: https://ai.google.dev/gemma/terms
|
gemma-3n-E2B-it-litert-preview/README.md
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: gemma
|
| 3 |
+
pipeline_tag: image-text-to-text
|
| 4 |
+
extra_gated_heading: Access Gemma on Hugging Face
|
| 5 |
+
extra_gated_prompt: To access Gemma on Hugging Face, you’re required to review and
|
| 6 |
+
agree to Google’s usage license. To do this, please ensure you’re logged in to Hugging
|
| 7 |
+
Face and click below. Requests are processed immediately.
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
> [!Note]
|
| 11 |
+
> This repository corresponds to the Preview version of Gemma 3n E2B, to be used with Google AI Edge. You
|
| 12 |
+
> can also try it out in [Google AI Studio](https://aistudio.google.com/prompts/new_chat?model=gemma-3n-e4b-it).
|
| 13 |
+
>
|
| 14 |
+
> The current checkpoint only supports text and vision input. We are actively working to roll out full multimodal features and are
|
| 15 |
+
> collaborating with open-source partners to bring Gemma 3n to the open-source community in the coming weeks.
|
| 16 |
+
>
|
| 17 |
+
> Gemma 3n models have a novel architecture that allows them to run with a smaller number of effective parameters.
|
| 18 |
+
> They also have a Matformer architecture that allows nesting multiple models. Learn more about these techniques
|
| 19 |
+
> in the [Gemma documentation](https://ai.google.dev/gemma/docs/gemma-3n).
|
| 20 |
+
|
| 21 |
+
# Gemma 3n model card
|
| 22 |
+
|
| 23 |
+
**Model Page**: [Gemma 3n](https://ai.google.dev/gemma/docs/gemma-3n)
|
| 24 |
+
|
| 25 |
+
**Resources and Technical Documentation**:
|
| 26 |
+
|
| 27 |
+
- [Responsible Generative AI Toolkit](https://ai.google.dev/responsible)
|
| 28 |
+
- [Gemma on Kaggle](https://www.kaggle.com/models/google/gemma-3n)
|
| 29 |
+
- Google AI Edge [documentation](https://ai.google.dev/edge/mediapipe/solutions/genai/llm_inference) to run on mobile
|
| 30 |
+
- Try on Android by downloading our [Google AI Edge Gallery](https://github.com/google-ai-edge/gallery/releases) sample app
|
| 31 |
+
|
| 32 |
+
**Terms of Use**: [Terms](https://ai.google.dev/gemma/terms)\
|
| 33 |
+
**Authors**: Google DeepMind
|
| 34 |
+
|
| 35 |
+
## Model Information
|
| 36 |
+
|
| 37 |
+
Summary description and brief definition of inputs and outputs.
|
| 38 |
+
|
| 39 |
+
### Description
|
| 40 |
+
|
| 41 |
+
Gemma is a family of lightweight, state-of-the-art open models from Google,
|
| 42 |
+
built from the same research and technology used to create the Gemini models.
|
| 43 |
+
Gemma models are well-suited for a variety of content understanding tasks,
|
| 44 |
+
including question answering, summarization, and reasoning. Their relatively
|
| 45 |
+
small size makes it possible to deploy them in environments with limited
|
| 46 |
+
resources such as laptops, desktops or your own cloud infrastructure,
|
| 47 |
+
democratizing access to state of the art AI models and helping foster innovation
|
| 48 |
+
for everyone.
|
| 49 |
+
|
| 50 |
+
Gemma 3n models are designed for efficient execution on low-resource devices.
|
| 51 |
+
They are capable of multimodal input, handling text, image, video, and audio
|
| 52 |
+
input, and generating text outputs, with open weights for instruction-tuned
|
| 53 |
+
variants. These models were trained with data in over 140 spoken languages.
|
| 54 |
+
|
| 55 |
+
Gemma 3n models use selective parameter activation technology to reduce resource
|
| 56 |
+
requirements. This technique allows the models to operate at an effective size
|
| 57 |
+
of 2B and 4B parameters, which is lower than the total number of parameters they
|
| 58 |
+
contain. For more information on Gemma 3n's efficient parameter management
|
| 59 |
+
technology, see the [Gemma 3n](https://ai.google.dev/gemma/docs/gemma-3n#parameters)
|
| 60 |
+
page.
|
| 61 |
+
|
| 62 |
+
### Inputs and outputs
|
| 63 |
+
|
| 64 |
+
- **Input:**
|
| 65 |
+
- Text string, such as a question, a prompt, or a document to be
|
| 66 |
+
summarized
|
| 67 |
+
- Images, normalized to 256x256, 512x512, or 768x768 resolution
|
| 68 |
+
and encoded to 256 tokens each
|
| 69 |
+
- Audio data encoded to 6.25 tokens per second from a single channel
|
| 70 |
+
- Total input context of 32K tokens
|
| 71 |
+
- **Output:**
|
| 72 |
+
- Generated text in response to the input, such as an answer to a
|
| 73 |
+
question, analysis of image content, or a summary of a document
|
| 74 |
+
- Total output length up to 32K tokens, subtracting the request
|
| 75 |
+
input tokens
|
| 76 |
+
|
| 77 |
+
### Citation
|
| 78 |
+
|
| 79 |
+
```
|
| 80 |
+
@article{gemma_3n_2025,
|
| 81 |
+
title={Gemma 3n},
|
| 82 |
+
url={https://ai.google.dev/gemma/docs/gemma-3n},
|
| 83 |
+
publisher={Google DeepMind},
|
| 84 |
+
author={Gemma Team},
|
| 85 |
+
year={2025}
|
| 86 |
+
}
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Model Data
|
| 90 |
+
|
| 91 |
+
Data used for model training and how the data was processed.
|
| 92 |
+
|
| 93 |
+
### Training Dataset
|
| 94 |
+
|
| 95 |
+
These models were trained on a dataset that includes a wide variety of sources
|
| 96 |
+
totalling approximately 11 trillion tokens. The knowledge cutoff date for the
|
| 97 |
+
training data was June 2024. Here are the key components:
|
| 98 |
+
|
| 99 |
+
- **Web Documents**: A diverse collection of web text ensures the model
|
| 100 |
+
is exposed to a broad range of linguistic styles, topics, and vocabulary.
|
| 101 |
+
The training dataset includes content in over 140 languages.
|
| 102 |
+
- **Code**: Exposing the model to code helps it to learn the syntax and
|
| 103 |
+
patterns of programming languages, which improves its ability to generate
|
| 104 |
+
code and understand code-related questions.
|
| 105 |
+
- **Mathematics**: Training on mathematical text helps the model learn
|
| 106 |
+
logical reasoning, symbolic representation, and to address mathematical queries.
|
| 107 |
+
- **Images**: A wide range of images enables the model to perform image
|
| 108 |
+
analysis and visual data extraction tasks.
|
| 109 |
+
- Audio: A diverse set of sound samples enables the model to recognize
|
| 110 |
+
speech, transcribe text from recordings, and identify information in audio data.
|
| 111 |
+
|
| 112 |
+
The combination of these diverse data sources is crucial for training a
|
| 113 |
+
powerful multimodal model that can handle a wide variety of different tasks and
|
| 114 |
+
data formats.
|
| 115 |
+
|
| 116 |
+
### Data Preprocessing
|
| 117 |
+
|
| 118 |
+
Here are the key data cleaning and filtering methods applied to the training
|
| 119 |
+
data:
|
| 120 |
+
|
| 121 |
+
- **CSAM Filtering**: Rigorous CSAM (Child Sexual Abuse Material)
|
| 122 |
+
filtering was applied at multiple stages in the data preparation process to
|
| 123 |
+
ensure the exclusion of harmful and illegal content.
|
| 124 |
+
- **Sensitive Data Filtering**: As part of making Gemma pre-trained models
|
| 125 |
+
safe and reliable, automated techniques were used to filter out certain
|
| 126 |
+
personal information and other sensitive data from training sets.
|
| 127 |
+
- **Additional methods**: Filtering based on content quality and safety in
|
| 128 |
+
line with
|
| 129 |
+
[our policies](https://ai.google/static/documents/ai-responsibility-update-published-february-2025.pdf).
|
| 130 |
+
|
| 131 |
+
## Implementation Information
|
| 132 |
+
|
| 133 |
+
Details about the model internals.
|
| 134 |
+
|
| 135 |
+
### Hardware
|
| 136 |
+
|
| 137 |
+
Gemma was trained using [Tensor Processing Unit
|
| 138 |
+
(TPU)](https://cloud.google.com/tpu/docs/intro-to-tpu) hardware (TPUv4p, TPUv5p
|
| 139 |
+
and TPUv5e). Training generative models requires significant computational
|
| 140 |
+
power. TPUs, designed specifically for matrix operations common in machine
|
| 141 |
+
learning, offer several advantages in this domain:
|
| 142 |
+
|
| 143 |
+
- **Performance**: TPUs are specifically designed to handle the massive
|
| 144 |
+
computations involved in training generative models. They can speed up
|
| 145 |
+
training considerably compared to CPUs.
|
| 146 |
+
- **Memory**: TPUs often come with large amounts of high-bandwidth memory,
|
| 147 |
+
allowing for the handling of large models and batch sizes during training.
|
| 148 |
+
This can lead to better model quality.
|
| 149 |
+
- **Scalability**: TPU Pods (large clusters of TPUs) provide a scalable
|
| 150 |
+
solution for handling the growing complexity of large foundation models.
|
| 151 |
+
You can distribute training across multiple TPU devices for faster and more
|
| 152 |
+
efficient processing.
|
| 153 |
+
- **Cost-effectiveness**: In many scenarios, TPUs can provide a more
|
| 154 |
+
cost-effective solution for training large models compared to CPU-based
|
| 155 |
+
infrastructure, especially when considering the time and resources saved
|
| 156 |
+
due to faster training.
|
| 157 |
+
|
| 158 |
+
These advantages are aligned with
|
| 159 |
+
[Google's commitments to operate sustainably](https://sustainability.google/operating-sustainably/).
|
| 160 |
+
|
| 161 |
+
### Software
|
| 162 |
+
|
| 163 |
+
Training was done using [JAX](https://github.com/jax-ml/jax) and
|
| 164 |
+
[ML Pathways](https://blog.google/technology/ai/introducing-pathways-next-generation-ai-architecture/).
|
| 165 |
+
JAX allows researchers to take advantage of the latest generation of hardware,
|
| 166 |
+
including TPUs, for faster and more efficient training of large models. ML
|
| 167 |
+
Pathways is Google's latest effort to build artificially intelligent systems
|
| 168 |
+
capable of generalizing across multiple tasks. This is specially suitable for
|
| 169 |
+
foundation models, including large language models like these ones.
|
| 170 |
+
|
| 171 |
+
Together, JAX and ML Pathways are used as described in the
|
| 172 |
+
[paper about the Gemini family of models](https://goo.gle/gemma2report):
|
| 173 |
+
*"the 'single controller' programming model of Jax and Pathways allows a single
|
| 174 |
+
Python process to orchestrate the entire training run, dramatically simplifying
|
| 175 |
+
the development workflow."*
|
| 176 |
+
|
| 177 |
+
## Evaluation
|
| 178 |
+
|
| 179 |
+
Model evaluation metrics and results.
|
| 180 |
+
|
| 181 |
+
### Benchmark Results
|
| 182 |
+
|
| 183 |
+
These models were evaluated at full precision (float32) against a large
|
| 184 |
+
collection of different datasets and metrics to cover different aspects of
|
| 185 |
+
content generation. Evaluation results marked with **IT** are for
|
| 186 |
+
instruction-tuned models. Evaluation results marked with **PT** are for
|
| 187 |
+
pre-trained models.
|
| 188 |
+
|
| 189 |
+
#### Reasoning and factuality
|
| 190 |
+
|
| 191 |
+
| Benchmark | Metric | n-shot | E2B PT | E4B PT |
|
| 192 |
+
| ------------------------------ |----------------|----------|:--------:|:--------:|
|
| 193 |
+
| [HellaSwag][hellaswag] | Accuracy | 10-shot | 72.2 | 78.6 |
|
| 194 |
+
| [BoolQ][boolq] | Accuracy | 0-shot | 76.4 | 81.6 |
|
| 195 |
+
| [PIQA][piqa] | Accuracy | 0-shot | 78.9 | 81.0 |
|
| 196 |
+
| [SocialIQA][socialiqa] | Accuracy | 0-shot | 48.8 | 50.0 |
|
| 197 |
+
| [TriviaQA][triviaqa] | Accuracy | 5-shot | 60.8 | 70.2 |
|
| 198 |
+
| [Natural Questions][naturalq] | Accuracy | 5-shot | 15.5 | 20.9 |
|
| 199 |
+
| [ARC-c][arc] | Accuracy | 25-shot | 51.7 | 61.6 |
|
| 200 |
+
| [ARC-e][arc] | Accuracy | 0-shot | 75.8 | 81.6 |
|
| 201 |
+
| [WinoGrande][winogrande] | Accuracy | 5-shot | 66.8 | 71.7 |
|
| 202 |
+
| [BIG-Bench Hard][bbh] | Accuracy | few-shot | 44.3 | 52.9 |
|
| 203 |
+
| [DROP][drop] | Token F1 score | 1-shot | 53.9 | 60.8 |
|
| 204 |
+
|
| 205 |
+
[hellaswag]: https://arxiv.org/abs/1905.07830
|
| 206 |
+
[boolq]: https://arxiv.org/abs/1905.10044
|
| 207 |
+
[piqa]: https://arxiv.org/abs/1911.11641
|
| 208 |
+
[socialiqa]: https://arxiv.org/abs/1904.09728
|
| 209 |
+
[triviaqa]: https://arxiv.org/abs/1705.03551
|
| 210 |
+
[naturalq]: https://github.com/google-research-datasets/natural-questions
|
| 211 |
+
[arc]: https://arxiv.org/abs/1911.01547
|
| 212 |
+
[winogrande]: https://arxiv.org/abs/1907.10641
|
| 213 |
+
[bbh]: https://paperswithcode.com/dataset/bbh
|
| 214 |
+
[drop]: https://arxiv.org/abs/1903.00161
|
| 215 |
+
|
| 216 |
+
#### Multilingual
|
| 217 |
+
|
| 218 |
+
| Benchmark | Metric | n-shot | E2B IT | E4B IT |
|
| 219 |
+
| ------------------------------------|-------------------------|----------|:--------:|:--------:|
|
| 220 |
+
| [MGSM][mgsm] | Accuracy | 0-shot | 53.1 | 60.7 |
|
| 221 |
+
| [WMT24++][wmt24pp] (ChrF) | Character-level F-score | 0-shot | 42.7 | 50.1 |
|
| 222 |
+
| [Include][include] | Accuracy | 0-shot | 38.6 | 57.2 |
|
| 223 |
+
| [MMLU][mmlu] (ProX) | Accuracy | 0-shot | 8.1 | 19.9 |
|
| 224 |
+
| [OpenAI MMLU][openai-mmlu] | Accuracy | 0-shot | 22.3 | 35.6 |
|
| 225 |
+
| [Global-MMLU][global-mmlu] | Accuracy | 0-shot | 55.1 | 60.3 |
|
| 226 |
+
| [ECLeKTic][eclektic] | ECLeKTic score | 0-shot | 2.5 | 1.9 |
|
| 227 |
+
|
| 228 |
+
[mgsm]: https://arxiv.org/abs/2210.03057
|
| 229 |
+
[wmt24pp]: https://arxiv.org/abs/2502.12404v1
|
| 230 |
+
[include]:https://arxiv.org/abs/2411.19799
|
| 231 |
+
[mmlu]: https://arxiv.org/abs/2009.03300
|
| 232 |
+
[openai-mmlu]: https://huggingface.co/datasets/openai/MMMLU
|
| 233 |
+
[global-mmlu]: https://huggingface.co/datasets/CohereLabs/Global-MMLU
|
| 234 |
+
[eclektic]: https://arxiv.org/abs/2502.21228
|
| 235 |
+
|
| 236 |
+
#### STEM and code
|
| 237 |
+
|
| 238 |
+
| Benchmark | Metric | n-shot | E2B IT | E4B IT |
|
| 239 |
+
| ------------------------------------|--------------------------|----------|:--------:|:--------:|
|
| 240 |
+
| [GPQA][gpqa] Diamond | RelaxedAccuracy/accuracy | 0-shot | 24.8 | 23.7 |
|
| 241 |
+
| [LiveCodeBench][lcb] v5 | pass@1 | 0-shot | 18.6 | 25.7 |
|
| 242 |
+
| Codegolf v2.2 | pass@1 | 0-shot | 11.0 | 16.8 |
|
| 243 |
+
| [AIME 2025][aime-2025] | Accuracy | 0-shot | 6.7 | 11.6 |
|
| 244 |
+
|
| 245 |
+
[gpqa]: https://arxiv.org/abs/2311.12022
|
| 246 |
+
[lcb]: https://arxiv.org/abs/2403.07974
|
| 247 |
+
[aime-2025]: https://www.vals.ai/benchmarks/aime-2025-05-09
|
| 248 |
+
|
| 249 |
+
#### Additional benchmarks
|
| 250 |
+
|
| 251 |
+
| Benchmark | Metric | n-shot | E2B IT | E4B IT |
|
| 252 |
+
| ------------------------------------ |------------|----------|:--------:|:--------:|
|
| 253 |
+
| [MMLU][mmlu] | Accuracy | 0-shot | 60.1 | 64.9 |
|
| 254 |
+
| [MBPP][mbpp] | pass@1 | 3-shot | 56.6 | 63.6 |
|
| 255 |
+
| [HumanEval][humaneval] | pass@1 | 0-shot | 66.5 | 75.0 |
|
| 256 |
+
| [LiveCodeBench][lcb] | pass@1 | 0-shot | 13.2 | 13.2 |
|
| 257 |
+
| HiddenMath | Accuracy | 0-shot | 27.7 | 37.7 |
|
| 258 |
+
| [Global-MMLU-Lite][global-mmlu-lite] | Accuracy | 0-shot | 59.0 | 64.5 |
|
| 259 |
+
| [MMLU][mmlu] (Pro) | Accuracy | 0-shot | 40.5 | 50.6 |
|
| 260 |
+
|
| 261 |
+
[gpqa]: https://arxiv.org/abs/2311.12022
|
| 262 |
+
[mbpp]: https://arxiv.org/abs/2108.07732
|
| 263 |
+
[humaneval]: https://arxiv.org/abs/2107.03374
|
| 264 |
+
[lcb]: https://arxiv.org/abs/2403.07974
|
| 265 |
+
[global-mmlu-lite]: https://huggingface.co/datasets/CohereForAI/Global-MMLU-Lite
|
| 266 |
+
|
| 267 |
+
#### Android Performance Benchmarks with Google AI Edge
|
| 268 |
+
|
| 269 |
+
Note that all benchmark stats are from a Samsung S25 Ultra with 4096 KV cache size, 1024 tokens prefill, 256 tokens decode.
|
| 270 |
+
|
| 271 |
+
These numbers will continue to improve while Gemma 3n is in preview.
|
| 272 |
+
|
| 273 |
+
| Weight Quantization | Backend | Prefill (tokens/sec) | Decode (tokens/sec) | Time to first token (sec) | Model size (MB) | Peak RSS Memory (MB) | GPU Memory (MB) |
|
| 274 |
+
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
|
| 275 |
+
| dynamic\_int4 | CPU | 163 | 17.6 | 6.7 | 2991 | 2704 | 193 |
|
| 276 |
+
| dynamic\_int4 | GPU | 620 | 23.3 | 12.7 | 2991 | 3408 | 3408 |
|
| 277 |
+
|
| 278 |
+
* Model size: measured by the size of the .tflite flatbuffer (serialization format for LiteRT models)
|
| 279 |
+
* The inference on CPU is accelerated via the LiteRT [XNNPACK](https://github.com/google/XNNPACK) delegate with 4 threads
|
| 280 |
+
* Benchmark on CPU is done assuming XNNPACK cache is enabled
|
| 281 |
+
* Benchmark on GPU is done assuming model is cached
|
| 282 |
+
* Vision encoder is always run on GPU with 512x512 resolution
|
| 283 |
+
* Cpufreq governor is set to performance during benchmark. Observed performance may vary depending on your phone’s hardware and current activity level.
|
| 284 |
+
* dynamic\_int4: quantized model with int4 weights and float activations.
|
| 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 |
+
- **Child Safety**: Evaluation of text-to-text and image to text prompts
|
| 300 |
+
covering child safety policies, including child sexual abuse and
|
| 301 |
+
exploitation.
|
| 302 |
+
- **Content Safety:** Evaluation of text-to-text and image to text prompts
|
| 303 |
+
covering safety policies including, harassment, violence and gore, and hate
|
| 304 |
+
speech.
|
| 305 |
+
- **Representational Harms**: Evaluation of text-to-text and image to text
|
| 306 |
+
prompts covering safety policies including bias, stereotyping, and harmful
|
| 307 |
+
associations or inaccuracies.
|
| 308 |
+
|
| 309 |
+
In addition to development level evaluations, we conduct "assurance
|
| 310 |
+
evaluations" which are our 'arms-length' internal evaluations for responsibility
|
| 311 |
+
governance decision making. They are conducted separately from the model
|
| 312 |
+
development team, to inform decision making about release. High level findings
|
| 313 |
+
are fed back to the model team, but prompt sets are held-out to prevent
|
| 314 |
+
overfitting and preserve the results' ability to inform decision making. Notable
|
| 315 |
+
assurance evaluation results are reported to our Responsibility & Safety Council
|
| 316 |
+
as part of release review.
|
| 317 |
+
|
| 318 |
+
### Evaluation Results
|
| 319 |
+
|
| 320 |
+
For all areas of safety testing, we saw safe levels of performance across the
|
| 321 |
+
categories of child safety, content safety, and representational harms relative
|
| 322 |
+
to previous Gemma models. All testing was conducted without safety filters to
|
| 323 |
+
evaluate the model capabilities and behaviors. For text-to-text, image-to-text,
|
| 324 |
+
and audio-to-text, and across all model sizes, the model produced minimal policy
|
| 325 |
+
violations, and showed significant improvements over previous Gemma models'
|
| 326 |
+
performance with respect to high severity violations. A limitation of our
|
| 327 |
+
evaluations was they included primarily English language prompts.
|
| 328 |
+
|
| 329 |
+
## Usage and Limitations
|
| 330 |
+
|
| 331 |
+
These models have certain limitations that users should be aware of.
|
| 332 |
+
|
| 333 |
+
### Intended Usage
|
| 334 |
+
|
| 335 |
+
Open generative models have a wide range of applications across various
|
| 336 |
+
industries and domains. The following list of potential uses is not
|
| 337 |
+
comprehensive. The purpose of this list is to provide contextual information
|
| 338 |
+
about the possible use-cases that the model creators considered as part of model
|
| 339 |
+
training and development.
|
| 340 |
+
|
| 341 |
+
- Content Creation and Communication
|
| 342 |
+
- **Text Generation**: Generate creative text formats such as
|
| 343 |
+
poems, scripts, code, marketing copy, and email drafts.
|
| 344 |
+
- **Chatbots and Conversational AI**: Power conversational
|
| 345 |
+
interfaces for customer service, virtual assistants, or interactive
|
| 346 |
+
applications.
|
| 347 |
+
- **Text Summarization**: Generate concise summaries of a text
|
| 348 |
+
corpus, research papers, or reports.
|
| 349 |
+
- **Image Data Extraction**: Extract, interpret, and summarize
|
| 350 |
+
visual data for text communications.
|
| 351 |
+
- **Audio Data Extraction**: Transcribe spoken language, speech
|
| 352 |
+
translated to text in other languages, and analyze sound-based data.
|
| 353 |
+
- Research and Education
|
| 354 |
+
- **Natural Language Processing (NLP) and generative model
|
| 355 |
+
Research**: These models can serve as a foundation for researchers to
|
| 356 |
+
experiment with generative models and NLP techniques, develop
|
| 357 |
+
algorithms, and contribute to the advancement of the field.
|
| 358 |
+
- **Language Learning Tools**: Support interactive language
|
| 359 |
+
learning experiences, aiding in grammar correction or providing writing
|
| 360 |
+
practice.
|
| 361 |
+
- **Knowledge Exploration**: Assist researchers in exploring large
|
| 362 |
+
bodies of data by generating summaries or answering questions about
|
| 363 |
+
specific topics.
|
| 364 |
+
|
| 365 |
+
### Limitations
|
| 366 |
+
|
| 367 |
+
- Training Data
|
| 368 |
+
- The quality and diversity of the training data significantly
|
| 369 |
+
influence the model's capabilities. Biases or gaps in the training data
|
| 370 |
+
can lead to limitations in the model's responses.
|
| 371 |
+
- The scope of the training dataset determines the subject areas
|
| 372 |
+
the model can handle effectively.
|
| 373 |
+
- Context and Task Complexity
|
| 374 |
+
- Models are better at tasks that can be framed with clear
|
| 375 |
+
prompts and instructions. Open-ended or highly complex tasks might be
|
| 376 |
+
challenging.
|
| 377 |
+
- A model's performance can be influenced by the amount of context
|
| 378 |
+
provided (longer context generally leads to better outputs, up to a
|
| 379 |
+
certain point).
|
| 380 |
+
- Language Ambiguity and Nuance
|
| 381 |
+
- Natural language is inherently complex. Models might struggle
|
| 382 |
+
to grasp subtle nuances, sarcasm, or figurative language.
|
| 383 |
+
- Factual Accuracy
|
| 384 |
+
- Models generate responses based on information they learned
|
| 385 |
+
from their training datasets, but they are not knowledge bases. They
|
| 386 |
+
may generate incorrect or outdated factual statements.
|
| 387 |
+
- Common Sense
|
| 388 |
+
- Models rely on statistical patterns in language. They might
|
| 389 |
+
lack the ability to apply common sense reasoning in certain situations.
|
| 390 |
+
|
| 391 |
+
### Ethical Considerations and Risks
|
| 392 |
+
|
| 393 |
+
The development of generative models raises several ethical concerns. In
|
| 394 |
+
creating an open model, we have carefully considered the following:
|
| 395 |
+
|
| 396 |
+
- Bias and Fairness
|
| 397 |
+
- Generative models trained on large-scale, real-world text and image data
|
| 398 |
+
can reflect socio-cultural biases embedded in the training material.
|
| 399 |
+
These models underwent careful scrutiny, input data pre-processing
|
| 400 |
+
described and posterior evaluations reported in this card.
|
| 401 |
+
- Misinformation and Misuse
|
| 402 |
+
- Generative models can be misused to generate text that is
|
| 403 |
+
false, misleading, or harmful.
|
| 404 |
+
- Guidelines are provided for responsible use with the model, see the
|
| 405 |
+
[Responsible Generative AI Toolkit](https://ai.google.dev/responsible).
|
| 406 |
+
- Transparency and Accountability:
|
| 407 |
+
- This model card summarizes details on the models' architecture,
|
| 408 |
+
capabilities, limitations, and evaluation processes.
|
| 409 |
+
- A responsibly developed open model offers the opportunity to
|
| 410 |
+
share innovation by making generative model technology accessible to
|
| 411 |
+
developers and researchers across the AI ecosystem.
|
| 412 |
+
|
| 413 |
+
Risks identified and mitigations:
|
| 414 |
+
|
| 415 |
+
- **Perpetuation of biases**: It's encouraged to perform continuous monitoring
|
| 416 |
+
(using evaluation metrics, human review) and the exploration of de-biasing
|
| 417 |
+
techniques during model training, fine-tuning, and other use cases.
|
| 418 |
+
- **Generation of harmful content**: Mechanisms and guidelines for content
|
| 419 |
+
safety are essential. Developers are encouraged to exercise caution and
|
| 420 |
+
implement appropriate content safety safeguards based on their specific
|
| 421 |
+
product policies and application use cases.
|
| 422 |
+
- **Misuse for malicious purposes**: Technical limitations and developer
|
| 423 |
+
and end-user education can help mitigate against malicious applications of
|
| 424 |
+
generative models. Educational resources and reporting mechanisms for users
|
| 425 |
+
to flag misuse are provided. Prohibited uses of Gemma models are outlined
|
| 426 |
+
in the
|
| 427 |
+
[Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy).
|
| 428 |
+
- **Privacy violations**: Models were trained on data filtered for removal of
|
| 429 |
+
certain personal information and other sensitive data. Developers are
|
| 430 |
+
encouraged to adhere to privacy regulations with privacy-preserving
|
| 431 |
+
techniques.
|
| 432 |
+
|
| 433 |
+
### Benefits
|
| 434 |
+
|
| 435 |
+
At the time of release, this family of models provides high-performance open
|
| 436 |
+
generative model implementations designed from the ground up for responsible AI
|
| 437 |
+
development compared to similarly sized models.
|
| 438 |
+
|
| 439 |
+
Using the benchmark evaluation metrics described in this document, these models
|
| 440 |
+
have shown to provide superior performance to other, comparably-sized open model
|
| 441 |
+
alternatives.g
|
gemma-3n-E2B-it-litert-preview/gemma-3n-E2B-it-int4.task
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a7f544cfee68f579fabadb22aa9284faa4020a0f5358d0e15b49fdd4cefe4200
|
| 3 |
+
size 3136226711
|