Qwen3.5-0.8B: Astra Weight Edit
Qwen3.5-0.8B with 2 tensors edited directly by an LLM (GPT-6 Astra),
with no training. This fixes the model's thinking-mode repeat loops.
All credit goes to Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab (MIT CSAIL). I only applied their released
diff and checked that it matches their evaluated checkpoint hash for hash. Not affiliated with or endorsed by the
authors, OpenAI or Qwen.
What changed
The loop direction was subtracted from 64 output columns of mlp.down_proj in layers 15 and 19 (about 130k weights,
0.016% of the model). Everything else is byte-identical to the base model.
How to run
[!IMPORTANT]
The edit only helps with thinking on. The chat template turns thinking off unless you pass
enable_thinking=True. Recommended sampling (the paper's): temperature 0.6, top_p 0.95, top_k 20, presence penalty 1.5.
Transformers (Python)
vLLM
Transformers.js (browser / Node.js)
Which dtype to pick (each graph comes in all five; size is the language-model decoder):
*Next-token argmax agreement with the PyTorch model over a 35-token prompt (spot check). The 4-bit builds lose about as
much against the bf16 base model as they do here, so treat them as noticeably lossy at this size.
llama.cpp / LM Studio / Ollama (GGUF)
LM Studio: search for JonathanColetti/Qwen3.5-0.8B-Astra-WeightEdit. Only a BF16 GGUF is provided (1.56 GB). This is
text only: no mmproj vision file.
How the ONNX and GGUF files were made
Neither was re-exported. I took existing conversions of the same base revision and rewrote only the two edited
tensors, so every other byte matches those well-tested builds:
- ONNX: onnx-community/Qwen3.5-0.8B-ONNX-OPT
@
9a4c21d8. The down_proj tensors of layers 15 and 19 are overwritten in place in each decoder_model_merged*
data file. Before writing, the script regenerates the base tensors from the bf16 weights and requires a
byte-for-byte match with the shipped files in all five dtypes, including the int8/int4 block quantization. So the
edited bytes are exactly what that export pipeline would have produced. embed_tokens* and vision_encoder* are
unchanged copies.
- GGUF: ggml-org/Qwen3.5-0.8B-GGUF
Qwen3.5-0.8B-BF16.gguf
@ 807dfd9a, converted from Qwen revision 2fc06364. blk.{15,19}.ffn_down.weight are swapped after checking that
the base bytes match the base sha256 in astra_edit/manifest.json. The edited bytes
match the edited sha256. Only general.name, general.repo_url and the base-model metadata were changed.
- Checks: the ONNX fp32/fp16/int8 logits match PyTorch (mean KL ≤ 6e-4, same argmax). Transformers.js fp32 greedy
output is token-for-token identical to PyTorch over 120 tokens.
- Scripts:
conversion/.
The root config.json gained a transformers.js_config block, and a minimal generation_config.json
(eos_token_id: [<|im_end|>, <|endoftext|>], no sampling defaults) was added so generation stops at the end of the
turn. The weights, tokenizer and chat template are unchanged.
Independent benchmark
The authors' prompts, sampling and graders (scores + scripts), vLLM bf16, seed 0. MATH-500: 500 × 4
samples. GSM8K: 1,319 × 2. IFEval: 541 × 2, strict prompt-level, official checkers, answer after </think>.
Thinking on: temperature 0.6, top_p 0.95, top_k 20, presence_penalty 1.5, 32k tokens. Thinking off: temperature 0.7,
top_p 0.8, 8k tokens. In parentheses: the share of answers that hit the token limit.
Edited minus base, paired by problem, 95% CI:
All three of the authors' thinking-on results reproduce within about 2 points. The edited model with thinking on also
beats the base model's best setting (thinking off) on every benchmark. With thinking off, the edit costs about 1.5–2
points, which is significant only on MATH-500.
⚠️ This removes a failure mode; it doesn't add capability. Almost all of the gain comes from answers that no longer
loop to the token limit.
TODO
Notes
- The authors' grader (
mathqa.py) imports an internal module (mcqa) that isn't in their release. It's only used for loop
diagnostics, so the benchmark uses a one-function stand-in and leaves their file untouched.
evaluate.py also needs their internal package, so I wrote a small MATH-500 script that copies its prompt,
sampling and vLLM settings.
- Rebuild it yourself with
exp8_math/code/apply_edit.py (base revision 2fc06364). The script checks every tensor's hash.
License
The base model is Apache 2.0 © Qwen (LICENSE). This is a modified version: 2 tensors changed. The edit is
CC BY 4.0, by the authors above.