The edit
Table | |
|---|
| Tensor | model.language_model.embed_tokens.weight (tied with the output layer) |
| Row | 248069, the </think> token |
| Operation | row multiplied by 1.15 |
| Weights changed | 1,024 (0.00012% of the model) |
Reasoning: at the end of a thinking paragraph the original model gives only a few percent chance to closing its
thinking, and once it is deep in a loop that chance is close to zero. Scaling the </think> row makes the model's own
existing inclination to close count for more, in proportion to how strongly it already holds it. 1.15 was chosen on
48 practice problems; 1.3 and 1.5 made the model close immediately and scatter stray </think> tags through answers.
The full edit record is in EDITS.json.
Results
All numbers are from problems the edit was not tuned on (the held-out half of each set). Sampling: temperature 0.6,
top-p 0.95, top-k 20, no presence penalty. Thinking was capped at 4,096 new tokens.
Thinking on (one run per model)
Table with columns: Original, This model | Original | This model |
|---|
| Code answers still running at the 4,096-token cap (of 210) | 112 | 82 |
| HumanEval, 82 problems (pass) | 17.1% | 23.2% |
| MBPP sanitized, 128 problems (pass) | 23.4% | 26.6% |
| Code problems passed, both sets (of 210) | 44 | 53 |
| Tool calls fully correct (of 20) | 20 | 18 |
| Small terminal tasks passed (of 10) | 7 | 7 |
Thinking off (three runs per model)
Table with columns: Original, This model | Original | This model |
|---|
| HumanEval (pass), three runs | 25.6%, 25.6%, 28.0% | 26.8%, 32.9%, 30.5% |
| MBPP sanitized (pass), three runs | 39.1%, 28.1%, 29.7% | 29.7%, 29.7%, 32.8% |
| Total passes over three runs (of 630) | 189 | 192 |
Honest summary
- Fewer runaway thinking loops: yes. Unfinished answers fell from 112 to 82 of 210. This is the solid result.
- Better at code: not shown. The thinking-on pass gain (44 to 53 of 210) is a single run per model, and the same
model varied by more than that between runs in other tests. With thinking off the two models are level.
- Thinking mode is still worse than no thinking for code. For both models, thinking off scores higher than
thinking on. If you want the best code from this model, turn thinking off.
- Loops are reduced, not removed. 82 of 210 answers still did not finish.
- Possible small cost in tool calling. 18 of 20 correct against 20 of 20 with thinking on; too few cases to tell.
- Not evaluated: SWE-bench, Terminal-Bench, maths benchmarks, instruction following, vision inputs, other sampling
settings, or the 32,768-token limit used in the weight-space programming post.
Several more ambitious edits were tried and did not help: removing a measured "loop" direction from MLP output
weights, weakening copying attention heads, and adding loop-state or paragraph-end signals to the </think> row.
Usage
Use it exactly like the original model; only the weights differ.
from transformers import AutoTokenizer, AutoModelForCausalLMimport torch name = "sandeepselvaraj/Qwen3.5-0.8B-think-close-v0.1"tok = AutoTokenizer.from_pretrained(name)model = AutoModelForCausalLM.from_pretrained(name, dtype=torch.bfloat16) msgs = [{"role": "user", "content": "Write a Python function that reverses a string."}]text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True, enable_thinking=True)out = model.generate(**tok(text, return_tensors="pt"), max_new_tokens=2048, do_sample=True, temperature=0.6, top_p=0.95, top_k=20)print(tok.decode(out[0], skip_special_tokens=True))
License and attribution
Apache 2.0, the same as the base model. All credit for the model itself goes to the Qwen team; see the
original model card for architecture, intended use and limitations.