A small chat model that answers in Traditional Chinese (Taiwan usage) and keeps Qwen3's thinking mode.
It is Qwen/Qwen3-0.6B fine-tuned with QLoRA on about 17.6k Traditional Chinese examples: 4.4k human-written Q&A pairs (direct answers) mixed with 13.2k reasoning examples (<think>…</think> and then an answer).
The main effect is script and vocabulary: in our test the base model answered in Simplified Chinese in all 5 side-by-side rows we inspected. After fine-tuning it answers in Traditional Chinese, and the count of Mainland-style terms dropped from 15 to 5. TMMLU+ went up slightly (0.289 → 0.311); the English benchmarks did not change significantly in our small test.
Qwen3 is a hybrid thinking model: the chat template has an enable_thinking switch. This model was trained on both modes, so you can turn thinking on (think first, then answer) or off (answer directly).
This repo holds the merged model (LoRA already merged into the base weights), so you can load it directly.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "mikeforai/Qwen3-0.6B-qlora-zhtw-thinking" # change to your repo name
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.float16, device_map="auto")
def chat(question, think=True, max_new_tokens=None):
messages = [{"role": "user", "content": question}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=think
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
# Sampling settings recommended by Qwen3
sampling = dict(temperature=0.6, top_p=0.95) if think else dict(temperature=0.7, top_p=0.8)
out = model.generate(
**inputs, max_new_tokens=max_new_tokens or (1536 if think else 256), do_sample=True, **sampling
)
text = tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
if "</think>" not in text: # thinking off, or thinking was cut off
return "", text.strip()
thought, answer = text.split("</think>", 1)
return thought.replace("<think>", "").strip(), answer.strip()
thought, answer = chat("電腦開機很慢,可能是什麼原因?", think=True)
print("【思考】", thought)
print("【回答】", answer)
print("【直接回答】", chat("電腦開機很慢,可能是什麼原因?", think=False)[1])
Do not use greedy decoding in thinking mode: it tends to repeat forever. Use the sampling settings above.
If you have the adapter files instead of the merged model:
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-0.6B", torch_dtype=torch.float16, device_map="auto")
model = PeftModel.from_pretrained(base, "<adapter-path-or-repo>")
| Base model | Qwen/Qwen3-0.6B (hybrid thinking model) |
| Method | QLoRA (4-bit NF4 base + LoRA adapter), then merged to fp16 |
| Language | Traditional Chinese (zh-TW) |
| Trainable parameters | 10.1M of 606.1M (1.67%) |
| Adapter size | about 39 MB (adapter_model.safetensors) |
| License | Apache 2.0 (base model and Aya dataset); the reasoning dataset is MIT |
| Source | License | Role |
|---|---|---|
Heng666/Traditional_Chinese-aya_dataset |
Apache 2.0 | Direct-answer Q&A. Human-annotated Chinese Q&A from the Cohere Aya project, already converted to Traditional characters by the dataset author. |
twinkle-ai/tw-reasoning-instruct-50k |
MIT | Reasoning examples with a thinking process (think) and a final answer (output). |
Cleaning steps for Aya:
MIN_TARGET_CHARS = 1, so very short answers were kept).The reasoning examples are randomly sampled (seed 42) so that they make up 75% of the training data (REASONING_RATIO = 0.75). This keeps the model from forgetting how to think. Each one is written in the Qwen3 format:
<think>
{think}
</think>
{output}
| Stage | Examples |
|---|---|
| Aya, original | 4,909 |
| Aya, after cleaning | 4,409 |
| Reasoning examples sampled (from 50,000) | 13,227 |
| Total (4,409 direct + 13,227 reasoning) | 17,636 |
| Train / validation split (95% / 5%) | 16,754 / 882 |
| After dropping samples longer than 2,048 tokens | 16,745 / 881 |
Long samples are dropped, not truncated: a truncated reasoning example would teach the model half a thought and no final answer.
Each example is formatted with the Qwen3 chat template. The prompt ending depends on the example type, so training matches inference exactly:
| Example type | enable_thinking |
Prompt ends with | Loss is computed on |
|---|---|---|---|
| Direct answer (Aya) | False |
<|im_start|>assistant\n<think>\n\n</think>\n\n |
the answer |
| Reasoning | True |
<|im_start|>assistant\n |
<think>…</think> and the answer |
Loss is computed only on the model's output, not on the question (prompt labels are -100).
| Setting | Value |
|---|---|
| Hardware | 2 × Tesla T4 (Kaggle) |
| Training time | about 3 h 53 min (13,986 s) |
| Epochs / steps | 1 / 524 |
| Max sequence length | 2048 |
| Batch size | 1 per device × 16 gradient accumulation (effective batch 16) |
| Learning rate | 2e-4, cosine schedule |
| Optimizer | paged_adamw_8bit |
| Precision | fp16 (T4 does not support bf16) |
| Quantization | 4-bit NF4, double quantization, fp16 compute |
| LoRA | r=16, alpha=32, dropout=0.05, bias="none" |
| LoRA targets | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Gradient checkpointing | on (use_reentrant=False) |
| Frameworks | transformers, peft, bitsandbytes, accelerate, datasets |
Final training loss (average): 3.257. The loss is much higher than in a plain Q&A fine-tune because 75% of the tokens are long reasoning text, which is harder to predict. Do not compare it with the loss of a model trained on short answers only.
Base and fine-tuned models were compared with the same 4-bit model object, switching the adapter on and off, so the quantization is identical.
| Step | Eval loss | Perplexity |
|---|---|---|
| 50 | 3.4825 | 32.54 |
| 100 | 3.4003 | 29.97 |
| 150 | 3.3568 | 28.70 |
| 200 | 3.3226 | 27.73 |
| 250 | 3.3002 | 27.12 |
| 300 | 3.2807 | 26.59 |
| 350 | 3.2681 | 26.26 |
| 400 | 3.2575 | 25.99 |
| 450 | 3.2532 | 25.87 |
| 500 | 3.2516 | 25.83 |
| 524 | 3.2515 | 25.83 |
The loss flattened out in the last 100 steps (3.2575 → 3.2516), so a second epoch is unlikely to help much on its own.
20 everyday questions, thinking mode on, sampling with a fixed seed (0) so it can be repeated. We counted 16 Mainland-style terms (視頻, 軟件, 硬件, 質量, 網絡, 默認, 優化, 屏幕, 鼠標, 程序員, 數據庫, 服務器, 打印機, U盤, 博客, 短信) in the final answers (the thinking text is not counted).
| Model | Mainland-style terms |
|---|---|
| Base (Qwen3-0.6B) | 15 |
| This model | 5 |
This count understates the real difference. The keyword list only matches Traditional-character spellings. In the 5 side-by-side rows we inspected, the base model answered in Simplified Chinese (for example "台湾夜市热闹非凡…", "电脑开机慢可能是多种原因造成的…"), and the fine-tuned model answered in Traditional Chinese. Simplified spellings such as 软件 or 视频 are not counted. The count is a rough keyword check, not a quality score. The 5 remaining terms mean the model still uses some Mainland wording: in the computer start-up answer we saw "硬件問題", and a stray Simplified character ("内") inside an otherwise Traditional answer.
lm-evaluation-harness, 0-shot, only 50 questions per sub-task. These tasks compare option probabilities and do not generate text, so thinking mode does not affect them.
| Task | Metric | Base | This model | Std. error (base / this model) |
|---|---|---|---|---|
| TMMLU+ (Taiwan knowledge, all 66 subjects) | acc | 0.289 | 0.311 | 0.008 / 0.008 |
| ARC-Easy | acc | 0.540 | 0.540 | 0.071 / 0.071 |
| ARC-Easy | acc_norm | 0.500 | 0.620 | 0.071 / 0.069 |
| HellaSwag | acc | 0.420 | 0.440 | 0.071 / 0.071 |
| HellaSwag | acc_norm | 0.480 | 0.520 | 0.071 / 0.071 |
TMMLU+ by group (acc):
| Group | Base | This model |
|---|---|---|
| STEM | 0.298 | 0.298 |
| Humanities | 0.254 | 0.297 |
| Social sciences | 0.286 | 0.324 |
| Other | 0.296 | 0.313 |
The ARC-Easy and HellaSwag differences (up to +0.12 on ARC-Easy acc_norm) are all smaller than 2 × the standard error (about 0.14), so we cannot call them real changes; we saw no sign of forgetting English commonsense. The +0.022 on TMMLU+ is bigger than its standard error, but each subject has only 50 questions and the absolute scores are close to the 25% chance level of a four-choice test. Treat it as "slightly better", not as a real knowledge gain.
In thinking mode the model writes a plan first, then the final answer. Example (question: 請用三句話介紹台灣的夜市文化。):
【思考】 首先,我需要理解台灣夜市的文化特徵,並確保描述的三句話能夠清楚且流暢地展現這些特徵。夜市文化在台灣具有多樣性和豐富性,包括小吃、攤販、藝術表演等……
【回答】 台灣的夜市文化充滿了歡樂與熱情,小吃琳琅滿目,攤販熱鬧非凡,還有各種表演活動吸引著遊客。
With enable_thinking=False it answers directly:
台灣的夜市文化以美食和夜市活動為主,充滿活力和熱情,是台灣人放鬆心情的熱鬧之地。
Things to know:
max_new_tokens around 1,536 or more. If it is cut off before </think>, there is no clean split between thinking and answer.twinkle-ai/tw-reasoning-instruct-50k; we did not check their quality ourselves. Follow that dataset's terms if you redistribute the data.transformers, peft, bitsandbytes, and EleutherAI lm-evaluation-harness@misc{qwen3technicalreport,
title = {Qwen3 Technical Report},
author = {Qwen Team},
year = {2025},
eprint = {2505.09388},
archivePrefix = {arXiv}
}
Qwen/Qwen3-0.6B