Gemma 4 26B-A4B · Opus-reasoning tune (GGUF)
A LoRA fine-tune of Google's Gemma 4 26B-A4B (QAT) on ~8.6k Claude Opus 4.6/4.7-style reasoning conversations, plus an abliterated variant made with Heretic. Both are Q4_K_M GGUFs for llama.cpp.
This was a learning project on a single home machine (GMKtec EVO-X2, Ryzen AI Max+ 395 / Radeon 8060S, 128 GB). I'm sharing it because the settings below make it run quickly on bandwidth-limited hardware like Strix Halo, and the results are written up honestly, small gains included.
Files
| File | What it is |
|---|---|
gemma-4-26B-A4B-opus-reasoning-Q4_K_M.gguf | Fine-tuned model (16.8 GB) |
gemma-4-26B-A4B-opus-reasoning-abliterated-Q4_K_M.gguf | Same, plus Heretic abliteration (16.8 GB) |
adapter/ | The LoRA itself (safetensors, r16), if you want to merge it into another Gemma 4 26B-A4B build |
Not included, get them from unsloth/gemma-4-26B-A4B-it-qat-GGUF:
- Vision:
mmproj-BF16.gguf. The vision tower was not trained, so the stock projector works (tested). - MTP draft head:
mtp-gemma-4-26B-A4B-it.gguf(~250 MB). Optional, but gives about +45% generation speed (see below).
TL;DR
- Accuracy: about the same as stock Gemma 4. Slightly better on hard reasoning and knowledge in my tests, but within noise.
- Thinking efficiency: about 14% fewer thinking tokens than stock on hard problems, with fewer runaway thoughts that hit the token limit.
- Less moralising: the Opus-style data alone cut lecture-style disclaimers on borderline prompts from 8 to 3 (out of 27).
- Abliterated variant: no hard refusals on my over-refusal suite, and with thinking on at temp 1.0 it scored as well as the fine-tune on reasoning and knowledge.
- Speed: with the MTP draft head, about 85 tok/s on a Radeon 8060S (Vulkan), compared with about 60 tok/s without it.
Recommended settings
Use thinking with temperature 1.0. That's Google's recommendation, and my tests agree strongly (see the temperature table). At low temperature, Gemma 4's thinking tends to loop until it hits the token limit, and the abliterated variant is the most affected.
llama-server \
-m gemma-4-26B-A4B-opus-reasoning-abliterated-Q4_K_M.gguf \
--mmproj mmproj-BF16.gguf \
-md mtp-gemma-4-26B-A4B-it.gguf -ngld 999 --spec-type draft-mtp \
-ngl 999 -c 65536 -np 4 -fa on -ctk q8_0 -ctv q8_0 --jinja \
--temp 1.0 --top-k 64 --top-p 0.95 --min-p 0
Thinking is toggled with Gemma 4's normal chat template (chat_template_kwargs: {"enable_thinking": true} or a reasoning-effort setting in your client).
Tested with llama.cpp b11840, Vulkan backend, Ubuntu, kernel 7.0.
Results
The benchmarks are my own small suites, the same ones I use to pick models for my home setup:
- hard: 34 multi-step maths, logic and coding problems with checkable answers.
- knowledge: 46 factual questions.
- refusal: 27 borderline but legitimate requests (crude humour, a profane limerick, safe caffeine and alcohol limits, sex-ed, how phishing works, harmless pranks). A point means a clean answer; refusing, lecturing or dodging the request scores zero.
Every suite ran once per setting, so a difference of about 2–3 on the hard suite is within run-to-run noise.
As reference points, I ran the two Gemma 4 26B-A4B builds I already had on the same box under identical settings: stock Gemma 4 (Unsloth's UD-Q4_K_XL QAT GGUF) and HauhauCS's Gemma4-26B-A4B-QAT-Uncensored "Balanced", which I use day to day and which made a good sanity check for the abliterated variant.
Thinking on, temp 1.0 / top-p 0.95 / top-k 64 (recommended)
| Model | Hard (34) | Knowledge (46) | Refusal (27) | Tokens per hard problem | Hit token limit |
|---|---|---|---|---|---|
| Stock Gemma 4 | 28 | 45 | 19 | 9,937 | 6 |
| This model (opus) | 29 | 46 | 24 | 8,559 | 5 |
| This model (abliterated) | 28 | 46 | 25 | 9,568 | 5 |
| HauhauCS Uncensored Balanced | 27 | 45 | 23 | 10,618 | 7 |
Thinking off, temp 0.6 / top-p 0.95
| Model | Hard (34) | Knowledge (46) | Refusal (27) |
|---|---|---|---|
| Stock Gemma 4 | 31 | 44 | 20 |
| This model (opus) | 29 | 46 | 22 |
| This model (abliterated) | 28 | 45 | 22 |
| HauhauCS Uncensored Balanced | 29 | 45 | 22 |
With thinking off, all four are within noise of each other.
Temperature sensitivity (thinking on, hard suite)
| Model | Temp 0.3 | Temp 0.6 | Temp 1.0 |
|---|---|---|---|
| Stock Gemma 4 | 19 | 25 | 28 |
| This model (opus) | 22 | 27 | 29 |
| This model (abliterated) | 16 | 23–24 | 28 |
The low-temperature drop comes almost entirely from answers that never finish thinking. At temp 0.3, 12–17 of the 34 problems hit the token limit, compared with 5–6 at temp 1.0. Don't run Gemma 4 thinking at low temperature.
What's left on the refusal suite
With thinking on at temp 1.0, the abliterated variant's two misses were a "drink responsibly" note and a hangover answer that was flagged as lecturing. Abliteration removes refusals, but some health-topic disclaimers remain.
Political lean (12axes)
I ran all 288 statements of the original 12axes quiz (MIT), using its own long-quiz scoring. Settings: thinking off, temperature 0, and a prompt asking for exactly one of the seven answer options. This is my own harness. UGI's exact prompt and settings aren't published, so expect different numbers there.
Scores are % toward the first-named pole (50 = centre; the quiz labels 40–60 as "Neutral"):
| Axis | Stock | Opus | Abliterated | HauhauCS |
|---|---|---|---|---|
| Federal ↔ Unitary | 51 | 52 | 51 | 50 |
| Democratic ↔ Autocratic | 56.5 | 57 | 55 | 56.5 |
| Internationalist ↔ Nationalist | 55 | 51 | 53 | 59.5 |
| Militarist ↔ Pacifist | 43 | 45 | 46.5 | 46 |
| Freedom ↔ Security | 50 | 48 | 48.5 | 50.5 |
| Collectivize ↔ Privatize | 49 | 50 | 50.5 | 49 |
| Irreligious ↔ Religious | 46 | 48 | 48 | 50.5 |
| Progressive ↔ Traditional | 42.5 | 46 | 50 | 45.5 |
| Multicultural ↔ Assimilationist | 42.5 | 44 | 45.5 | 42 |
| Planned ↔ Markets | 50 | 49 | 51 | 47.5 |
| Globalism ↔ Protectionism | 47 | 46.5 | 46.5 | 46 |
| Technology ↔ Bioconservative | 51 | 53.5 | 50.5 | 53 |
All four land in "Neutral" on every axis, and neither the fine-tune nor the abliteration moved the lean in any meaningful way. What did change is how often the model takes a position at all:
| Model | Answered "Neutral/Unsure" (of 288) | Declined to answer |
|---|---|---|
| Stock Gemma 4 | 201 (70%) | 1 |
| This model (opus) | 203 (70%) | 2 |
| This model (abliterated) | 145 (50%) | 0 |
| HauhauCS Uncensored Balanced | 109 (38%) | 2 |
The abliterated variant commits to an answer much more often, mostly "Partially Agree". Statements are balanced between the two poles, so this mild agreement largely cancels out on the axes.
Speed (Radeon 8060S, Vulkan, single request, thinking off)
| Setup | Generation speed | MTP draft tokens accepted |
|---|---|---|
| Without MTP | ~60 tok/s | – |
| With MTP draft head + q8 KV cache | ~85 tok/s | ~55–62% |
The stock MTP head still predicts this fine-tune and the abliterated weights well. Acceptance was the same as on the other Gemma 4 builds I tested.
Combining the speed with the token savings on a hard thinking problem (temp 1.0): stock without MTP takes about 9.9k tokens at about 60 tok/s (~2.8 min), and this model with MTP takes about 8.6k tokens at about 87 tok/s (~1.6 min).
How it was made
Fine-tune (Unsloth 2026.10.8, transformers 5.17, TRL 1.15, one H100 80GB, 64 min):
- Base:
google/gemma-4-26B-A4B-it-qat-q4_0-unquantized, loaded in 16-bit (not QLoRA, which isn't recommended for MoE). - LoRA r16, alpha 16, dropout 0, on attention and MLP/expert projections of the language model; vision layers frozen. 494M trainable parameters (1.9%).
- 1 epoch over 8,643 conversations. Learning rate 1e-4, cosine schedule, 20 warm-up steps, effective batch 16, adamw_8bit, max length 8192.
- Loss only on the final assistant turn, including its thinking. Earlier turns are context only, because Gemma's template strips thinking from history.
- 75% of examples trained with thinking on (
<|channel>thought … <channel|>), 25% with thinking off, so both modes keep working. - Eval loss on 50 held-out conversations went from 1.468 to 1.298 and was flat for the last ~150 steps, with no sign of overfitting.
Data: angrygiraffe/claude-opus-4.6-4.7-reasoning-8.7k (Apache-2.0). That's 28 categories, about 40% multi-turn, with synthetic reasoning traces. I dropped 13 rows that were broken or over length.
Abliteration: Heretic 1.4.0 on the merged 16-bit model, with 100 trials (30 random start-up trials) and default prompt sets (mlabonne harmless/harmful). I picked trial 44: 25/100 refusals on Heretic's harmful set (from 100/100), KL divergence 0.046.
- Parameters: direction_index 19.12; attn.o_proj max_weight 1.50 at position 22.20, min_weight 1.41, min_weight_distance 12.79; mlp.down_proj max_weight 1.43 at position 17.62, min_weight 1.23, min_weight_distance 3.84.
- Heretic edits attention output and the shared dense MLP down-projection in each of the 30 layers, not the 128 routed experts. That may be why no trial got below about 25/100 on its strict harmful set.
Export: merged to 16-bit, converted to GGUF with llama.cpp's convert_hf_to_gguf.py, then quantized to Q4_K_M. 60 of the 658 tensors used llama.cpp's
standard fallback quant types, which is normal for this architecture.
Limitations
- Small benchmarks, single runs. Treat a gap of 1–3 points as a tie. The token savings and the temperature behaviour were consistent across all three test nights; the accuracy differences were not.
- It writes like Opus but doesn't know what Opus knows. It's a 4B-active model. In long-form answers it can produce confident, plausible-looking citations that don't exist, so verify references.
- Text-only fine-tune. Vision is stock Gemma 4. It works, but it wasn't trained or benchmarked here.
- Only Q4_K_M. If there's interest, I can make other quants from the adapter.
- The abliterated variant answers requests the stock model refuses. You are responsible for how you use it.
Credits
- Google for Gemma 4 and the QAT weights.
- Unsloth for the training stack and the GGUF, mmproj and MTP files.
- angrygiraffe for the dataset.
- p-e-w for Heretic.
- llama.cpp contributors.
- HauhauCS, whose Uncensored Gemma 4 build I run at home and used as a reference point.