Changesets · Branches · Tags · Compare
| Changeset | d87f7b0f40bb18fa11d4795a8a38cdae0dbdf688a422a847bc0be60cb3b7637b |
|---|---|
| Author | KikoCis <kikocisneros@users.noreply.github.com> · 2026-04-15 15:12 +02:00 |
| Committer | KikoCis <kikocisneros@users.noreply.github.com> · 2026-04-15 15:12 +02:00 |
| Parents | c46d86019ba6 |
1 file changed
modified README.md +41 −12
| @@ -2,22 +2,50 @@ | ||
| 2 | 2 | |
| 3 | 3 | Empirical study of Gemma 4 31B Instruct: which transformer layers are redundant, which quantizations preserve quality, and the Pareto frontier below 3 BPW. |
| 4 | 4 | |
| 5 | -**Live site**: https://otter.utopiaia.com (coming soon) | |
| 6 | -**GitHub Pages**: https://kikocis.github.io/otter/ | |
| 5 | +**Live site**: https://kikocis.github.io/otter/ · (custom domain `otter.utopiaia.com` pending DNS) | |
| 7 | 6 | |
| 8 | -## Results | |
| 7 | +## Featured model — custom IQ2_M ⭐ | |
| 9 | 8 | |
| 10 | -- **Unsloth UD-IQ3_XXS (11.84 GB)** wins NL2Bash: F1 85.06%, beats f16 baseline | |
| 11 | -- **Unsloth UD-IQ2_M (10.75 GB)** matches f16 quality at 5.7× smaller — +25.4 F1 points over standard Q2_K | |
| 12 | -- **Q2_K collapses on Gemma 4**: F1 drops to 58.6% due to architecture sensitivity | |
| 13 | -- **Layer pruning (Otter v3, 58 layers)** is dominated by dynamic quantization on this benchmark | |
| 9 | +**[KikoCis/gemma-4-31b-it-IQ2_M-GGUF](https://huggingface.co/KikoCis/gemma-4-31b-it-IQ2_M-GGUF)** — 10.17 GB, 2.84 BPW | |
| 14 | 10 | |
| 15 | -## Resources | |
| 11 | +| Metric | This IQ2_M | f16 baseline | | |
| 12 | +|----------|-----------:|-------------:| | |
| 13 | +| Size | **10.17 GB** | 61.4 GB | | |
| 14 | +| Char-F1 | **84.71%** | 84.76% | | |
| 15 | +| BLEU-4 | **22.39** | 21.02 | | |
| 16 | +| Exact | **12%** | 12% | | |
| 16 | 17 | |
| 17 | -- 🤗 [Base IQ3_XS model (Kiko)](https://huggingface.co/KikoCis/gemma-4-31b-it-IQ3_XS-GGUF) | |
| 18 | -- 🤗 [Otter v3 pruned (58 layers)](https://huggingface.co/KikoCis/gemma-4-31b-otter-v3-GGUF) | |
| 19 | -- 📊 [Raw study data + scripts](https://huggingface.co/datasets/KikoCis/gemma4-31b-layer-study) | |
| 20 | -- 🏆 [Unsloth Dynamic 2.0 (winners)](https://huggingface.co/unsloth/gemma-4-31B-it-GGUF) | |
| 18 | +Matches f16 Char-F1 and **beats f16 on BLEU-4** at 6× smaller. Also beats Unsloth UD-IQ2_M on every metric at 0.6 GB smaller — dedicated CLI-focused imatrix calibration pushes the sub-3-BPW Pareto frontier further. | |
| 19 | + | |
| 20 | +## Full benchmark results | |
| 21 | + | |
| 22 | +9-variant comparison on NL2Bash (50 examples, Stanford/Tellina test split): | |
| 23 | + | |
| 24 | +| Rank | Model | Size | BPW | Char-F1 | BLEU-4 | | |
| 25 | +|-----:|-------|------|-----|--------:|-------:| | |
| 26 | +| 1 | [Unsloth UD-IQ3_XXS](https://huggingface.co/unsloth/gemma-4-31B-it-GGUF) | 11.84 GB | ~2.98 | 85.06% | 20.26 | | |
| 27 | +| 2 | Base f16 (reference) | 61.4 GB | 16.0 | 84.76% | 21.02 | | |
| 28 | +| 3 | [Base IQ3_XS (this project)](https://huggingface.co/KikoCis/gemma-4-31b-it-IQ3_XS-GGUF) | 13.1 GB | 3.40 | 84.76% | 18.95 | | |
| 29 | +| **4** | **[IQ2_M CLI imatrix (this project)](https://huggingface.co/KikoCis/gemma-4-31b-it-IQ2_M-GGUF)** | **10.17 GB** | **2.84** | **84.71%** | **22.39** | | |
| 30 | +| 5 | [Unsloth UD-IQ2_M](https://huggingface.co/unsloth/gemma-4-31B-it-GGUF) | 10.75 GB | ~2.70 | 84.02% | 18.64 | | |
| 31 | +| 6 | [Otter v3 Q3_K_M (58-layer pruned)](https://huggingface.co/KikoCis/gemma-4-31b-otter-v3-GGUF) | 14.1 GB | 3.98 | 79.89% | 12.80 | | |
| 32 | +| 7 | [Otter v3 IQ3_XS (58-layer pruned)](https://huggingface.co/KikoCis/gemma-4-31b-otter-v3-GGUF) | 12.1 GB | 3.41 | 78.72% | 15.14 | | |
| 33 | +| 8 | [Unsloth UD-IQ2_XXS](https://huggingface.co/unsloth/gemma-4-31B-it-GGUF) | 8.53 GB | ~2.06 | 76.82% | 11.49 | | |
| 34 | +| 9 | Base Q2_K (3rd party) | 11.0 GB | 2.70 | 58.60% | 6.92 | | |
| 35 | + | |
| 36 | +## Key findings | |
| 37 | + | |
| 38 | +- **Custom IQ2_M is the new sub-3-BPW Pareto point** — matches f16 on Char-F1 and beats it on BLEU-4, at 6× smaller than f16 and 0.6 GB smaller than Unsloth UD-IQ2_M. | |
| 39 | +- **Q2_K collapses on Gemma 4** (F1 58.6%) — the wide logit distribution + RMSNorm scaling is incompatible with scalar blockwise 2-bit. | |
| 40 | +- **Layer pruning without recovery fine-tuning is dominated** by dynamic quantization: our 58-layer Otter-v3 IQ3_XS (12.1 GB) loses 6 F1 points to our own 60-layer IQ2_M (10.17 GB). | |
| 41 | +- **Imatrix calibration choice > raw BPW**. UD-IQ2_M beats Q2_K by +25 F1 points at the same BPW; our CLI-tuned imatrix beats UD-IQ2_M by another +0.7 F1 and +3.75 BLEU-4. | |
| 42 | + | |
| 43 | +## Published models | |
| 44 | + | |
| 45 | +- ⭐ 🤗 **[gemma-4-31b-it-IQ2_M-GGUF](https://huggingface.co/KikoCis/gemma-4-31b-it-IQ2_M-GGUF)** — recommended, 10.17 GB, F1 84.71%, BLEU-4 22.39 | |
| 46 | +- 🤗 [gemma-4-31b-it-IQ3_XS-GGUF](https://huggingface.co/KikoCis/gemma-4-31b-it-IQ3_XS-GGUF) — 13.1 GB, F1 84.76%, ties f16 | |
| 47 | +- 🤗 [gemma-4-31b-otter-v3-GGUF](https://huggingface.co/KikoCis/gemma-4-31b-otter-v3-GGUF) — research artifact (58-layer pruned, no fine-tuning) | |
| 48 | +- 📊 [KikoCis/gemma4-31b-layer-study](https://huggingface.co/datasets/KikoCis/gemma4-31b-layer-study) — raw study data + scripts + visualization | |
| 21 | 49 | |
| 22 | 50 | ## Methodology |
| 23 | 51 | |
| @@ -27,6 +55,7 @@ | ||
| 27 | 55 | - **Phase C** — Single-layer ablation: measure perplexity delta when a layer is removed |
| 28 | 56 | |
| 29 | 57 | Benchmark: NL2Bash 50-example subset from the official Stanford/Tellina test split. |
| 58 | +Each question runs as an isolated `llama-cli` subprocess with reasoning off, `max_tokens=200`, `temp=0.1`. Scoring via NLTK BLEU + character-level F1. | |
| 30 | 59 | |
| 31 | 60 | ## License |
| 32 | 61 |