MoSV-Qwen3-4B-Coder

Qwen3-4B-Instruct-2507 with three small steering experts for engineering questions: debugging, performance and security. One GGUF that stock llama.cpp and LM Studio run. 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.

It teaches how to answer, not new facts. It is not trained to write code better.

What the experts do

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

Results

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 by Claude Haiku with four yes/no behavior checks and one soundness check.

Topic Behavior, base β†’ MoSV MoSV better / worse / same Soundness, base β†’ MoSV Answer tokens Cut off at 2,048 tokens
Debugging 0.09 β†’ 0.59 39 / 0 / 1 0.97 β†’ 1.00 1,533 β†’ 912 0 β†’ 0
Performance 0.21 β†’ 0.47 26 / 2 / 12 0.50 β†’ 0.62 1,544 β†’ 1,488 10 β†’ 1
Security 0.34 β†’ 0.78 29 / 2 / 9 0.70 β†’ 0.75 1,538 β†’ 1,431 9 β†’ 1

Router, tokens of unseen text sent to the right expert (range over the three layers; 4,137 texts):

none debugging performance security
Prompts 99-100% 97-98% 83-87% 87-89%
Answers 99-100% 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.

Use

llama-server -m MoSV-Qwen3-4B-Coder-Q8_0.gguf -ngl 99 -fa on --jinja

Sampling: temperature 0.7, top_k 20, top_p 0.8, min_p 0 (Qwen's own). In LM Studio, load it as any GGUF. The file uses llama.cpp's hy_v3 architecture (a dense model with MoE layers), which recent llama.cpp builds and LM Studio support.

How it was made

  1. Router first: 36,458 texts in four classes. Design questions were sorted into performance or security by Claude Haiku (24,152 labels); bug reports and everyday prompts needed no sorting. 19 minutes.
  2. Answers: Qwen3-4B wrote them itself, told the topic's rules: 81 performance, 95 security (kept if they finished), and the 174 checked debugging answers of MoSV-Qwen3-4B v6.0.1.
  3. Experts: supervised training on those 350 answers with the plain prompt; base frozen, all three experts in one run, best at step 50 of 60, 11 minutes on one RX 9070 XT, 10.2 GB.

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.

Limits

  • The checks test habits, not facts. One judge (Claude Haiku), one round, 40 prompts per topic. The locked test of the earlier models was not run, and untrained topics were not compared with plain Qwen.
  • Performance is the weakest: "what limits it first" 0.00 β†’ 0.15 and "what must stay correct" 0.03 β†’ 0.23. Some of its questions do not fit those habits.
  • Debugging still states invented class or file names as fact in most answers (check passed: 0.00 β†’ 0.05).
  • The performance and security training answers were not quality-checked before training.
  • English only. Not for production use; do not rely on it for security decisions.

License

Base weights: Qwen3-4B-Instruct-2507, Apache-2.0. MoSV experts and router: MIT.

Downloads last month
403
GGUF
Model size
4B params
Architecture
hy_v3
Hardware compatibility
Log In to add your hardware

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for mhndayesh/MoSV-Qwen3-4B-Coder

Quantized
(412)
this model

Collection including mhndayesh/MoSV-Qwen3-4B-Coder