TitleOS commited on
Commit
195910f
·
verified ·
1 Parent(s): 1dcd282

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -507
README.md CHANGED
@@ -1,532 +1,80 @@
1
  ---
2
- base_model: google/gemma-3-270m
3
- license: gemma
4
- tags:
5
- - gemma3
6
- - gemma
7
- - google
8
- pipeline_tag: text-generation
9
  library_name: transformers
10
- extra_gated_heading: Access Gemma on Hugging Face
11
- extra_gated_prompt: >-
12
- To access Gemma on Hugging Face, you’re required to review and agree to
13
- Google’s usage license. To do this, please ensure you’re logged in to Hugging
14
- Face and click below. Requests are processed immediately.
15
- extra_gated_button_content: Acknowledge license
 
 
 
 
16
  datasets:
17
  - TitleOS/Spark-Lightning-Synthetic-Textbooks
 
 
 
18
  ---
19
 
20
- # Gemma 3 model card
21
-
22
- **Model Page**: [Gemma](https://ai.google.dev/gemma/docs/core)
23
-
24
- **Resources and Technical Documentation**:
25
-
26
- * [Gemma 3 Technical Report][g3-tech-report]
27
- * [Responsible Generative AI Toolkit][rai-toolkit]
28
- * [Gemma on Kaggle][kaggle-gemma]
29
- * [Gemma on Vertex Model Garden][vertex-mg-gemma3]
30
-
31
- **Terms of Use**: [Terms][terms]
32
-
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 3 models are multimodal, handling text and image input and generating text
44
- output, with open weights for both pre-trained variants and instruction-tuned
45
- variants. Gemma 3 has a large, 128K context window, multilingual support in over
46
- 140 languages, and is available in more sizes than previous versions. Gemma 3
47
- models are well-suited for a variety of text generation and image understanding
48
- tasks, including question answering, summarization, and reasoning. Their
49
- relatively small size makes it possible to deploy them in environments with
50
- limited resources such as laptops, desktops or your own cloud infrastructure,
51
- democratizing access to state of the art AI models and helping foster innovation
52
- for everyone.
53
-
54
- ### Inputs and outputs
55
-
56
- - **Input:**
57
- - Text string, such as a question, a prompt, or a document to be summarized
58
- - Images, normalized to 896 x 896 resolution and encoded to 256 tokens
59
- each, for the 4B, 12B, and 27B sizes.
60
- - Total input context of 128K tokens for the 4B, 12B, and 27B sizes, and
61
- 32K tokens for the 1B and 270M sizes.
62
-
63
- - **Output:**
64
- - Generated text in response to the input, such as an answer to a
65
- question, analysis of image content, or a summary of a document
66
- - Total output context up to 128K tokens for the 4B, 12B, and 27B sizes,
67
- and 32K tokens for the 1B and 270M sizes per request, subtracting the
68
- request input tokens
69
-
70
- ### Citation
71
-
72
- ```none
73
- @article{gemma_2025,
74
- title={Gemma 3},
75
- url={https://arxiv.org/abs/2503.19786},
76
- publisher={Google DeepMind},
77
- author={Gemma Team},
78
- year={2025}
79
- }
80
- ```
81
-
82
- ## Model Data
83
-
84
- Data used for model training and how the data was processed.
85
-
86
- ### Training Dataset
87
-
88
- These models were trained on a dataset of text data that includes a wide variety
89
- of sources. The 27B model was trained with 14 trillion tokens, the 12B model was
90
- trained with 12 trillion tokens, 4B model was trained with 4 trillion tokens,
91
- the 1B with 2 trillion tokens, and the 270M with 6 trillion tokens. The
92
- knowledge cutoff date for the training data was August 2024. Here are the key
93
- components:
94
-
95
- - Web Documents: A diverse collection of web text ensures the model is
96
- exposed to a broad range of linguistic styles, topics, and vocabulary. The
97
- training dataset includes content in over 140 languages.
98
- - Code: Exposing the model to code helps it to learn the syntax and
99
- patterns of programming languages, which improves its ability to generate
100
- code and understand code-related questions.
101
- - Mathematics: Training on mathematical text helps the model learn logical
102
- reasoning, symbolic representation, and to address mathematical queries.
103
- - Images: A wide range of images enables the model to perform image
104
- analysis and visual data extraction tasks.
105
-
106
- The combination of these diverse data sources is crucial for training a powerful
107
- multimodal model that can handle a wide variety of different tasks and data
108
- formats.
109
-
110
- ### Data Preprocessing
111
-
112
- Here are the key data cleaning and filtering methods applied to the training
113
- data:
114
-
115
- - CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering
116
- was applied at multiple stages in the data preparation process to ensure
117
- the exclusion of harmful and illegal content.
118
- - Sensitive Data Filtering: As part of making Gemma pre-trained models
119
- safe and reliable, automated techniques were used to filter out certain
120
- personal information and other sensitive data from training sets.
121
- - Additional methods: Filtering based on content quality and safety in
122
- line with [our policies][safety-policies].
123
-
124
- ## Implementation Information
125
-
126
- Details about the model internals.
127
-
128
- ### Hardware
129
-
130
- Gemma was trained using [Tensor Processing Unit (TPU)][tpu] hardware (TPUv4p,
131
- TPUv5p and TPUv5e). Training vision-language models (VLMS) requires significant
132
- computational power. TPUs, designed specifically for matrix operations common in
133
- machine learning, offer several advantages in this domain:
134
-
135
- - Performance: TPUs are specifically designed to handle the massive
136
- computations involved in training VLMs. They can speed up training
137
- considerably compared to CPUs.
138
- - Memory: TPUs often come with large amounts of high-bandwidth memory,
139
- allowing for the handling of large models and batch sizes during training.
140
- This can lead to better model quality.
141
- - Scalability: TPU Pods (large clusters of TPUs) provide a scalable
142
- solution for handling the growing complexity of large foundation models.
143
- You can distribute training across multiple TPU devices for faster and more
144
- efficient processing.
145
- - Cost-effectiveness: In many scenarios, TPUs can provide a more
146
- cost-effective solution for training large models compared to CPU-based
147
- infrastructure, especially when considering the time and resources saved
148
- due to faster training.
149
- - These advantages are aligned with
150
- [Google's commitments to operate sustainably][sustainability].
151
-
152
- ### Software
153
-
154
- Training was done using [JAX][jax] and [ML Pathways][ml-pathways].
155
-
156
- JAX allows researchers to take advantage of the latest generation of hardware,
157
- including TPUs, for faster and more efficient training of large models. ML
158
- Pathways is Google's latest effort to build artificially intelligent systems
159
- capable of generalizing across multiple tasks. This is specially suitable for
160
- foundation models, including large language models like these ones.
161
-
162
- Together, JAX and ML Pathways are used as described in the
163
- [paper about the Gemini family of models][gemini-2-paper]; *"the 'single
164
- controller' programming model of Jax and Pathways allows a single Python
165
- process to orchestrate the entire training run, dramatically simplifying the
166
- development workflow."*
167
-
168
- ## Evaluation
169
-
170
- Model evaluation metrics and results.
171
-
172
- ### Benchmark Results
173
-
174
- These models were evaluated against a large collection of different datasets and
175
- metrics to cover different aspects of text generation. Evaluation results marked
176
- with **IT** are for instruction-tuned models. Evaluation results marked with
177
- **PT** are for pre-trained models.
178
-
179
- #### Gemma 3 270M
180
-
181
- | **Benchmark** | **n-shot** | **Gemma 3 PT 270M** |
182
- | :------------------------ | :-----------: | ------------------: |
183
- | [HellaSwag][hellaswag] | 10-shot | 40.9 |
184
- | [BoolQ][boolq] | 0-shot | 61.4 |
185
- | [PIQA][piqa] | 0-shot | 67.7 |
186
- | [TriviaQA][triviaqa] | 5-shot | 15.4 |
187
- | [ARC-c][arc] | 25-shot | 29.0 |
188
- | [ARC-e][arc] | 0-shot | 57.7 |
189
- | [WinoGrande][winogrande] | 5-shot | 52.0 |
190
-
191
- [hellaswag]: https://arxiv.org/abs/1905.07830
192
- [boolq]: https://arxiv.org/abs/1905.10044
193
- [piqa]: https://arxiv.org/abs/1911.11641
194
- [triviaqa]: https://arxiv.org/abs/1705.03551
195
- [arc]: https://arxiv.org/abs/1911.01547
196
- [winogrande]: https://arxiv.org/abs/1907.10641
197
-
198
- | **Benchmark** | **n-shot** | **Gemma 3 IT 270m** |
199
- | :------------------------ | :-----------: | ------------------: |
200
- | [HellaSwag][hellaswag] | 0-shot | 37.7 |
201
- | [PIQA][piqa] | 0-shot | 66.2 |
202
- | [ARC-c][arc] | 0-shot | 28.2 |
203
- | [WinoGrande][winogrande] | 0-shot | 52.3 |
204
- | [BIG-Bench Hard][bbh] | few-shot | 26.7 |
205
- | [IF Eval][ifeval] | 0-shot | 51.2 |
206
-
207
- [hellaswag]: https://arxiv.org/abs/1905.07830
208
- [piqa]: https://arxiv.org/abs/1911.11641
209
- [arc]: https://arxiv.org/abs/1911.01547
210
- [winogrande]: https://arxiv.org/abs/1907.10641
211
- [bbh]: https://paperswithcode.com/dataset/bbh
212
- [bbh]: https://paperswithcode.com/dataset/bbh
213
- [ifeval]: https://arxiv.org/abs/2311.07911
214
-
215
- #### Gemma 3 1B, 4B, 12B & 27B
216
-
217
- ##### Reasoning and factuality
218
-
219
- | Benchmark | n-shot | Gemma 3 IT 1B | Gemma 3 IT 4B | Gemma 3 IT 12B | Gemma 3 IT 27B |
220
- |--------------------------------|--------|:-------------:|:-------------:|:--------------:|:--------------:|
221
- | [GPQA][gpqa] Diamond | 0-shot | 19.2 | 30.8 | 40.9 | 42.4 |
222
- | [SimpleQA][simpleqa] | 0-shot | 2.2 | 4.0 | 6.3 | 10.0 |
223
- | [FACTS Grounding][facts-grdg] | - | 36.4 | 70.1 | 75.8 | 74.9 |
224
- | [BIG-Bench Hard][bbh] | 0-shot | 39.1 | 72.2 | 85.7 | 87.6 |
225
- | [BIG-Bench Extra Hard][bbeh] | 0-shot | 7.2 | 11.0 | 16.3 | 19.3 |
226
- | [IFEval][ifeval] | 0-shot | 80.2 | 90.2 | 88.9 | 90.4 |
227
-
228
- | Benchmark | n-shot | Gemma 3 PT 1B | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
229
- | ------------------------------ |----------|:--------------:|:-------------:|:--------------:|:--------------:|
230
- | [HellaSwag][hellaswag] | 10-shot | 62.3 | 77.2 | 84.2 | 85.6 |
231
- | [BoolQ][boolq] | 0-shot | 63.2 | 72.3 | 78.8 | 82.4 |
232
- | [PIQA][piqa] | 0-shot | 73.8 | 79.6 | 81.8 | 83.3 |
233
- | [SocialIQA][socialiqa] | 0-shot | 48.9 | 51.9 | 53.4 | 54.9 |
234
- | [TriviaQA][triviaqa] | 5-shot | 39.8 | 65.8 | 78.2 | 85.5 |
235
- | [Natural Questions][naturalq] | 5-shot | 9.48 | 20.0 | 31.4 | 36.1 |
236
- | [ARC-c][arc] | 25-shot | 38.4 | 56.2 | 68.9 | 70.6 |
237
- | [ARC-e][arc] | 0-shot | 73.0 | 82.4 | 88.3 | 89.0 |
238
- | [WinoGrande][winogrande] | 5-shot | 58.2 | 64.7 | 74.3 | 78.8 |
239
- | [BIG-Bench Hard][bbh] | few-shot | 28.4 | 50.9 | 72.6 | 77.7 |
240
- | [DROP][drop] | 1-shot | 42.4 | 60.1 | 72.2 | 77.2 |
241
-
242
- [gpqa]: https://arxiv.org/abs/2311.12022
243
- [simpleqa]: https://arxiv.org/abs/2411.04368
244
- [facts-grdg]: https://goo.gle/FACTS_paper
245
- [bbeh]: https://github.com/google-deepmind/bbeh
246
- [ifeval]: https://arxiv.org/abs/2311.07911
247
- [hellaswag]: https://arxiv.org/abs/1905.07830
248
- [boolq]: https://arxiv.org/abs/1905.10044
249
- [piqa]: https://arxiv.org/abs/1911.11641
250
- [socialiqa]: https://arxiv.org/abs/1904.09728
251
- [triviaqa]: https://arxiv.org/abs/1705.03551
252
- [naturalq]: https://github.com/google-research-datasets/natural-questions
253
- [arc]: https://arxiv.org/abs/1911.01547
254
- [winogrande]: https://arxiv.org/abs/1907.10641
255
- [bbh]: https://paperswithcode.com/dataset/bbh
256
- [drop]: https://arxiv.org/abs/1903.00161
257
-
258
- ##### STEM and code
259
-
260
- | Benchmark | n-shot | Gemma 3 IT 1B | Gemma 3 IT 4B | Gemma 3 IT 12B | Gemma 3 IT 27B |
261
- |----------------------------|--------|:-------------:|:-------------:|:--------------:|:--------------:|
262
- | [MMLU][mmlu] (Pro) | 0-shot | 14.7 | 43.6 | 60.6 | 67.5 |
263
- | [LiveCodeBench][lcb] | 0-shot | 1.9 | 12.6 | 24.6 | 29.7 |
264
- | [Bird-SQL][bird-sql] (dev) | - | 6.4 | 36.3 | 47.9 | 54.4 |
265
- | [Math][math] | 0-shot | 48.0 | 75.6 | 83.8 | 89.0 |
266
- | HiddenMath | 0-shot | 15.8 | 43.0 | 54.5 | 60.3 |
267
- | [MBPP][mbpp] | 3-shot | 35.2 | 63.2 | 73.0 | 74.4 |
268
- | [HumanEval][humaneval] | 0-shot | 41.5 | 71.3 | 85.4 | 87.8 |
269
- | [Natural2Code][nat2code] | 0-shot | 56.0 | 70.3 | 80.7 | 84.5 |
270
- | [GSM8K][gsm8k] | 0-shot | 62.8 | 89.2 | 94.4 | 95.9 |
271
-
272
- | Benchmark | n-shot | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
273
- | ------------------------------ |----------------|:-------------:|:--------------:|:--------------:|
274
- | [MMLU][mmlu] | 5-shot | 59.6 | 74.5 | 78.6 |
275
- | [MMLU][mmlu] (Pro COT) | 5-shot | 29.2 | 45.3 | 52.2 |
276
- | [AGIEval][agieval] | 3-5-shot | 42.1 | 57.4 | 66.2 |
277
- | [MATH][math] | 4-shot | 24.2 | 43.3 | 50.0 |
278
- | [GSM8K][gsm8k] | 8-shot | 38.4 | 71.0 | 82.6 |
279
- | [GPQA][gpqa] | 5-shot | 15.0 | 25.4 | 24.3 |
280
- | [MBPP][mbpp] | 3-shot | 46.0 | 60.4 | 65.6 |
281
- | [HumanEval][humaneval] | 0-shot | 36.0 | 45.7 | 48.8 |
282
-
283
- [mmlu]: https://arxiv.org/abs/2009.03300
284
- [agieval]: https://arxiv.org/abs/2304.06364
285
- [math]: https://arxiv.org/abs/2103.03874
286
- [gsm8k]: https://arxiv.org/abs/2110.14168
287
- [gpqa]: https://arxiv.org/abs/2311.12022
288
- [mbpp]: https://arxiv.org/abs/2108.07732
289
- [humaneval]: https://arxiv.org/abs/2107.03374
290
- [lcb]: https://arxiv.org/abs/2403.07974
291
- [bird-sql]: https://arxiv.org/abs/2305.03111
292
- [nat2code]: https://arxiv.org/abs/2405.04520
293
-
294
- #### Multilingual
295
-
296
- | Benchmark | n-shot | Gemma 3 IT 1B | Gemma 3 IT 4B | Gemma 3 IT 12B | Gemma 3 IT 27B |
297
- |--------------------------------------|--------|:-------------:|:-------------:|:--------------:|:--------------:|
298
- | [Global-MMLU-Lite][global-mmlu-lite] | 0-shot | 34.2 | 54.5 | 69.5 | 75.1 |
299
- | [ECLeKTic][eclektic] | 0-shot | 1.4 | 4.6 | 10.3 | 16.7 |
300
- | [WMT24++][wmt24pp] | 0-shot | 35.9 | 46.8 | 51.6 | 53.4 |
301
-
302
- | Benchmark | Gemma 3 PT 1B | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
303
- | ------------------------------------ |:-------------:|:-------------:|:--------------:|:--------------:|
304
- | [MGSM][mgsm] | 2.04 | 34.7 | 64.3 | 74.3 |
305
- | [Global-MMLU-Lite][global-mmlu-lite] | 24.9 | 57.0 | 69.4 | 75.7 |
306
- | [WMT24++][wmt24pp] (ChrF) | 36.7 | 48.4 | 53.9 | 55.7 |
307
- | [FloRes][flores] | 29.5 | 39.2 | 46.0 | 48.8 |
308
- | [XQuAD][xquad] (all) | 43.9 | 68.0 | 74.5 | 76.8 |
309
- | [ECLeKTic][eclektic] | 4.69 | 11.0 | 17.2 | 24.4 |
310
- | [IndicGenBench][indicgenbench] | 41.4 | 57.2 | 61.7 | 63.4 |
311
-
312
- [mgsm]: https://arxiv.org/abs/2210.03057
313
- [flores]: https://arxiv.org/abs/2106.03193
314
- [xquad]: https://arxiv.org/abs/1910.11856v3
315
- [global-mmlu-lite]: https://huggingface.co/datasets/CohereForAI/Global-MMLU-Lite
316
- [wmt24pp]: https://arxiv.org/abs/2502.12404v1
317
- [eclektic]: https://arxiv.org/abs/2502.21228
318
- [indicgenbench]: https://arxiv.org/abs/2404.16816
319
-
320
- ##### Multimodal
321
-
322
- | Benchmark | Gemma 3 IT 4B | Gemma 3 IT 12B | Gemma 3 IT 27B |
323
- |-----------------------------------|:-------------:|:--------------:|:--------------:|
324
- | [MMMU][mmmu] (val) | 48.8 | 59.6 | 64.9 |
325
- | [DocVQA][docvqa] | 75.8 | 87.1 | 86.6 |
326
- | [InfoVQA][info-vqa] | 50.0 | 64.9 | 70.6 |
327
- | [TextVQA][textvqa] | 57.8 | 67.7 | 65.1 |
328
- | [AI2D][ai2d] | 74.8 | 84.2 | 84.5 |
329
- | [ChartQA][chartqa] | 68.8 | 75.7 | 78.0 |
330
- | [VQAv2][vqav2] (val) | 62.4 | 71.6 | 71.0 |
331
- | [MathVista][mathvista] (testmini) | 50.0 | 62.9 | 67.6 |
332
-
333
- | Benchmark | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
334
- | ------------------------------ |:-------------:|:--------------:|:--------------:|
335
- | [COCOcap][coco-cap] | 102 | 111 | 116 |
336
- | [DocVQA][docvqa] (val) | 72.8 | 82.3 | 85.6 |
337
- | [InfoVQA][info-vqa] (val) | 44.1 | 54.8 | 59.4 |
338
- | [MMMU][mmmu] (pt) | 39.2 | 50.3 | 56.1 |
339
- | [TextVQA][textvqa] (val) | 58.9 | 66.5 | 68.6 |
340
- | [RealWorldQA][realworldqa] | 45.5 | 52.2 | 53.9 |
341
- | [ReMI][remi] | 27.3 | 38.5 | 44.8 |
342
- | [AI2D][ai2d] | 63.2 | 75.2 | 79.0 |
343
- | [ChartQA][chartqa] | 63.6 | 74.7 | 76.3 |
344
- | [VQAv2][vqav2] | 63.9 | 71.2 | 72.9 |
345
- | [BLINK][blinkvqa] | 38.0 | 35.9 | 39.6 |
346
- | [OKVQA][okvqa] | 51.0 | 58.7 | 60.2 |
347
- | [TallyQA][tallyqa] | 42.5 | 51.8 | 54.3 |
348
- | [SpatialSense VQA][ss-vqa] | 50.9 | 60.0 | 59.4 |
349
- | [CountBenchQA][countbenchqa] | 26.1 | 17.8 | 68.0 |
350
-
351
- [coco-cap]: https://cocodataset.org/#home
352
- [docvqa]: https://www.docvqa.org/
353
- [info-vqa]: https://arxiv.org/abs/2104.12756
354
- [mmmu]: https://arxiv.org/abs/2311.16502
355
- [textvqa]: https://textvqa.org/
356
- [realworldqa]: https://paperswithcode.com/dataset/realworldqa
357
- [remi]: https://arxiv.org/html/2406.09175v1
358
- [ai2d]: https://allenai.org/data/diagrams
359
- [chartqa]: https://arxiv.org/abs/2203.10244
360
- [vqav2]: https://visualqa.org/index.html
361
- [blinkvqa]: https://arxiv.org/abs/2404.12390
362
- [okvqa]: https://okvqa.allenai.org/
363
- [tallyqa]: https://arxiv.org/abs/1810.12440
364
- [ss-vqa]: https://arxiv.org/abs/1908.02660
365
- [countbenchqa]: https://github.com/google-research/big_vision/blob/main/big_vision/datasets/countbenchqa/
366
- [mathvista]: https://arxiv.org/abs/2310.02255
367
-
368
- ## Ethics and Safety
369
-
370
- Ethics and safety evaluation approach and results.
371
-
372
- ### Evaluation Approach
373
-
374
- Our evaluation methods include structured evaluations and internal red-teaming
375
- testing of relevant content policies. Red-teaming was conducted by a number of
376
- different teams, each with different goals and human evaluation metrics. These
377
- models were evaluated against a number of different categories relevant to
378
- ethics and safety, including:
379
-
380
- - **Child Safety**: Evaluation of text-to-text and image to text prompts
381
- covering child safety policies, including child sexual abuse and
382
- exploitation.
383
- - **Content Safety:** Evaluation of text-to-text and image to text prompts
384
- covering safety policies including, harassment, violence and gore, and hate
385
- speech.
386
- - **Representational Harms**: Evaluation of text-to-text and image to text
387
- prompts covering safety policies including bias, stereotyping, and harmful
388
- associations or inaccuracies.
389
 
390
- In addition to development level evaluations, we conduct "assurance
391
- evaluations" which are our 'arms-length' internal evaluations for responsibility
392
- governance decision making. They are conducted separately from the model
393
- development team, to inform decision making about release. High level findings
394
- are fed back to the model team, but prompt sets are held-out to prevent
395
- overfitting and preserve the results' ability to inform decision making.
396
- Assurance evaluation results are reported to our Responsibility & Safety Council
397
- as part of release review.
398
 
399
- ### Evaluation Results
400
 
401
- For all areas of safety testing, we saw major improvements in the categories of
402
- child safety, content safety, and representational harms relative to previous
403
- Gemma models. All testing was conducted without safety filters to evaluate the
404
- model capabilities and behaviors. For both text-to-text and image-to-text, and
405
- across all model sizes, the model produced minimal policy violations, and showed
406
- significant improvements over previous Gemma models' performance with respect
407
- to ungrounded inferences. A limitation of our evaluations was they included only
408
- English language prompts.
409
 
410
- ## Usage and Limitations
 
 
 
 
 
411
 
412
- These models have certain limitations that users should be aware of.
413
 
414
- ### Intended Usage
415
 
416
- Open vision-language models (VLMs) models have a wide range of applications
417
- across various industries and domains. The following list of potential uses is
418
- not comprehensive. The purpose of this list is to provide contextual information
419
- about the possible use-cases that the model creators considered as part of model
420
- training and development.
421
 
422
- - Content Creation and Communication
423
- - Text Generation: These models can be used to generate creative text
424
- formats such as poems, scripts, code, marketing copy, and email drafts.
425
- - Chatbots and Conversational AI: Power conversational interfaces
426
- for customer service, virtual assistants, or interactive applications.
427
- - Text Summarization: Generate concise summaries of a text corpus,
428
- research papers, or reports.
429
- - Image Data Extraction: These models can be used to extract,
430
- interpret, and summarize visual data for text communications.
431
- - Research and Education
432
- - Natural Language Processing (NLP) and VLM Research: These
433
- models can serve as a foundation for researchers to experiment with VLM
434
- and NLP techniques, develop algorithms, and contribute to the
435
- advancement of the field.
436
- - Language Learning Tools: Support interactive language learning
437
- experiences, aiding in grammar correction or providing writing practice.
438
- - Knowledge Exploration: Assist researchers in exploring large
439
- bodies of text by generating summaries or answering questions about
440
- specific topics.
441
 
442
- ### Limitations
 
 
 
443
 
444
- - Training Data
445
- - The quality and diversity of the training data significantly
446
- influence the model's capabilities. Biases or gaps in the training data
447
- can lead to limitations in the model's responses.
448
- - The scope of the training dataset determines the subject areas
449
- the model can handle effectively.
450
- - Context and Task Complexity
451
- - Models are better at tasks that can be framed with clear
452
- prompts and instructions. Open-ended or highly complex tasks might be
453
- challenging.
454
- - A model's performance can be influenced by the amount of context
455
- provided (longer context generally leads to better outputs, up to a
456
- certain point).
457
- - Language Ambiguity and Nuance
458
- - Natural language is inherently complex. Models might struggle
459
- to grasp subtle nuances, sarcasm, or figurative language.
460
- - Factual Accuracy
461
- - Models generate responses based on information they learned
462
- from their training datasets, but they are not knowledge bases. They
463
- may generate incorrect or outdated factual statements.
464
- - Common Sense
465
- - Models rely on statistical patterns in language. They might
466
- lack the ability to apply common sense reasoning in certain situations.
467
 
468
- ### Ethical Considerations and Risks
469
 
470
- The development of vision-language models (VLMs) raises several ethical
471
- concerns. In creating an open model, we have carefully considered the following:
 
 
472
 
473
- - Bias and Fairness
474
- - VLMs trained on large-scale, real-world text and image data can
475
- reflect socio-cultural biases embedded in the training material. These
476
- models underwent careful scrutiny, input data pre-processing described
477
- and posterior evaluations reported in this card.
478
- - Misinformation and Misuse
479
- - VLMs can be misused to generate text that is false, misleading,
480
- or harmful.
481
- - Guidelines are provided for responsible use with the model, see the
482
- [Responsible Generative AI Toolkit][rai-toolkit].
483
- - Transparency and Accountability:
484
- - This model card summarizes details on the models' architecture,
485
- capabilities, limitations, and evaluation processes.
486
- - A responsibly developed open model offers the opportunity to
487
- share innovation by making VLM technology accessible to developers and
488
- researchers across the AI ecosystem.
489
 
490
- Risks identified and mitigations:
 
491
 
492
- - **Perpetuation of biases**: It's encouraged to perform continuous
493
- monitoring (using evaluation metrics, human review) and the exploration of
494
- de-biasing techniques during model training, fine-tuning, and other use
495
- cases.
496
- - **Generation of harmful content**: Mechanisms and guidelines for content
497
- safety are essential. Developers are encouraged to exercise caution and
498
- implement appropriate content safety safeguards based on their specific
499
- product policies and application use cases.
500
- - **Misuse for malicious purposes**: Technical limitations and developer
501
- and end-user education can help mitigate against malicious applications of
502
- VLMs. Educational resources and reporting mechanisms for users to flag
503
- misuse are provided. Prohibited uses of Gemma models are outlined in the
504
- [Gemma Prohibited Use Policy][prohibited-use].
505
- - **Privacy violations**: Models were trained on data filtered for removal
506
- of certain personal information and other sensitive data. Developers are
507
- encouraged to adhere to privacy regulations with privacy-preserving
508
- techniques.
509
 
510
- ### Benefits
 
511
 
512
- At the time of release, this family of models provides high-performance open
513
- vision-language model implementations designed from the ground up for
514
- responsible AI development compared to similarly sized models.
 
 
 
515
 
516
- Using the benchmark evaluation metrics described in this document, these models
517
- have shown to provide superior performance to other, comparably-sized open model
518
- alternatives.
519
 
520
- [g3-tech-report]: https://arxiv.org/abs/2503.19786
521
- [rai-toolkit]: https://ai.google.dev/responsible
522
- [kaggle-gemma]: https://www.kaggle.com/models/google/gemma-3
523
- [vertex-mg-gemma3]: https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/gemma3
524
- [terms]: https://ai.google.dev/gemma/terms
525
- [safety-policies]: https://ai.google/static/documents/ai-responsibility-update-published-february-2025.pdf
526
- [prohibited-use]: https://ai.google.dev/gemma/prohibited_use_policy
527
- [tpu]: https://cloud.google.com/tpu/docs/intro-to-tpu
528
- [sustainability]: https://sustainability.google/operating-sustainably/
529
- [jax]: https://github.com/jax-ml/jax
530
- [ml-pathways]: https://blog.google/technology/ai/introducing-pathways-next-generation-ai-architecture/
531
- [sustainability]: https://sustainability.google/operating-sustainably/
532
- [gemini-2-paper]: https://arxiv.org/abs/2312.11805
 
1
  ---
2
+ license: mpl-2.0
 
 
 
 
 
 
3
  library_name: transformers
4
+ tags:
5
+ - gemma-3
6
+ - synthetic-data
7
+ - textbooks
8
+ - distillation
9
+ - utility
10
+ - summarization
11
+ - lightning
12
+ - conversational
13
+ base_model: google/gemma-3-270m
14
  datasets:
15
  - TitleOS/Spark-Lightning-Synthetic-Textbooks
16
+ language:
17
+ - en
18
+ pipeline_tag: text-generation
19
  ---
20
 
21
+ # Spark-270M
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
+ **Spark-270M** is a highly compact, utility-focused language model with **270 million parameters**. It is a fine-tune of Google's [Gemma 3 270M](https://huggingface.co/google/gemma-3-270m), designed to punch significantly above its weight class by leveraging high-quality synthetic data distillation.
 
 
 
 
 
 
 
24
 
25
+ The model functions as a "dense information engine"—specializing in generating concise title summaries, search engine queries, and logical follow-up questioning—while retaining the creative conversational flair inherited from its teacher model's lineage.
26
 
27
+ ## Model Details
 
 
 
 
 
 
 
28
 
29
+ - **Model Name:** Spark-270M
30
+ - **Base Architecture:** [Google Gemma 3 270M](https://huggingface.co/google/gemma-3-270m)
31
+ - **Parameters:** 270M active parameters
32
+ - **Context Window:** 32k tokens
33
+ - **Teacher Model:** Lightning-1.7B (Custom model fine-tuned on Hermes 3)
34
+ - **Training Type:** Synthetic "Textbook" Distillation (SFT)
35
 
36
+ ## 📚 Training Methodology: "Textbooks Are All You Need"
37
 
38
+ Spark-270M was trained using a distinct data pipeline inspired by the *Textbooks Are All You Need* (Microsoft Phi) research paper.
39
 
40
+ Instead of training on raw web scrapes, Spark-270M was fine-tuned exclusively on a series of **synthetic textbooks** generated by a larger parent model, **Lightning-1.7B**.
 
 
 
 
41
 
42
+ ### The Teacher: Lightning-1.7B
43
+ The data generator, Lightning-1.7B, was itself fine-tuned on the [Hermes 3 dataset](https://huggingface.co/nousresearch/hermes-3-llama-3.1-8b). This lineage allows Spark-270M to inherit specific behavioral traits from Hermes 3—namely creativity, steerability, and a refusal to be "boring"—despite being distilled into a rigid textbook format.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
+ The synthetic data focused on:
46
+ 1. **High-density reasoning chains:** Explaining complex topics in compressed formats.
47
+ 2. **Utility Tasks:** Converting conversational fluff into actionable queries.
48
+ 3. **Socratic Dialogue:** Modeling inquisitive follow-up questioning.
49
 
50
+ ## 🛠️ Intended Use & Capabilities
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
 
52
+ Spark-270M is designed to be a lightweight **Utility Model**. It is ideal for edge devices, rapid prototyping, or functioning as a specific "node" in a larger agentic system (e.g., the summarizer node or the query-generator node).
53
 
54
+ ### Primary Capabilities
55
+ * **Dense Title Summarization:** Converting long conversation threads into information-dense, short titles or abstracts.
56
+ * **Search Query Generation:** Formulating precise, keyword-rich search queries based on vague user input.
57
+ * **Proactive Questioning:** Generating relevant follow-up questions to clarify user intent or deepen a topic.
58
 
59
+ ## 💻 Example Usage
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
+ ```python
62
+ from transformers import AutoTokenizer, AutoModelForCausalLM
63
 
64
+ model_id = "TitleOS/Spark-270M"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
67
+ model = AutoModelForCausalLM.from_pretrained(model_id, device_map="auto")
68
 
69
+ # Example: Generating a search query from a user problem
70
+ input_text = """
71
+ User: I need to fix my sink, it's leaking from the bottom pipe where the U-shape thing is.
72
+ Task: Generate 3 search engine queries for this problem.
73
+ Response:
74
+ """
75
 
76
+ input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
 
 
77
 
78
+ outputs = model.generate(**input_ids, max_new_tokens=128)
79
+ print(tokenizer.d ecode(outputs[0]))
80
+