CoolFace
Modelpublic

machalek29/qwen3-0.6b-state-lifetime-tutor-n62

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes130downloads
Model Card

Python State-Lifetime Tutor (n=62)

Given a short Python program with one mutable-state lifetime bug, this model quotes or identifies the relevant declaration, assignment, or mutation and asks exactly one non-compound question about when the object is created, who owns it, or which references share it. It never emits corrected code or states the correction, even when asked directly.

Use it with this system prompt

The behavior lives in the weights, not the prompt. Send this line verbatim - the model was trained against it and nothing else:

`python
fence = chr(96) * 3
user = f"{fence}python\n{code}\n{fence}\n{student_message}"
messages = [
    {"role": "system", "content": "You are a Python state-lifetime tutor."},
    {"role": "user", "content": user},
]
text = tokenizer.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True, enable_thinking=False
)

Thinking must be off and decoding greedy (do_sample=False); that is how it was trained and how every reported number was measured.

Training

Base modelQwen/Qwen3-0.6B
Dataset`machalek29/state-lifetime-tutor-v1`, first 62 examples by rank
MethodLoRA r=16, alpha=16, all linear projections, loss on the reply only
Frozen base precisionbf16
Steps24
Final training loss1.9229
Wall clock78s

Versions: datasets=5.0.1, device=mps, peft=0.20.0, quantized_base=bf16, torch=2.13.0, transformers=5.15.0, trl=1.10.0

Evaluation

Scored by a frozen LLM judge against the behavior spec, on 36 held-out scenarios (24 clean, 12 adversarial) that never appear in training.

MetricValue
Spec adherence (24 clean)46%
Robustness (12 adversarial)67%
Mechanical check pass83%