| 404.html | 25.8 KiB | |
| README.md | 3.9 KiB | |
| index.html | 25.8 KiB |
README.md
๐ฆฆ Otter โ Gemma 4 31B Layer & Quantization Study
Empirical study of Gemma 4 31B Instruct: which transformer layers are redundant, which quantizations preserve quality, and the Pareto frontier below 3 BPW.
Live site: https://kikocis.github.io/otter/ ยท (custom domain otter.utopiaia.com pending DNS)
Featured model โ custom IQ2_M โญ
KikoCis/gemma-4-31b-it-IQ2_M-GGUF โ 10.17 GB, 2.84 BPW
| Metric | This IQ2_M | f16 baseline |
|---|---|---|
| Size | 10.17 GB | 61.4 GB |
| Char-F1 | 84.71% | 84.76% |
| BLEU-4 | 22.39 | 21.02 |
| Exact | 12% | 12% |
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.
Full benchmark results
9-variant comparison on NL2Bash (50 examples, Stanford/Tellina test split):
| Rank | Model | Size | BPW | Char-F1 | BLEU-4 |
|---|---|---|---|---|---|
| 1 | Unsloth UD-IQ3_XXS | 11.84 GB | ~2.98 | 85.06% | 20.26 |
| 2 | Base f16 (reference) | 61.4 GB | 16.0 | 84.76% | 21.02 |
| 3 | Base IQ3_XS (this project) | 13.1 GB | 3.40 | 84.76% | 18.95 |
| 4 | IQ2_M CLI imatrix (this project) | 10.17 GB | 2.84 | 84.71% | 22.39 |
| 5 | Unsloth UD-IQ2_M | 10.75 GB | ~2.70 | 84.02% | 18.64 |
| 6 | Otter v3 Q3_K_M (58-layer pruned) | 14.1 GB | 3.98 | 79.89% | 12.80 |
| 7 | Otter v3 IQ3_XS (58-layer pruned) | 12.1 GB | 3.41 | 78.72% | 15.14 |
| 8 | Unsloth UD-IQ2_XXS | 8.53 GB | ~2.06 | 76.82% | 11.49 |
| 9 | Base Q2_K (3rd party) | 11.0 GB | 2.70 | 58.60% | 6.92 |
Key findings
- 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.
- Q2_K collapses on Gemma 4 (F1 58.6%) โ the wide logit distribution + RMSNorm scaling is incompatible with scalar blockwise 2-bit.
- 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).
- 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.
Published models
- โญ ๐ค gemma-4-31b-it-IQ2_M-GGUF โ recommended, 10.17 GB, F1 84.71%, BLEU-4 22.39
- ๐ค gemma-4-31b-it-IQ3_XS-GGUF โ 13.1 GB, F1 84.76%, ties f16
- ๐ค gemma-4-31b-otter-v3-GGUF โ research artifact (58-layer pruned, no fine-tuning)
- ๐ KikoCis/gemma4-31b-layer-study โ raw study data + scripts + visualization
Methodology
3-phase layer analysis:
- Phase A โ Block Influence (BI): per-layer residual stream modification
- Phase B โ Logit Lens: where does the model commit to an answer?
- Phase C โ Single-layer ablation: measure perplexity delta when a layer is removed
Benchmark: NL2Bash 50-example subset from the official Stanford/Tellina test split.
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.
License
Apache 2.0 (matching base Gemma 4 license).