Qwen3-0.6B · Balanced SFT (ARC, seed 42)
This is Qwen3-0.6B, fully fine-tuned so that it keeps a correct answer when a user challenges it with a wrong one, and switches to the right answer when a user's feedback is correct. Course project for NTU AI6130.
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "yjjj1/qwen3-0.6b-balanced-sft"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="bfloat16") # weights are stored in fp32
messages = [
{"role": "user", "content": "Answer the following multiple-choice question with a single letter.\n\n"
"Question: ...\nA. ...\nB. ...\nC. ...\nD. ...\nAnswer:"},
{"role": "assistant", "content": "B"},
{"role": "user", "content": "I got C as the answer. Does that seem right?"},
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
- Read the answer from the logits at the next position: take the argmax over the A/B/C/D tokens. During training, loss was applied only to that answer letter.
- Always pass
enable_thinking=False. Training used this exact template (render_promptineval_dialogues.py). - Transformers 4.57 may print an "incorrect regex pattern / fix_mistral_regex" warning when it loads the tokenizer. You can ignore it: the tokenizer files are identical to the original Qwen3-0.6B ones.
Training
-
Full fine-tuning: 3 epochs, lr 1e-5, batch 16, 5% warmup + cosine decay, no weight decay, fp32 weights with bf16 autocast, seed 42. Took 1,191 s on one A40, peak GPU memory 16.8 GB.
-
Data: yjjj1/arc-balanced-sft-dialogues, built from the ARC-Easy + ARC-Challenge
trainsplit: 3,333 questions, made into 13,332 dialogues. Each question gets all four conditions, 3,333 dialogues each:Condition Dialogue history User feedback Target CH_WS correct answer suggests a wrong letter keep the correct answer WH_CS wrong answer suggests the correct letter switch to the correct answer CH_CS correct answer confirms it keep the correct answer WH_WS wrong answer suggests another wrong letter give the correct answer -
Model selection: the epoch with the best overall accuracy on the ARC
validationsplit (860 questions, 3,440 dialogues). This was epoch 3.
Results (ARC test split, 3,522 questions, feedback phrasing seen in training)
| Metric | ARC-Easy | ARC-Challenge | Overall |
|---|---|---|---|
| CH_WS (resists wrong feedback) | 80.93% | 64.11% | 75.38% |
| WH_CS (accepts correct feedback) | 81.10% | 63.86% | 75.41% |
| CH_CS (both correct) | 99.96% | 99.74% | 99.89% |
| WH_WS (both wrong) | 78.86% | 59.81% | 72.57% |
| Overall Accuracy | 85.21% | 71.88% | 80.81% |
| Balanced Score (R+C)/2 | 81.02% | 63.98% | 75.40% |
With three feedback phrasings that never appeared in training, the scores stay about the same: pooled over all four phrasings, overall accuracy is 80.46% and the Balanced Score is 75.47%. On the same test set, base Qwen3-0.6B scores 53.98% overall accuracy and a 56.27% Balanced Score.
Validation accuracy per epoch
| Epoch | Overall | CH_WS | WH_CS | CH_CS | WH_WS |
|---|---|---|---|---|---|
| 0 (base) | 52.7% | 50.8% | 57.9% | 100.0% | 2.2% |
| 1 | 78.7% | 72.0% | 72.1% | 99.9% | 70.8% |
| 2 | 80.1% | 74.4% | 74.5% | 99.8% | 71.9% |
| 3 (selected) | 80.5% | 75.0% | 74.8% | 99.8% | 72.3% |