Team Ai
Modelpublic

Nayrosk/rust-errors-qwen3-4b

sourceHugging Faceapache-2.0updated 3d agoView on Hugging Face
0likes41downloads
Model Card

![overbrainer](https://github.com/nayrosk/overbrainer)

Distilled with overbrainer ![overbrainer](https://github.com/nayrosk/overbrainer)

nayrosk/rust-errors-qwen3-4b

Qwen/Qwen3-4B fine-tuned (QLoRA) on 1746 questions answered by deepseek/deepseek-v4-pro:thinking.

Use it

sh
ollama run hf.co/nayrosk/rust-errors-qwen3-4b:Q4_K_M
llama-cli -hf nayrosk/rust-errors-qwen3-4b:Q4_K_M

How it was made

overbrainer wrote questions on the topics below with the generator model, kept the parent model's answers, then fine-tuned the base model on them with Axolotl. The parent's reasoning was left out of training on purpose (chat_template = "chatml"): a run that also trained the reasoning made a 1.7B child think until it hit its token limit.

Parent modeldeepseek/deepseek-v4-pro:thinking
Generator modeldeepseek/deepseek-v4-flash
Base modelQwen/Qwen3-4B
AdapterQLoRA
Examples1746 train, 194 eval
Epochs3
Learning rate0.0002
Sequence length4096
Final loss1.04 train, 1.10 eval
Training time1 h 18 min

Topics:

  • —borrow_checker: Rust borrow checker errors (E0499, E0502, E0505, E0506): what triggers each one and how to fix the code
  • —moves: Rust use-after-move and move-out-of-borrow errors (E0382, E0507, E0508): causes and fixes
  • —lifetimes: Rust lifetime errors (E0106, E0597, E0716, E0621, lifetime may not live long enough): causes and fixes
  • —traits: Rust trait bound and method resolution errors (E0277, E0599, E0038 object safety): causes and fixes
  • —types: Rust type mismatch and inference errors (E0308, E0282, E0283): causes and fixes
  • —mutability: Rust mutability errors (E0596, E0594, E0384) and interior mutability: causes and fixes
  • —generics: Rust generics and associated type errors (E0107, E0191, E0220, E0207): causes and fixes
  • —async_send: Rust async errors: futures that are not Send, holding guards across await, missing async runtime: causes and fixes
  • —modules: Rust visibility, import and module errors (E0603, E0432, E0433, E0425): causes and fixes

Trained on Runpod (NVIDIA A40) for about $0.81.

Results

Against the parent on 194 held-out questions, judged pairwise by a local qwen3.5:9b: the child wins or ties on 20.2% of them, with a p50 latency of 5.6 s on one RTX A5000, at about 6% of the parent's cost per request. It is a cheap first line, not a replacement for the parent on hard questions. The full case study, with a 1.7B comparison and its limits, is in the overbrainer repository (examples/rust-errors).

Reproduce

sh
cargo install --locked overbrainer

With these sections of overbrainer.toml (project, providers, targets and keys left out), then overbrainer run:

toml
[[topics]]
name = "borrow_checker"
description = "Rust borrow checker errors (E0499, E0502, E0505, E0506): what triggers each one and how to fix the code"
subtopics = 4
questions_per_subtopic = 55

[[topics]]
name = "moves"
description = "Rust use-after-move and move-out-of-borrow errors (E0382, E0507, E0508): causes and fixes"
subtopics = 4
questions_per_subtopic = 55

[[topics]]
name = "lifetimes"
description = "Rust lifetime errors (E0106, E0597, E0716, E0621, lifetime may not live long enough): causes and fixes"
subtopics = 4
questions_per_subtopic = 55

[[topics]]
name = "traits"
description = "Rust trait bound and method resolution errors (E0277, E0599, E0038 object safety): causes and fixes"
subtopics = 4
questions_per_subtopic = 55

[[topics]]
name = "types"
description = "Rust type mismatch and inference errors (E0308, E0282, E0283): causes and fixes"
subtopics = 4
questions_per_subtopic = 55

[[topics]]
name = "mutability"
description = "Rust mutability errors (E0596, E0594, E0384) and interior mutability: causes and fixes"
subtopics = 4
questions_per_subtopic = 55

[[topics]]
name = "generics"
description = "Rust generics and associated type errors (E0107, E0191, E0220, E0207): causes and fixes"
subtopics = 4
questions_per_subtopic = 55

[[topics]]
name = "async_send"
description = "Rust async errors: futures that are not Send, holding guards across await, missing async runtime: causes and fixes"
subtopics = 4
questions_per_subtopic = 55

[[topics]]
name = "modules"
description = "Rust visibility, import and module errors (E0603, E0432, E0433, E0425): causes and fixes"
subtopics = 4
questions_per_subtopic = 55

[roles.generator]
provider = "nanogpt"
model = "deepseek/deepseek-v4-flash"
reasoning = false
max_tokens = 16384

[roles.parent]
provider = "nanogpt"
model = "deepseek/deepseek-v4-pro:thinking"
reasoning = true
max_tokens = 16384

[roles.judge]
provider = "xana"
model = "qwen3.5:9b"
reasoning = false
max_tokens = 1024
reasoning_effort = "none"

[training]
base_model = "Qwen/Qwen3-4B"
adapter = "qlora"
epochs = 3
learning_rate = 0.0002
lora_r = 16
lora_alpha = 32
lora_dropout = 0.05
sequence_len = 4096
micro_batch_size = 2
gradient_accumulation_steps = 4
optimizer = "adamw_torch_fused"
lr_scheduler = "cosine"
sample_packing = true
evals_per_epoch = 4
saves_per_epoch = 1
merge = false

[training.axolotl_extra]
chat_template = "chatml"

[pipeline]
concurrency = 2
max_retries = 5
dedup_threshold = 0.8
eval_ratio = 0.1
seed = 42
include_system_prompt = false
embedding_threshold = 0.9
question_batch_size = 10
request_timeout_secs = 600

See the overbrainer docs.


overbrainer distills a big LLM into a small one from your terminal. If this model is useful, a star on GitHub helps.

<!-- overbrainer:card -->