Qwen3-4B-Instruct-2507 with three small steering experts for engineering questions: debugging, performance and security. One GGUF for llama.cpp. Research release.
Part of MoSV (Mixture of Steering Vectors): the base model stays frozen; small experts at three layers (9, 18, 27) are picked per token by a router, or "none", in which case the model answers as plain Qwen. Code and full pipeline: GitHub · other models: MoSV collection. Newer: MoSV-Qwen3-4B (seven topics) · MoSV-Gemma-4-12B (the same seven topics on Gemma 4 12B).
It teaches how to answer, not new facts. It is not trained to write code better.
| Expert | Questions it takes | Habits taught |
|---|---|---|
| debugging | bug reports, without the code | start from what the report shows, tie each cause to a clue, say how to confirm it, keep the fix conditional |
| performance | speed, scaling, caching, data models and queries, services and APIs, events, consistency | say what limits the system first, name the concrete parts, say what must stay correct, what to measure and what it costs |
| security | access, encryption, privacy, attacks, deployment, hosting, monitoring, backups | say who could misuse it and what they reach, what enforces each check, least access, rollback, what stays exposed |
120 prompts no expert or router trained on (40 per topic), plain prompts (no instructions), answered by this GGUF and by plain Qwen3-4B Q8_0 in llama.cpp with Qwen's recommended sampling, each answer judged alone, once, by Claude Haiku with four yes/no behavior checks and one guard. The performance and security prompts come from the router's held-out texts. The 40 debugging prompts are the first 40 of the debugging dev split of the earlier models: never trained on, but not new, and not a locked test.
| Topic | Behavior, base → MoSV | MoSV better / worse / same | Guard, base → MoSV | Answer tokens | Cut off at 2,048 tokens |
|---|---|---|---|---|---|
| Debugging | 0.09 → 0.59 | 39 / 0 / 1 | 0.98 → 1.00 | 1,533 → 912 | 0 → 0 |
| Performance | 0.21 → 0.48 | 26 / 2 / 12 | 0.50 → 0.63 | 1,544 → 1,488 | 10 → 1 |
| Security | 0.34 → 0.78 | 29 / 2 / 9 | 0.70 → 0.75 | 1,538 → 1,431 | 9 → 1 |
Scores are rounded half up to two decimals (performance behavior is 0.475, its guard 0.625, the base debugging guard 0.975).
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. Debugging: does the answer stay on the bug report and propose at least one concrete cause or fix. Performance and security: does it give a clear recommendation that fits the stated situation, with no claim that contradicts the request.
Cut off: base answers that reached the 2,048-token cap did not finish, so the base token means for performance and security are capped, and base checks about the end of an answer may be understated.
Router, tokens of held-out text sent to the right expert (4,137 held-out texts; "none" at layers 9 / 18 / 27, the others as the range over the three layers):
| none | debugging | performance | security | |
|---|---|---|---|---|
| Prompts | 99.3 / 99.5 / 99.4% | 97-98% | 83-87% | 87-89% |
| Answers | 99.5 / 99.9 / 99.7% | 99-100% | 94-96% | 62-67% (8 answers only) |
Held-out loss: plain Qwen 1.205, this model 0.519, plain Qwen told the rules 0.433.
llama-server -m MoSV-Qwen3-4B-Coder-Q8_0.gguf -ngl 99 -fa on --jinja --temp 0.7 --top-k 20 --top-p 0.8 --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 Qwen's recommended sampling (temperature 0.7, top_k 20, top_p 0.8) 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.
LM Studio: set temperature 0.7, top-k 20, top-p 0.8, 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 hy_v3 architecture (a dense model with MoE layers), so other llama.cpp builds that
have it and LM Studio should load it: not tested with this file. (LM Studio's llama.cpp ROCm runtime 2.80.1 ran the
earlier v4 file, which uses the same architecture.)
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-Qwen3-4B-Coder-Q8_0.gguf |
| Released | 2026-12-02 |
| Size | 4,304,120,544 bytes (4.30 GB: Qwen3-4B-Instruct-2507 Q8_0 + 24 MB of experts and routers) |
| sha256 | 801034c627e0de50902072192ba571089fbf9326ee71a54a33bc833e70c2598b |
| Architecture | hy_v3 with per-layer MoE at layers 9, 18, 27: 4 experts each (none, debugging, performance, security), top-1 |
Data: questions from Software Engineering, DBA, Information Security, Stack Overflow, Server Fault and DevOps Stack Exchange (CC BY-SA), architecture decision records, and public bug reports. Pipeline: docs/ROUTER_PIPELINE.md.
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: Qwen/Qwen3-4B-Instruct-2507, Apache-2.0.