Qwen3.5-0.8B-weight-edited
targeted weight edits for Python function names
3 min readupdated
This model tackles a common headache with small coding models: when a prompt includes a test call but leaves out the function signature, the model writes valid code under a different function name and fails the tests. Built by zzzmahesh from Qwen/Qwen3.5-0.8B (0.87B parameters, Apache-2.0 license), it skips gradients, training, or a LoRA (a small adapter added on top of a base model) in favor of two analytical weight-edit steps. Across six tensors in layers 14 and 18, 16,426 values are modified — effectively swapping six feed-forward neurons (feed-forward layers inside a transformer) that control signal volume and attention routing toward the right function name. Developers running lightweight models locally will find this handy when they want fewer renamed functions in signature-free prompts.
Key features
- Two closed-form weight-edit steps with no gradients, optimizer, LoRA, or fine-tuning.
- Only 16,426 values in
model.layers.14.mlp.{gate,up,down}_proj.weightandmodel.layers.18.mlp.{gate,up,down}_proj.weightare changed, leaving all other weights untouched. - Targets two mechanisms: boosting layer 15 attention-head outputs when reading the name from a test call and steering attention in layers 15 and 19 when writing
def. - Cuts MBPP+ responses missing the expected function name from 121 down to 42 out of 378 tasks.
What you can do
- Drop the checkpoint into a local Python code-generation script when tasks are specified via a call example rather than a function header.
- Use the model as a lightweight local draft-function generator in a pipeline where generated code goes straight into unit tests.
- Benchmark its behavior on signature-free tasks against stock
Qwen/Qwen3.5-0.8Binside the sametransformersruntime.
Example
Model-card scenario: a prompt gives a Python test call without specifying the function signature. The model slips up less often on the name in def and matches the expected function name more frequently, though the edits do not improve core program logic, and most tasks remain tough for a 0.8B model.
Read more
DetailsMBPP+ (pass@1, thinking off): 31.2% vs. 23.8% for the base model (+7.4 +/- 1.9); HumanEval+: 28.7% vs. 28.7% (+0.0 +/- 1.5); external set of 400 MBPP-style tasks: 37.8% vs. 34.0% (+3.8 +/- 1.7).
Tokenizer, chat template, and config were not changed; gains in reasoning mode were not confirmed (2 extra solved tasks across 240 examples).
Improvements apply only to prompts with a test call and no function signature; images and video were not tested after the edits.
The full list of changes is saved in
wsp_edits.json in the repository.









Comments