sweelol commited on
Commit
1ae7f73
·
verified ·
1 Parent(s): e9764e1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +319 -13
README.md CHANGED
@@ -1,24 +1,14 @@
 
1
  ---
2
  license: apache-2.0
3
  tags:
4
  - sweelol-ai
5
  - text-generation
6
- - gemma-3-270m
7
  - distillation
8
  - pruning
9
  - lora
10
  - prompt-tuning
11
- - code
12
- datasets:
13
- - databricks/databricks-dolly-15k
14
- language:
15
- - en
16
- metrics:
17
- - accuracy
18
- base_model:
19
- - google/gemma-3-270m
20
- pipeline_tag: text-generation
21
- library_name: transformers
22
  ---
23
 
24
  # {model_name}
@@ -35,4 +25,320 @@ This model is part of the **Sweelol AI Hub** collection, resulting from experime
35
  * **Fine-Tuning Method:** {method_description}
36
  * **Purpose:** {purpose}
37
 
38
- This is a placeholder README. A detailed model card with full results and usage instructions will be added shortly.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
  ---
3
  license: apache-2.0
4
  tags:
5
  - sweelol-ai
6
  - text-generation
7
+ - gemma
8
  - distillation
9
  - pruning
10
  - lora
11
  - prompt-tuning
 
 
 
 
 
 
 
 
 
 
 
12
  ---
13
 
14
  # {model_name}
 
25
  * **Fine-Tuning Method:** {method_description}
26
  * **Purpose:** {purpose}
27
 
28
+ This is a placeholder README. A detailed model card with full results and usage instructions will be added shortly.
29
+
30
+ ## Evaluation Results
31
+
32
+ This table compares the performance of this **Finetuned-Pruned** model against the original, un-tuned `google/gemma-3-270m` base model.
33
+
34
+ | Benchmark Task | Sweelol Finetuned-Pruned | Baseline (Gemma-3-270m) | Change |
35
+ | :--- | :--- | :--- | :--- |
36
+ | **Average MMLU (5 tasks)** | 25.18% | 24.88% | **+0.30%** |
37
+ | HellaSwag (Common Sense) | 29.50% | 43.50% | -14.00% |
38
+ | ---------------------------------- | ---------- | ---------- | -------- |
39
+ | *MMLU Sub-task Breakdown:* | | | |
40
+ | MMLU - Formal Logic | **28.57%** | 25.40% | **+3.17%** |
41
+ | MMLU - High School Computer Science | **25.00%** | 24.00% | **+1.00%** |
42
+ | MMLU - Professional Law | 25.00% | 27.00% | -2.00% |
43
+ | MMLU - Abstract Algebra | 22.00% | 22.00% | 0.00% |
44
+ | MMLU - High School Mathematics | 21.00% | 26.00% | -5.00% |
45
+
46
+ #### Summary of Findings
47
+ Fine-tuning the pruned model resulted in a solid overall improvement on MMLU, particularly in formal logic. However, like the pruned-only baseline, it suffered a significant drop in common-sense reasoning (HellaSwag).
48
+
49
+
50
+ ## Evaluation
51
+
52
+ ### Testing Data & Metrics
53
+
54
+ All models were evaluated on a comprehensive suite of tasks from the `lm-evaluation-harness`, including 5 diverse subsets of **MMLU** (for academic reasoning) and **HellaSwag** (for common-sense reasoning). The primary metric is zero-shot accuracy on a 200-sample subset of each task's test split.
55
+
56
+ ### Results
57
+
58
+ This table summarizes the final benchmark scores for all models created in the **Sweelol AI Comparative Study**. All fine-tuned models were trained on a subset of the `databricks/databricks-dolly-15k` dataset.
59
+
60
+ | Model | Technique | Average MMLU | HellaSwag | MMLU CompSci | MMLU Logic | MMLU Law | MMLU Math | MMLU Algebra |
61
+ | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- | :--- |
62
+ | **Baseline** | *(Pre-trained)* | 24.88% | **43.50%** | 24.00% | 25.40% | **27.00%** | **26.00%** | 22.00% |
63
+ | **Pruned-Baseline**| Pruning | **26.17%** | 29.50% | **28.00%** | **29.37%** | 26.00% | 24.50% | **23.00%** |
64
+ | **Prompt-Tune** | PEFT | 25.77% | 39.00% | 27.00% | **29.37%** | **27.50%** | 22.00% | **23.00%** |
65
+ | **Finetuned-Pruned**| Pruning + FT | 25.18% | 29.50% | 25.00% | 28.57% | 25.00% | 21.00% | 22.00% |
66
+ | **LoRA** | PEFT | 24.60% | 26.00% | 25.00% | 28.57% | 25.00% | 21.00% | 22.00% |
67
+ | **KD-Pruned** | Distillation | 23.98% | 33.00% | 26.00% | 25.40% | 25.00% | 21.50% | 22.00% |
68
+ | **Full-Finetune** | Full FT | 22.60% | 39.00% | 26.00% | 23.02% | 23.50% | 21.50% | 19.00% |
69
+
70
+ #### Summary of Key Findings
71
+
72
+ 1. **Pruning is a Superpower for Logic:** The `Pruned-Baseline` model, with no fine-tuning, was the **undisputed champion on average MMLU performance**. It achieved the highest scores in Formal Logic and Computer Science, suggesting that pruning enhances the model's core, pre-trained reasoning abilities.
73
+
74
+ 2. **Prompt Tuning is the Efficiency King:** The `Prompt-Tune` model was the second-best performer on MMLU and retained strong common-sense performance (HellaSwag). This makes it the most efficient and effective overall technique, delivering top-tier results with minimal training.
75
+
76
+ 3. **The "Alignment Tax" is Real:** Both `Full-Finetune` and `KD-Pruned` models, while trained on instruction data, showed a significant drop in performance on the MMLU reasoning tasks compared to the baseline. This is a classic example of the "alignment tax," where teaching a model to be a helpful assistant can sometimes dilute its raw, academic reasoning capabilities.
77
+
78
+ 4. **Common Sense is Fragile:** Techniques that heavily modified the model's structure or weights (`Pruning`, `LoRA`) resulted in a significant drop in performance on the `HellaSwag` common-sense benchmark. The `Baseline` model remains the champion of common sense.
79
+
80
+ This comprehensive benchmark provides a clear, data-driven guide for selecting the right optimization technique for a given task.
81
+
82
+ # Gemma 3 model card
83
+
84
+ **Model Page**: [Gemma](https://ai.google.dev/gemma/docs/core)
85
+
86
+ **Resources and Technical Documentation**:
87
+
88
+ * [Gemma 3 Technical Report][g3-tech-report]
89
+ * [Responsible Generative AI Toolkit][rai-toolkit]
90
+ * [Gemma on Kaggle][kaggle-gemma]
91
+ * [Gemma on Vertex Model Garden][vertex-mg-gemma3]
92
+
93
+ **Terms of Use**: [Terms][terms]
94
+
95
+ **Authors**: Google DeepMind
96
+
97
+ ## Model Information
98
+
99
+ Summary description and brief definition of inputs and outputs.
100
+
101
+ ### Description
102
+
103
+ Gemma is a family of lightweight, state-of-the-art open models from Google,
104
+ built from the same research and technology used to create the Gemini models.
105
+ Gemma 3 models are multimodal, handling text and image input and generating text
106
+ output, with open weights for both pre-trained variants and instruction-tuned
107
+ variants. Gemma 3 has a large, 128K context window, multilingual support in over
108
+ 140 languages, and is available in more sizes than previous versions. Gemma 3
109
+ models are well-suited for a variety of text generation and image understanding
110
+ tasks, including question answering, summarization, and reasoning. Their
111
+ relatively small size makes it possible to deploy them in environments with
112
+ limited resources such as laptops, desktops or your own cloud infrastructure,
113
+ democratizing access to state of the art AI models and helping foster innovation
114
+ for everyone.
115
+
116
+ ### Inputs and outputs
117
+
118
+ - **Input:**
119
+ - Text string, such as a question, a prompt, or a document to be summarized
120
+ - Images, normalized to 896 x 896 resolution and encoded to 256 tokens
121
+ each, for the 4B, 12B, and 27B sizes.
122
+ - Total input context of 128K tokens for the 4B, 12B, and 27B sizes, and
123
+ 32K tokens for the 1B and 270M sizes.
124
+
125
+ - **Output:**
126
+ - Generated text in response to the input, such as an answer to a
127
+ question, analysis of image content, or a summary of a document
128
+ - Total output context up to 128K tokens for the 4B, 12B, and 27B sizes,
129
+ and 32K tokens for the 1B and 270M sizes per request, subtracting the
130
+ request input tokens
131
+
132
+ ### Citation
133
+
134
+ ```none
135
+ @article{gemma_2025,
136
+ title={Gemma 3},
137
+ url={https://arxiv.org/abs/2503.19786},
138
+ publisher={Google DeepMind},
139
+ author={Gemma Team},
140
+ year={2025}
141
+ }
142
+ ```
143
+
144
+ ## Model Data
145
+
146
+ Data used for model training and how the data was processed.
147
+
148
+ ### Training Dataset
149
+
150
+ These models were trained on a dataset of text data that includes a wide variety
151
+ of sources. The 27B model was trained with 14 trillion tokens, the 12B model was
152
+ trained with 12 trillion tokens, 4B model was trained with 4 trillion tokens,
153
+ the 1B with 2 trillion tokens, and the 270M with 6 trillion tokens. The
154
+ knowledge cutoff date for the training data was August 2024. Here are the key
155
+ components:
156
+
157
+ - Web Documents: A diverse collection of web text ensures the model is
158
+ exposed to a broad range of linguistic styles, topics, and vocabulary. The
159
+ training dataset includes content in over 140 languages.
160
+ - Code: Exposing the model to code helps it to learn the syntax and
161
+ patterns of programming languages, which improves its ability to generate
162
+ code and understand code-related questions.
163
+ - Mathematics: Training on mathematical text helps the model learn logical
164
+ reasoning, symbolic representation, and to address mathematical queries.
165
+ - Images: A wide range of images enables the model to perform image
166
+ analysis and visual data extraction tasks.
167
+
168
+ The combination of these diverse data sources is crucial for training a powerful
169
+ multimodal model that can handle a wide variety of different tasks and data
170
+ formats.
171
+
172
+ ### Data Preprocessing
173
+
174
+ Here are the key data cleaning and filtering methods applied to the training
175
+ data:
176
+
177
+ - CSAM Filtering: Rigorous CSAM (Child Sexual Abuse Material) filtering
178
+ was applied at multiple stages in the data preparation process to ensure
179
+ the exclusion of harmful and illegal content.
180
+ - Sensitive Data Filtering: As part of making Gemma pre-trained models
181
+ safe and reliable, automated techniques were used to filter out certain
182
+ personal information and other sensitive data from training sets.
183
+ - Additional methods: Filtering based on content quality and safety in
184
+ line with [our policies][safety-policies].
185
+
186
+ ## Implementation Information
187
+
188
+ Details about the model internals.
189
+
190
+ ### Hardware
191
+
192
+ Gemma was trained using [Tensor Processing Unit (TPU)][tpu] hardware (TPUv4p,
193
+ TPUv5p and TPUv5e). Training vision-language models (VLMS) requires significant
194
+ computational power. TPUs, designed specifically for matrix operations common in
195
+ machine learning, offer several advantages in this domain:
196
+
197
+ - Performance: TPUs are specifically designed to handle the massive
198
+ computations involved in training VLMs. They can speed up training
199
+ considerably compared to CPUs.
200
+ - Memory: TPUs often come with large amounts of high-bandwidth memory,
201
+ allowing for the handling of large models and batch sizes during training.
202
+ This can lead to better model quality.
203
+ - Scalability: TPU Pods (large clusters of TPUs) provide a scalable
204
+ solution for handling the growing complexity of large foundation models.
205
+ You can distribute training across multiple TPU devices for faster and more
206
+ efficient processing.
207
+ - Cost-effectiveness: In many scenarios, TPUs can provide a more
208
+ cost-effective solution for training large models compared to CPU-based
209
+ infrastructure, especially when considering the time and resources saved
210
+ due to faster training.
211
+ - These advantages are aligned with
212
+ [Google's commitments to operate sustainably][sustainability].
213
+
214
+ ### Software
215
+
216
+ Training was done using [JAX][jax] and [ML Pathways][ml-pathways].
217
+
218
+ JAX allows researchers to take advantage of the latest generation of hardware,
219
+ including TPUs, for faster and more efficient training of large models. ML
220
+ Pathways is Google's latest effort to build artificially intelligent systems
221
+ capable of generalizing across multiple tasks. This is specially suitable for
222
+ foundation models, including large language models like these ones.
223
+
224
+ Together, JAX and ML Pathways are used as described in the
225
+ [paper about the Gemini family of models][gemini-2-paper]; *"the 'single
226
+ controller' programming model of Jax and Pathways allows a single Python
227
+ process to orchestrate the entire training run, dramatically simplifying the
228
+ development workflow."*
229
+
230
+ ## Evaluation
231
+
232
+ Model evaluation metrics and results.
233
+
234
+ ### Benchmark Results
235
+
236
+ These models were evaluated against a large collection of different datasets and
237
+ metrics to cover different aspects of text generation. Evaluation results marked
238
+ with **IT** are for instruction-tuned models. Evaluation results marked with
239
+ **PT** are for pre-trained models.
240
+
241
+ #### Gemma 3 270M
242
+
243
+ | **Benchmark** | **n-shot** | **Gemma 3 PT 270M** |
244
+ | :------------------------ | :-----------: | ------------------: |
245
+ | [HellaSwag][hellaswag] | 10-shot | 40.9 |
246
+ | [BoolQ][boolq] | 0-shot | 61.4 |
247
+ | [PIQA][piqa] | 0-shot | 67.7 |
248
+ | [TriviaQA][triviaqa] | 5-shot | 15.4 |
249
+ | [ARC-c][arc] | 25-shot | 29.0 |
250
+ | [ARC-e][arc] | 0-shot | 57.7 |
251
+ | [WinoGrande][winogrande] | 5-shot | 52.0 |
252
+
253
+ [hellaswag]: https://arxiv.org/abs/1905.07830
254
+ [boolq]: https://arxiv.org/abs/1905.10044
255
+ [piqa]: https://arxiv.org/abs/1911.11641
256
+ [triviaqa]: https://arxiv.org/abs/1705.03551
257
+ [arc]: https://arxiv.org/abs/1911.01547
258
+ [winogrande]: https://arxiv.org/abs/1907.10641
259
+
260
+ | **Benchmark** | **n-shot** | **Gemma 3 IT 270m** |
261
+ | :------------------------ | :-----------: | ------------------: |
262
+ | [HellaSwag][hellaswag] | 0-shot | 37.7 |
263
+ | [PIQA][piqa] | 0-shot | 66.2 |
264
+ | [ARC-c][arc] | 0-shot | 28.2 |
265
+ | [WinoGrande][winogrande] | 0-shot | 52.3 |
266
+ | [BIG-Bench Hard][bbh] | few-shot | 26.7 |
267
+ | [IF Eval][ifeval] | 0-shot | 51.2 |
268
+
269
+ [hellaswag]: https://arxiv.org/abs/1905.07830
270
+ [piqa]: https://arxiv.org/abs/1911.11641
271
+ [arc]: https://arxiv.org/abs/1911.01547
272
+ [winogrande]: https://arxiv.org/abs/1907.10641
273
+ [bbh]: https://paperswithcode.com/dataset/bbh
274
+ [bbh]: https://paperswithcode.com/dataset/bbh
275
+ [ifeval]: https://arxiv.org/abs/2311.07911
276
+
277
+ #### Gemma 3 1B, 4B, 12B & 27B
278
+
279
+ ##### Reasoning and factuality
280
+
281
+ | Benchmark | n-shot | Gemma 3 IT 1B | Gemma 3 IT 4B | Gemma 3 IT 12B | Gemma 3 IT 27B |
282
+ |--------------------------------|--------|:-------------:|:-------------:|:--------------:|:--------------:|
283
+ | [GPQA][gpqa] Diamond | 0-shot | 19.2 | 30.8 | 40.9 | 42.4 |
284
+ | [SimpleQA][simpleqa] | 0-shot | 2.2 | 4.0 | 6.3 | 10.0 |
285
+ | [FACTS Grounding][facts-grdg] | - | 36.4 | 70.1 | 75.8 | 74.9 |
286
+ | [BIG-Bench Hard][bbh] | 0-shot | 39.1 | 72.2 | 85.7 | 87.6 |
287
+ | [BIG-Bench Extra Hard][bbeh] | 0-shot | 7.2 | 11.0 | 16.3 | 19.3 |
288
+ | [IFEval][ifeval] | 0-shot | 80.2 | 90.2 | 88.9 | 90.4 |
289
+
290
+ | Benchmark | n-shot | Gemma 3 PT 1B | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
291
+ | ------------------------------ |----------|:--------------:|:-------------:|:--------------:|:--------------:|
292
+ | [HellaSwag][hellaswag] | 10-shot | 62.3 | 77.2 | 84.2 | 85.6 |
293
+ | [BoolQ][boolq] | 0-shot | 63.2 | 72.3 | 78.8 | 82.4 |
294
+ | [PIQA][piqa] | 0-shot | 73.8 | 79.6 | 81.8 | 83.3 |
295
+ | [SocialIQA][socialiqa] | 0-shot | 48.9 | 51.9 | 53.4 | 54.9 |
296
+ | [TriviaQA][triviaqa] | 5-shot | 39.8 | 65.8 | 78.2 | 85.5 |
297
+ | [Natural Questions][naturalq] | 5-shot | 9.48 | 20.0 | 31.4 | 36.1 |
298
+ | [ARC-c][arc] | 25-shot | 38.4 | 56.2 | 68.9 | 70.6 |
299
+ | [ARC-e][arc] | 0-shot | 73.0 | 82.4 | 88.3 | 89.0 |
300
+ | [WinoGrande][winogrande] | 5-shot | 58.2 | 64.7 | 74.3 | 78.8 |
301
+ | [BIG-Bench Hard][bbh] | few-shot | 28.4 | 50.9 | 72.6 | 77.7 |
302
+ | [DROP][drop] | 1-shot | 42.4 | 60.1 | 72.2 | 77.2 |
303
+
304
+ [gpqa]: https://arxiv.org/abs/2311.12022
305
+ [simpleqa]: https://arxiv.org/abs/2411.04368
306
+ [facts-grdg]: https://goo.gle/FACTS_paper
307
+ [bbeh]: https://github.com/google-deepmind/bbeh
308
+ [ifeval]: https://arxiv.org/abs/2311.07911
309
+ [hellaswag]: https://arxiv.org/abs/1905.07830
310
+ [boolq]: https://arxiv.org/abs/1905.10044
311
+ [piqa]: https://arxiv.org/abs/1911.11641
312
+ [socialiqa]: https://arxiv.org/abs/1904.09728
313
+ [triviaqa]: https://arxiv.org/abs/1705.03551
314
+ [naturalq]: https://github.com/google-research-datasets/natural-questions
315
+ [arc]: https://arxiv.org/abs/1911.01547
316
+ [winogrande]: https://arxiv.org/abs/1907.10641
317
+ [bbh]: https://paperswithcode.com/dataset/bbh
318
+ [drop]: https://arxiv.org/abs/1903.00161
319
+
320
+ ##### STEM and code
321
+
322
+ | Benchmark | n-shot | Gemma 3 IT 1B | Gemma 3 IT 4B | Gemma 3 IT 12B | Gemma 3 IT 27B |
323
+ |----------------------------|--------|:-------------:|:-------------:|:--------------:|:--------------:|
324
+ | [MMLU][mmlu] (Pro) | 0-shot | 14.7 | 43.6 | 60.6 | 67.5 |
325
+ | [LiveCodeBench][lcb] | 0-shot | 1.9 | 12.6 | 24.6 | 29.7 |
326
+ | [Bird-SQL][bird-sql] (dev) | - | 6.4 | 36.3 | 47.9 | 54.4 |
327
+ | [Math][math] | 0-shot | 48.0 | 75.6 | 83.8 | 89.0 |
328
+ | HiddenMath | 0-shot | 15.8 | 43.0 | 54.5 | 60.3 |
329
+ | [MBPP][mbpp] | 3-shot | 35.2 | 63.2 | 73.0 | 74.4 |
330
+ | [HumanEval][humaneval] | 0-shot | 41.5 | 71.3 | 85.4 | 87.8 |
331
+ | [Natural2Code][nat2code] | 0-shot | 56.0 | 70.3 | 80.7 | 84.5 |
332
+ | [GSM8K][gsm8k] | 0-shot | 62.8 | 89.2 | 94.4 | 95.9 |
333
+
334
+ | Benchmark | n-shot | Gemma 3 PT 4B | Gemma 3 PT 12B | Gemma 3 PT 27B |
335
+ | ------------------------------ |----------------|:-------------:|:--------------:|:--------------:|
336
+ | [MMLU][mmlu] | 5-shot | 59.6 | 74.5 | 78.6 |
337
+ | [MMLU][mmlu] (Pro COT) | 5-shot | 29.2 | 45.3 | 52.2 |
338
+ | [AGIEval][agieval] | 3-5-shot | 42.1 | 57.4 | 66.2 |
339
+ | [MATH][math] | 4-shot | 24.2 | 43.3 | 50.0 |
340
+ | [GSM8K][gsm8k] | 8-shot | 38.4 | 71.0 | 82.6 |
341
+ | [GPQA][gpqa] | 5-shot | 15.0 | 25.4 | 24.3 |
342
+ | [MBPP][mbpp] | 3-shot | 46.0 | 60.4 | 65.6 |
343
+ | [HumanEval][humaneval] | 0-shot | 36.0 | 45.7 | 48.8 |
344
+