Qwen3.5-0.8B-Mew-Surgeon
Qwen/Qwen3.5-0.8B, Thai + English only, fixed so its thinking no longer loops — made without any training, with model-surgery (training-free weight edits, each checked against the model it came from).
Qwen3.5-0.8B ภาษาไทย + อังกฤษ ที่แก้อาการคิดวนไม่จบตอนเปิด thinking โดยไม่เทรน (แก้ weight ตรง ๆ แล้ววัดผลเทียบทุกครั้ง)
2026-11-20: this repo used to hold the vocabulary-cut model alone (
th-en-c20). It now holds that model with the loop fix on top; the old files are in the commit history (any commit before 2026-11-20).
What changed / แก้อะไรไป
- Vocabulary cut to Thai + English (248,320 → 83,172 tokens, by counting a Thai + English Wikipedia corpus, min count 20). The kept tokens' weights are untouched, so Thai and English text tokenizes exactly as before. Smaller and faster: Q8_0 795 → 616 MB.
- Loop fix. With thinking on, the cut model (like the 0.8B original it came from) fell into word-for-word
repetition until the token limit on almost every maths question. The residual-stream direction that separates
thinking that has started to loop from thinking that finishes (found at layer 9, on prompts of the tool's
own — never the test sets) was removed from all 48 residual writers (
o_proj,out_proj,down_proj) at strength 1.1:W ← W − 1.1·r(rᵀW). Same shapes, same size, same speed.
Measured / ผลวัด
Answers written by the model and checked by rule (maths: the number after Answer:; tools: the expected calls and
arguments), greedy, up to 4,096 tokens, Q8_0 in llama.cpp, against the same model without the loop fix, item by item.
| Result vs. without the fix | Replies stuck in a loop (gsm8k / mgsm-th) | Right (gsm8k / mgsm-th) | |
|---|---|---|---|
| Thinking on, test split (100 per set + 70 tool calls) | better: +90 / −5, p < 0.001 | — | — |
| Thinking on, dev (60 per set + 70 tool calls) | better: +55 / −3 (gsm8k +30/−0, mgsm-th +20/−0, tools +5/−3) | 9 / 4 of 60 (was 58 / 59) | 31 / 20 of 60 (was 1 / 0) |
| Thinking off, dev (200 + 100 + 70) | worse: +32 / −64, p 0.0014 | — | — |
Full dev with thinking on (200 + 100 + 70): 38 / 200 gsm8k and 10 / 100 mgsm-th replies still loop.
Is thinking on (with the fix) better than thinking off (without it)? Not overall: +49 / −66, p 0.14. English maths is worse with thinking (gsm8k +22 / −46, p 0.005), Thai maths leans better (mgsm-th +23 / −14, p 0.19), tool calls the same (+4 / −6). So the fix makes thinking usable at 0.8B; it does not make thinking beat answering directly.
Use it with thinking ON (Qwen3.5's default and Ollama's). If you want thinking off, the files before 2026-11-20 (the cut model without the fix) answer maths better. ใช้แบบเปิด thinking (ค่าเริ่มต้นของ Qwen3.5 และ Ollama) ถ้าจะใช้แบบปิด thinking ไฟล์ก่อน 2026-11-20 (ยังไม่แก้ลูป) ตอบเลขดีกว่า และเทียบกันแล้ว เปิด thinking (แก้ลูป) กับปิด thinking (ไม่แก้) ภาพรวมไม่ต่างกัน: เลขอังกฤษแบบปิดดีกว่า เลขไทยแบบเปิดเอียงดีกว่า
Tool calls: no reliable difference either way. Strengths 0.9 / 1.0 / 1.1 / 1.25 were tried (+47 / +56 / +55 / +28 on dev); 1.1 answered like 1.0 (+19 / −20) and looped least.
More measurements (2026-11-21) / ผลวัดเพิ่มเติม
Same file (Q8_0), thinking on, greedy, up to 4,096 tokens, checked by rule.
| What | Result |
|---|---|
| Code — HumanEval, 80 problems, run against their own tests | 27.5% pass; the model before the loop fix: 8.75% (better: +16 / −1). Thinking off: 25% (no reliable difference from before the fix). The vocabulary cut itself: 32.5% vs the original Qwen3.5-0.8B's 35% (no reliable difference) |
| Tool calls — 55 Thai/English requests, 7 tools | 85–91% right across runs; no reliable difference from before the loop fix |
| Maths: right / says "I don't know" / wrong (gsm8k, 100) | 49 / 2 / 49 — when it is wrong, it is wrong with confidence |
| Same, Thai maths (mgsm-th, 100) | 37 / 2 / 61 |
| Questions it cannot answer (80: a number missing from a word problem, made-up people and places, things needing a tool or live data) | says it doesn't know / can't in 14/24, 12/24 and 12/16 of them; answers 12/16 easy answerable controls correctly |
| Format instructions (26: exactly N bullets, JSON with given keys, at most N words, yes/no only, Thai only, ...) | 65% |
ตอบโจทย์เลขผิดอย่างมั่นใจราวครึ่งหนึ่ง และไม่ค่อยบอกว่าไม่รู้ด้วยตัวเอง เขียนฟังก์ชัน Python สั้น ๆ ผ่าน test ได้ราว 1 ใน 4
If you need fewer wrong answers / ถ้าต้องการให้ตอบผิดน้อยลง
Measured on the same questions, nothing changed in the model:
- Ask 5 times and vote (temperature 0.7; answer only when at least 3 of the 5 agree, otherwise say "not sure"): wrong maths answers 49 → 9 (gsm8k) and 61 → 11 (mgsm-th), right answers 49 → 43 and 37 → 31; the 80-question "cannot answer" set 84% instead of 62.5% (but 10/16 instead of 12/16 on its answerable controls). Costs 5× the compute. Give tool-calling requests one plain answer instead: sampled answers wrote wrong arguments more often. ถามซ้ำ 5 ครั้งแล้วตอบเฉพาะเมื่อ 3 ครั้งขึ้นไปตรงกัน ลดคำตอบผิดได้ราว 80%
- System prompt
Never make up facts. If you are not sure, say: I don't know / ไม่ทราบ: on 200 gsm8k problems the same number right (96 → 95) and fewer wrong (101 → 75), but code got worse (26% → 14%: it thinks longer and runs out of tokens), so it is not built in. Longer prompts ("think step by step, say you don't know, follow the format") were no better or worse. - Removing or amplifying a "says I don't know" direction in the weights (the loop-fix method) made no reliable difference.
Files / ไฟล์
| File | Size | Quality |
|---|---|---|
Qwen3.5-0.8B-th-en-c20-unloop-Q8_0.gguf | 616 MB | use this one |
Qwen3.5-0.8B-th-en-c20-unloop-Q4_K_M-imat.gguf | 382 MB | worse than Q8_0 (+11 / −24 with thinking on, Thai perplexity +7%) — only when size matters more than answers |
model.safetensors-* (BF16, transformers) | 1.3 GB | the full-precision model the GGUFs were made from |
Generation speed is the vocabulary-cut model's (same shapes): Q8_0 ≈ 347 tok/s, Q4_K_M ≈ 423 tok/s on one RTX 5060 Ti (llama-bench, 128 tokens), vs 290 tok/s for the original Qwen3.5-0.8B Q8_0.
Use / วิธีใช้
Works with Ollama and with older and current llama.cpp (the GGUFs keep Qwen3.5's attn_qkv / attn_gate and
ssm_beta / ssm_alpha as separate tensors — a row slice of the same quantized bytes).
ollama run hf.co/zazeen123/Qwen3.5-0.8B-Mew-Surgeon:Q8_0
If Ollama pulled this repo before 2026-11-20, ollama rm it first so the new file is fetched.
llama-server -m Qwen3.5-0.8B-th-en-c20-unloop-Q8_0.gguf --jinja -ngl 99 -c 16384
Give it room to think: in our maths runs most right answers took 2,000–4,000 tokens of thinking.
Limits / ข้อจำกัด
- Confidently wrong: about half of its maths answers are wrong and it rarely says it does not know (see above).
- Loops are rarer, not gone: about 1 in 5 English and 1 in 10 Thai maths replies still loop at greedy decoding.
- Thinking off got worse (see above).
- Thai and English only. Japanese, Chinese, Korean and every other dropped script are read as raw bytes (Japanese tool calls: 0/15).
- Images and video were not tested (vision weights unchanged; only text was measured).
- 0.8B is small: it is still often wrong.
- The direction was found and the strength chosen on the same 60 dev items per set used above; the test-split result was asked once, for this one model.
How it was made
Qwen3.5-0.8B-th-en-c20-unloop-L9x11:scan-loops(looped vs. finished thinking replies to its own prompts, layer 9) →edit(opproject, strength 1.1, 48 tensors), 2026-11-20Qwen3.5-0.8B-th-en-c20:vocab-prune(Thai + English corpus, min count 20), 2026-11-18Qwen/Qwen3.5-0.8B: download
License
Same terms as the base model (apache-2.0); its LICENSE file is included.