Gemma 4 12B with three small steering experts that teach it how to answer debugging, teaching and story prompts, without being told. One GGUF for llama.cpp. Research release.
Part of MoSV (Mixture of Steering Vectors): the base model stays frozen; small experts at three layers (12, 24, 36) are picked per token by a router, or "none", in which case the model answers as plain Gemma. Code and full write-up: GitHub · the v6.0.1 paper (archived): paper_v6_0_1.md · earlier versions: mhndayesh/mosv. Newer models: MoSV-Gemma-4-12B (seven topics, on Google's QAT Q4_0 file), MoSV-Qwen3-4B, MoSV-Qwen3-4B-Coder, MoSV-Qwen3-4B-v6.0.1 · all models: MoSV collection.
| Topic | Behavior taught |
|---|---|
| Teaching ("Teach X to a Primary N student") | Speaks to the child directly at the right level, small steps, checks understanding, instead of writing a lesson plan for a teacher |
| Debugging (bug reports) | Ties causes to clues in the report, says how to confirm them. Also trained to separate facts from guesses and to invent fewer names, but those two habits mostly did not take (see Limits) |
| Story | Shows feelings through action, no moral at the end. Also trained to open on something specific instead of weather or mood, which took only partly (see Limits) |
Everything else (everyday questions, math, code, email, explanations) is mostly routed to "none". Not all of it: the router's token accuracy on held-out text is 83% / 97% / 97% at layers 12 / 24 / 36, and some code tokens reach the debugging expert (see Limits).
Locked test: 300 prompts set aside before any training, 7 topics (43 each, engineering 42). The 257 prompts of six topics are judged; the 43 math prompts have no checks and are not scored. Plain prompts (no instructions), answered by this GGUF in llama.cpp with Gemma's recommended sampling, each answer judged alone, once, by Claude Haiku with four yes/no behavior checks and one guard.
| Topic | Prompts | Behavior checks passed, base → MoSV | MoSV better / worse / same | Guard, base → MoSV | Answer tokens |
|---|---|---|---|---|---|
| Teaching | 43 | 0.58 → 0.97 | 41 / 0 / 2 | 0.95 → 0.91 | 986 → 325 |
| Debugging | 43 | 0.17 → 0.44 | 29 / 2 / 12 | 0.98 → 0.95 | 828 → 544 |
| Story | 43 | 0.73 → 0.81 | 17 / 7 / 19 | 1.00 → 1.00 | 860 → 711 |
| Explanation (not trained) | 43 | 0.34 → 0.34 | 9 / 9 / 25 | 0.70 → 0.81 | 736 → 739 |
| Email (not trained) | 43 | 0.69 → 0.69 | 11 / 12 / 20 | 1.00 → 0.98 | 292 → 286 |
| Engineering (not trained) | 42 | 0.77 → 0.71 | 7 / 16 / 19 | 0.69 → 0.79 | 785 → 765 |
Better / worse / same: the number of prompts where the MoSV answer passes more, fewer or the same number of behavior checks as the base answer to the same prompt.
Guard: one more yes/no question per answer, there so that an answer cannot gain habits by getting worse. It is not a general correctness check. Teaching: are the facts taught correct. Explanation: is the main cause given correct. Debugging: does the answer stay on the bug report and propose at least one concrete cause or fix. Story: does the piece fit the request and its form, and is it coherent. Email: does it cover the requested purpose and key points. Engineering: does the code or review look correct for the task.
The dashed line is the ceiling: plain Gemma told the rules in a system prompt. It was measured on 60 dev prompts per topic, not on the test set: teaching 0.99, story 0.83, debugging 0.58. Without any instructions, MoSV comes close to it on teaching (0.97) and story (0.81) and stays below it on debugging (0.44).
On the locked test, answers are 25% shorter over the 257 judged prompts (mean 748 → 561 tokens; over all 300 prompts, math included, 707 → 546; teaching 986 → 325), and untrained topics keep their length. A controlled speed test in llama.cpp (same build and flags, one model at a time, the same 10 prompts, recommended sampling, fixed seed, no prompt cache) shows no measurable speed cost on one card, and 5.7% slower generation in the two-card server test:
| One RX 9070 XT | Base Gemma 4 12B | MoSV v6.0.1 | Change |
|---|---|---|---|
| Generation, llama-bench tg128 | 58.1 tok/s | 60.0 tok/s | +3% (run-to-run spread ±1.2 and ±2.5 tok/s) |
| Generation, server, fixed 512-token answers | 55.4 tok/s | 54.8 tok/s | -1.0% |
| Prompt reading, llama-bench pp512 | 1,973 tok/s | 1,975 tok/s | 0% |
| Answer length (10 prompts) | 783 tokens | 539 tokens | -31% |
| Time per answer | 13.8 s | 9.6 s | -31% |
On two cards (layer split), llama-bench shows no difference (53.1 vs 53.4 tok/s), but the server test does: with fixed 512-token answers 50.17 (base) vs 47.32 tok/s (MoSV), 5.7% slower; with natural answers 46.87 vs 44.51 tok/s. Answers still arrive 23% sooner (16.4 → 12.7 s) because they are shorter (763 → 557 tokens). No answer in the speed test was cut off (0 of 40 reached the 2,048-token limit). Full tables, every answer and all timings: results/speed_v6_0_1.
Measured inside llama.cpp on the shipped GGUF with the project's verify script at the time (git tag
pre-cleanup-2026-12-01; 3 dev prompts per topic + 3 everyday prompts, 48 tokens each;
results/v6_0_1_verify_upd100.json). For each prompt kind: how much the experts change llama.cpp's own next-token
probabilities, and how often they change its top choice.
| Prompts | Change in next-token log-probability | Top token changed |
|---|---|---|
| Teaching (trained) | 1.97 | 22% |
| Debugging (trained) | 1.79 | 33% |
| Story (trained) | 1.63 | 28% |
| Explanation, email, engineering, math (not trained) | 0.13-0.20 | 0-2% |
| Everyday questions (not trained) | 0.21 | 0% |
The router sends trained topics to their experts and leaves everything else close to the plain model. The same
experts measured in PyTorch agree with llama.cpp at 0.89 (correlation of their effect; 1.0 would be identical), so
the shipped experts act like the trained ones, not bit for bit. A chat demo through llama-server --jinja with
hand-written prompts (results/v6_0_1_demo.md): teaching 1,011 → 223 tokens and addressed to the child; the everyday
and coding answers keep the same content and structure as plain Gemma.
llama-server -m MoSV-Gemma-4-12B-v6.0.1-Q4_K_M.gguf -ngl 99 -fa on --jinja --temp 1.0 --top-k 64 --top-p 0.95 --min-p 0 --typical 1.0 --repeat-penalty 1.0 --presence-penalty 0 --frequency-penalty 0 --top-nsigma -1 --xtc-probability 0 --dry-multiplier 0
That is Gemma's recommended sampling (temperature 1.0, top_k 64, top_p 0.95) with every other sampler written out
as off, because llama-server turns some on by itself (min_p 0.05). The tests sent the same values with each request.
Thinking off (chat_template_kwargs: {"enable_thinking": false}) is how it was trained and tested.
LM Studio: set temperature 1.0, top-k 64, top-p 0.95, min-p 0, repeat penalty 1.0 (off), and leave every other sampler off.
What was tested: llama-server from one local Windows Vulkan build of a llama.cpp fork, on AMD RX 9070 XT
cards. The file uses llama.cpp's gemma4 architecture, so other llama.cpp builds that have it and LM Studio should
load it: not tested.
Built and tested on AMD only (RX 9070 XT, Vulkan; training with ROCm PyTorch on Windows). NVIDIA is untested and the training code may need changes there; contributions are welcome on GitHub.
| File | MoSV-Gemma-4-12B-v6.0.1-Q4_K_M.gguf |
| Released | 2026-11-27 |
| Size | 7,157,621,344 bytes (7.16 GB: Gemma 4 12B Q4_K_M + 36 MB of experts and routers) |
| sha256 | 8c89bf0b1f10281e6c1bf5a7a835eea50aa73d7010bee3c4bdb6f2c104e5657e |
| Architecture | gemma4 with per-layer MoE at layers 12, 24, 36: 4 experts each (none, debugging, story, teaching), top-1 |
An earlier attempt with RL (a judge ranking sampled answers) gave no gain on this model; why is in the v6.0.1 paper (archived, linked above).
Code, MoSV experts, routers and steering vectors: MIT (free to use, change and sell, keep the notice). The GGUF also contains the base model's weights, which stay under the base model's own license: google/gemma-4-12B-it, Apache-2.0 (Gemma 4 license).
Idea from T. H. S. Meral et al., RL Post-Training in Diffusion Transformers Is Activation Steering, arXiv:2611.26627.