An LLM-Edited Qwen3.5-0.8B: Math Without Training, via Weight Edits
A 0.8B model whose weights were edited by an LLM, with no training, to stop thinking loops. Run it with vLLM, see the numbers, and know the caveats.
The code in this post comes from the model's docs and hasn't been run in our CI yet. If something breaks, let us know.
RikiyaT/Qwen3.5-0.8B-weight-space-programming is Qwen3.5-0.8B with two tensors changed. It comes from Experiment 8 of the post “Sparks of Weight-Space Programming”. A frontier LLM was asked to make the base model better at math by editing its weights directly. There was no gradient descent and no training. The notable part is how small the change is: the card says the edit touches 131,072 weights, 0.016% of the model.
What’s new
According to the card, the editing LLM (“Astra”) worked in a Python session over the weights with a budget of 50 forward passes on practice problems from the GSM8K and MATH training sets. It traced the base model’s thinking loops to one direction written by the MLPs of layers 15 and 19. It then subtracted that direction from 64 output columns of down_proj in each layer.
The base model “loops until the token limit on almost every math problem”. The edited one mostly doesn’t.
Results reported in the post (thinking on, up to 32,768 tokens, several samples per problem):
| Qwen3.5-0.8B | MATH-500 (%) | GSM8K (%) | IFEval (%) | Hit token limit (%) |
|---|---|---|---|---|
| Base | 7.9 | 13.8 | 21.0 | 93.0 |
| Edited (this model) | 48.1 | 67.1 | 62.3 | 33.1 |
The card also includes an independent re-run of this checkpoint on the full MATH-500 (500 problems, 4 samples each, 2,000 generations). It scored 51.0%, with 31.6% of answers hitting the token limit. That run took 51 minutes on an H200. The card’s 25-problem smoke test of the base model gave 5.0%, with 95% hitting the limit.
Other facts from the card:
- License: Apache 2.0. Base model:
Qwen/Qwen3.5-0.8B. - Only
model.language_model.layers.15.mlp.down_proj.weightandmodel.language_model.layers.19.mlp.down_proj.weightdiffer from the base model. The card publishes sha256 hashes for both. - This is the full multimodal release. The post evaluated a text-only export, but the language-model tensors are identical (hash-verified), and text prompts don’t use the vision tower.
Install
The card doesn’t give an install command. Its usage snippet imports vllm and transformers, and its re-run used vLLM 0.33.0 and transformers 5.20.2, so this pins those versions.
pip install "vllm==0.33.0" "transformers==5.20.2"Run it
This is the card’s example, unchanged in substance. It builds a chat prompt with thinking enabled and samples with the settings the card uses for its evaluation.
from vllm import LLM, SamplingParamsfrom transformers import AutoTokenizer
ckpt = "RikiyaT/Qwen3.5-0.8B-weight-space-programming"tok = AutoTokenizer.from_pretrained(ckpt)llm = LLM(model=ckpt, dtype="bfloat16", max_model_len=34816)
prompt = tok.apply_chat_template( [{"role": "user", "content": "What is $2^{10} + 24$?\nPlease reason step by step, and put your final answer within \\boxed{}."}], tokenize=False, add_generation_prompt=True, enable_thinking=True)sp = SamplingParams(n=1, temperature=0.6, top_p=0.95, top_k=20, presence_penalty=1.5, max_tokens=32768, seed=0)print(llm.generate([prompt], sp)[0].outputs[0].text)Two details matter. The prompt asks for step-by-step reasoning and a final answer in \boxed{}, and enable_thinking=True turns on the thinking mode that the benchmarks used.
Gotchas
- Loops are reduced, not removed. About a third of generations still hit the 32,768-token limit in both the post’s numbers (33.1%) and the independent re-run (31.6%). Budget for long generations and have a fallback.
- The settings are specific. The card’s scores use thinking on, temperature 0.6, top_p 0.95, top_k 20, presence_penalty 1.5 and up to 32,768 new tokens. The card doesn’t say how the model behaves with other settings.
- Scores are not a general ranking. The numbers cover MATH-500, GSM8K and IFEval. The card doesn’t compare this model with other models, so don’t read them as a claim about small models in general.
- Text-only evidence. Only two language-model tensors differ from the base model, but the card evaluates text prompts only and reports no image results.
- The 51.0% and 48.1% are different runs. The first is the independent re-run and the second is from the post, so expect some variation between runs.
When to pick it
Pick it if you want a very small Apache-2.0 model for step-by-step math problems and you can afford long generations, or if you want to study weight-level editing. The card publishes the diff, the hashes and the rebuild code, so you can check exactly what changed. The method is documented in the linked blog post and the lm_understand-logs repository.
Skip it if you need reliable answers within a short token budget, since a third of generations can still run to the limit. Skip it too if you need evidence on tasks outside the three benchmarks, because the card has none. For those cases, test the model on your own problems first.
Related
Olala 1.0 Mini: a 1B-Active Hybrid Mamba Model for Chat and Tools
OVHai LLM's Apache-2.0 reasoning model has 6.8B parameters but ~1B active. How to serve it with vLLM, set reasoning effort, call tools and fine-tune it.
OVHaiLLM/Olala-v1.0-mini-7A1B
Run Mistral Large 4: 1T MoE with Reasoning Effort and JSON Schemas
Mistral Large 4 is a 1T-parameter multimodal MoE with 1M context. Serve it with vLLM, set reasoning effort, and enforce strict JSON schemas.
mistralai/Mistral-Large-4-1T-A52B
Run Spark-X2.6-4B: a 4B On-Device Model with Adjustable Thinking
Spark-X2.6-4B is an Apache-2.0 4B model for agents, coding and long context. Run it with Transformers, SGLang, vLLM or Ollama, per the model card.
XHToken/Spark-X2.6-4B