Elffuss BraidHub

kikocis/otter public

Changeset: d87f7b0f40bb
d87f7b0f40bb v1.1: feature custom IQ2_M (10.17 GB, F1 84.71%, BLEU-4 22.39 beats f16) KikoCis,
404.html25.8 KiB
README.md3.9 KiB
index.html25.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)

KikoCis/gemma-4-31b-it-IQ2_M-GGUF โ€” 10.17 GB, 2.84 BPW

MetricThis IQ2_Mf16 baseline
Size10.17 GB61.4 GB
Char-F184.71%84.76%
BLEU-422.3921.02
Exact12%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):

RankModelSizeBPWChar-F1BLEU-4
1Unsloth UD-IQ3_XXS11.84 GB~2.9885.06%20.26
2Base f16 (reference)61.4 GB16.084.76%21.02
3Base IQ3_XS (this project)13.1 GB3.4084.76%18.95
4IQ2_M CLI imatrix (this project)10.17 GB2.8484.71%22.39
5Unsloth UD-IQ2_M10.75 GB~2.7084.02%18.64
6Otter v3 Q3_K_M (58-layer pruned)14.1 GB3.9879.89%12.80
7Otter v3 IQ3_XS (58-layer pruned)12.1 GB3.4178.72%15.14
8Unsloth UD-IQ2_XXS8.53 GB~2.0676.82%11.49
9Base Q2_K (3rd party)11.0 GB2.7058.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

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).