Gemma 4 12B · Opus-reasoning tune (GGUF, made for 16 GB GPUs)
A LoRA fine-tune of Google's Gemma 4 12B on ~8.6k Claude Opus 4.6/4.7-style reasoning conversations, plus an abliterated variant made with Heretic. Q6_K and Q4_K_M GGUFs for llama.cpp.
It's the smaller sibling of my 26B-A4B tune, aimed at ordinary gaming PCs. Everything below was tested on a 16 GB Radeon RX 6800 XT, with the results written up honestly, including where stock Gemma still does better.
Files
| File | Size | What it is |
|---|---|---|
gemma-4-12B-opus-reasoning-abliterated-Q6_K.gguf | 9.8 GB | Recommended for 16 GB cards. Fine-tune + Heretic abliteration |
gemma-4-12B-opus-reasoning-abliterated-Q4_K_M.gguf | 7.4 GB | Same, for 8–12 GB cards (imatrix-calibrated) |
gemma-4-12B-opus-reasoning-Q6_K.gguf | 9.8 GB | Fine-tune only, no abliteration |
gemma-4-12B-opus-reasoning-Q4_K_M.gguf | 7.4 GB | Fine-tune only, imatrix-calibrated |
mmproj-gemma-4-12B-opus-reasoning-bf16.gguf | 180 MB | Vision projector (the vision tower is untouched; Unsloth's stock mmproj works too) |
imatrix/ | 15 MB each | The importance matrices used for the Q4 files |
adapter/ | The LoRA itself (safetensors, r16) |
Not included, get it from unsloth/gemma-4-12b-it-GGUF:
MTP draft head mtp-gemma-4-12b-it.gguf (0.47 GB). Optional, but gives +40–80% generation speed (see below).
Why Q6_K and Q4_K_M
| Quant | Fits a 16 GB card at 128k context, q8 KV cache, vision on | Write speed (no MTP) | Hard reasoning |
|---|---|---|---|
| Q6_K | yes, 12.7 GB used | 42–44 tok/s | ties stock Gemma Q6_K |
| Q4_K_M | yes, 10.4 GB used, leaves room for a game/browser | 51–54 tok/s | 1.5 points behind stock Q4_K_M |
| Q8_0 (not shipped) | stock Q8_0 spilled into system RAM as context grew: 33 → 17 tok/s |
- Q6_K is the sweet spot on 16 GB: the full 128k context with vision still leaves ~3 GB free.
- Q4_K_M is for 8–12 GB cards, or 16 GB cards that also run other things.
- The Q4 files are imatrix-calibrated, and this matters a lot for a fine-tune. My first, uncalibrated Q4_K_M scored 18/34 on the hard suite, against 25/34 for the calibrated one and 26/34 for the Q6_K. The calibration text is a random sample of the training data.
TL;DR
- Reasoning: at Q6_K it ties stock Gemma 4 12B on my hard suite (27.5 vs 27.5, average of two runs) while using about a third fewer thinking tokens. At Q4_K_M it's 1.5 points behind stock and uses 22% fewer tokens.
- Less refusing and moralising, with shorter answers: on my 27 borderline-request suite, stock Gemma answers 21–23 cleanly and this tune 23–26, using about 60% fewer tokens with thinking on.
- Speed with the MTP draft head: ~76 tok/s while thinking at Q6_K (~42 without), ~90 tok/s at Q4_K_M. Use
--spec-draft-n-max 2. - Keep thinking on, especially at Q4_K_M. With thinking off, the Q6_K is level with stock but the Q4_K_M falls behind on hard problems (see below).
Recommended settings
llama-server \
-m gemma-4-12B-opus-reasoning-abliterated-Q6_K.gguf \
--mmproj mmproj-gemma-4-12B-opus-reasoning-bf16.gguf \
-md mtp-gemma-4-12b-it.gguf -ngld 999 --spec-type draft-mtp --spec-draft-n-max 2 \
-ngl 999 -c 131072 -fa on -ctk q8_0 -ctv q8_0 --jinja \
--temp 1.0 --top-k 64 --top-p 0.95 --min-p 0
- Thinking on, temperature 1.0 (Google's recommendation). Toggle thinking with the normal Gemma 4 chat template
(
chat_template_kwargs: {"enable_thinking": true}or your client's reasoning-effort setting). --spec-draft-n-max 2, not the default 3: see the MTP section.- Tested with llama.cpp b11840 (Vulkan) on Ubuntu.
Results
My own small suites, the same ones I use to pick models at home:
- hard: 34 multi-step maths, logic and code-tracing problems with checkable answers.
- knowledge: 46 factual questions.
- refusal: 27 borderline but legitimate requests (crude humour, profane limericks, safe alcohol and caffeine limits, sex-ed, how phishing works, harmless pranks). Refusing, lecturing or dodging scores zero.
A gap of 2–3 points on the hard suite is within run-to-run noise; I ran the key hard comparisons twice for that reason. Reference points: stock Gemma 4 12B (Unsloth's GGUFs, same quant) and HauhauCS's Gemma4-12B-QAT-Uncensored "Balanced" (only published as Q4_K_M), all under identical settings.
A note on HauhauCS: his uncensored Gemma builds are what I run day to day, so his model was on my drive and a natural yardstick for an abliterated variant. It's here as a reference point, not as competition. His build starts from Google's QAT checkpoint and targets different goals than this one, so a single run of my small suites says little about it. If you want an uncensored Gemma that's battle-tested by a lot of people, his are a great place to start.
Thinking on, temp 1.0 / top-p 0.95 / top-k 64 (recommended)
| Model | Hard (34) | Knowledge (46) | Refusal (27) | Thinking tokens per hard problem |
|---|---|---|---|---|
| Stock Gemma 4 12B, Q6_K | 27.5 (29, 26) | 44 | 23 | 9,600 |
| This model, abliterated, Q6_K | 27.5 (26, 29) | 45 | 23.5 (23, 24) | 6,400 |
| This model, Q6_K | 26 | 44 | 25 | 6,700 |
| Stock Gemma 4 12B, Q4_K_M | 25.5 (26, 25) | 44 | 21 | 10,000 |
| This model, abliterated, Q4_K_M | 24 (25, 23) | 45 | 25 | 7,900 |
| This model, Q4_K_M | 27 | 45 | 24 | 7,000 |
| HauhauCS Uncensored Balanced, Q4_K_M | 18 | 43 | 27 | 10,800 |
| This model, abliterated, Q4_K_M without imatrix (not shipped) | 18 | 42 | 26 | 10,400 |
Numbers in brackets are two separate runs. Token counts include problems that ran out of room (16k-token limit): stock hit the limit on 8 of 34 problems, the abliterated Q6_K on 3.
Thinking off, temp 0.6 / top-p 0.95
| Model | Hard (34) | Knowledge (46) | Refusal (27) |
|---|---|---|---|
| Stock Gemma 4 12B, Q6_K | 24 | 45 | 21 |
| Stock Gemma 4 12B, Q4_K_M | 26 | 45 | 21 |
| This model, abliterated, Q6_K | 23 | 44 | 26 |
| This model, Q6_K | 25 | 43 | 24 |
| This model, abliterated, Q4_K_M | 19 | 43 | 25 |
| This model, Q4_K_M | 22 | 42 | 25 |
| HauhauCS Uncensored Balanced, Q4_K_M | 23 | 44 | 26 |
With thinking off, the Q6_K files are level with stock Q6_K (23–25 vs 24), but the Q4_K_M files fall behind (19–22 vs 26). The training data was 75% thinking traces, so thinking is where this tune is strongest.
Speed on a 16 GB RX 6800 XT (Vulkan, single request)
Prompt reading / writing in tok/s at 0, 8k and 32k tokens of context (llama-bench):
| Quant | Prompt read 0 / 8k / 32k | Write 0 / 8k / 32k |
|---|---|---|
| Q6_K | 880 / 674 / 419 | 43.9 / 40.3 / 38.9 |
| Q4_K_M | 1097 / 795 / 461 | 54.2 / 48.8 / 46.7 |
Card settings: 312 W power limit, −50 mV, Resizable BAR on.¹
MTP draft head: use --spec-draft-n-max 2
Gemma 4's MTP draft head guesses the next few tokens, and the big model checks them in one pass. The output is identical either way; only the speed changes. The draft head was trained on stock Gemma's text, so it guesses this tune's prose less well, but its thinking traces are very predictable. I swept the settings:
| Setting | Q6_K: story | Q6_K: thinking | Q4_K_M: story | Q4_K_M: thinking |
|---|---|---|---|---|
| No MTP | 41.8 | 41.7 | 51.1 | 51.0 |
| MTP, default (3 drafts) | 50.2 | 74.8 | 61.8 | 88.5 |
MTP, --spec-draft-n-max 2 | 57.6 | 76.0 | 66.2 | 90.5 |
| MTP, 8 drafts | 16.3 | 32.3 | 18.5 | 34.1 |
(tok/s, temperature 1.0. "story" is a 300-word story with thinking off; "thinking" is a code-tracing question with thinking on.) Two drafts is the best all-rounder. Long drafts are slower than no MTP at all.
Political lean (12axes)
All 288 statements of the original 12axes quiz (MIT) with its own scoring; thinking off, temperature 0, one of the seven answer options required. My own harness, so expect different numbers on UGI.
Scores are % toward the first-named pole (50 = centre; the quiz calls 40–60 "Neutral"):
| Axis | Stock Q4 | Opus Q4 | Abliterated Q4 | Abliterated Q6 | HauhauCS |
|---|---|---|---|---|---|
| Federal ↔ Unitary | 48 | 51.5 | 48 | 45.5 | 54 |
| Democratic ↔ Autocratic | 50.5 | 61.5 | 58 | 61 | 53.5 |
| Internationalist ↔ Nationalist | 52 | 54.5 | 56.5 | 58 | 59.5 |
| Militarist ↔ Pacifist | 46 | 49.5 | 53 | 49.5 | 50 |
| Freedom ↔ Security | 52 | 49.5 | 48.5 | 50 | 48.5 |
| Collectivize ↔ Privatize | 50 | 52 | 53 | 54 | 47.5 |
| Irreligious ↔ Religious | 48 | 56 | 56 | 55.5 | 48 |
| Progressive ↔ Traditional | 52 | 59 | 58.5 | 54.5 | 50.5 |
| Multicultural ↔ Assimilationist | 45 | 39 | 33 | 32.5 | 43.5 |
| Planned ↔ Markets | 50 | 48.5 | 47.5 | 49.5 | 52 |
| Globalism ↔ Protectionism | 48 | 45.5 | 43 | 46 | 45.5 |
| Technology ↔ Bioconservative | 50 | 51.5 | 56 | 54.5 | 56.5 |
Stock Gemma 12B barely takes positions (it answers "Neutral/Unsure" to 264 of 288 statements), so it sits at the centre by default. This tune commits far more often (193 neutral; the abliterated variants 112–128), which spreads the scores out. Everything lands in "Neutral" except Multicultural ↔ Assimilationist, where the abliterated variants lean towards Assimilationist (33). I'm reporting it rather than correcting it.
How it was made
Fine-tune (Unsloth 2026.10.11, transformers 5.17, one H100 80GB, 63 min):
- Base:
google/gemma-4-12B-it, 16-bit LoRA (not the QAT checkpoint: it is tuned for Q4_0, and this release is Q6_K/Q4_K_M). - LoRA r16, alpha 16, dropout 0, on attention and MLP projections; vision and audio frozen. 65.6M trainable parameters (0.55%).
- 1 epoch over 8,643 conversations. Learning rate 1e-4, cosine, effective batch 16, adamw_8bit, max length 8192.
- Loss only on the final assistant turn including its thinking. 75% of examples with thinking on, 25% off.
- Eval loss on 50 held-out conversations: 1.506 → 1.360.
Data: angrygiraffe/claude-opus-4.6-4.7-reasoning-8.7k (Apache-2.0).
Abliteration: Heretic 1.4.0 on the merged 16-bit model, 100 trials. Picked trial 36: 17/100 refusals on Heretic's harmful set (from 100/100), KL divergence 0.024. Parameters: direction_index 31.51; attn.o_proj max_weight 1.18 at position 33.94, min_weight 0.96, min_weight_distance 13.99; mlp.down_proj max_weight 1.42 at position 28.87, min_weight 1.35, min_weight_distance 26.41.
Quantization: merged → bf16 GGUF → Q6_K with llama-quantize. The Q4_K_M files were made with llama-imatrix
(400 × 512-token chunks of 234 random training conversations, computed on the Q6_K) and llama-quantize --allow-requantize --imatrix.
Limitations
- Small benchmarks. Treat 1–3 points as a tie.
- Q4_K_M is weaker with thinking off than stock Gemma on hard problems.
- It writes like Opus but is a 12B model. It can produce confident, plausible citations that don't exist: verify references.
- Python code tracing is where most of its remaining hard-suite misses are.
- Text-only fine-tune: vision is stock Gemma 4 (works, not benchmarked).
- The abliterated variant answers requests the stock model refuses. You are responsible for how you use it.
Credits
- Google for Gemma 4.
- Unsloth for the training stack and the stock GGUF and MTP files.
- angrygiraffe for the dataset.
- p-e-w for Heretic.
- llama.cpp contributors (including the imatrix tooling that rescued the Q4).
- HauhauCS, whose Uncensored Gemma 4 builds I use at home and learned a lot from. Used here as a reference point only, with thanks.
¹ Speeds will be a little higher at the card's stock power limit.