Exploring Weight-Space Programming: Capabilities, Generalization, and Limitations
Organizations: Shanghai Artificial Intelligence Laboratory · Tongji University · Fudan University
Abstract
Weight-Space Programming (WSP) enables reasoning agents to directly inspect and modify neural network parameters, offering an alternative to gradient-based model adaptation. However, its capabilities, cross-task generalization, and practical limitations remain insufficiently understood. We systematically investigate WSP through 16 editing trajectories across seven benchmarks and two model scales (Qwen3.5-0.8B and Qwen3.5-9B). Our findings reveal three key insights. First, WSP can achieve substantial performance gains through highly localized interventions. On full held-out evaluations, accuracy improves by up to 29.45, 4.42, 36.72, and 17.11 percentage points on MATH-500, GPQA Diamond, IFEval, and SciBench, respectively. Notably, modifying only 1,023 parameters yields a 29.45-point improvement. Second, WSP exhibits promising but uneven cross-task generalization. A Math-edited checkpoint improves GPQA Diamond, IFEval, and SciBench by 3.03, 12.18, and 20.10 points, respectively, without further editing, while leaving SciCode performance unchanged. Third, effective editing remains challenging and inconsistent. Outcomes vary substantially across trajectories, and six of the 16 trajectories retain the original weights when candidate improvements cannot be reliably validated. Together, these results highlight WSP's potential for highly localized model adaptation while revealing important challenges in intervention discovery, reliability, and cross-task transfer. Homepage: https://wsp-scope.github.io/ GitHub: https://github.com/WSP-Scope/WSP-Scope-Project
Figures & tables
| Benchmark | Task Type | Development Data | Held-out Test |
| MATH | Math Reasoning | GSM8K/MATH train + AIME | MATH-500 |
| MMLU-Pro | General Knowledge | MMLU-Pro validation | MMLU-Pro test |
| IFEval | Instruction Following | IFEval dev split | IFEval test split |
| GPQA Diamond | Scientific QA | GPQA Main | GPQA Diamond |
| MedXpertQA | Medical QA | MedQA English + MedXpertQA dev | MedXpertQA-Text |
| SciBench | Scientific Reasoning | SciBench worked examples | SciBench test |
| Best Development | Held-out Evaluation | ||||||
| Model | Benchmark | Base | Edited | Base | Edited | ||
| 0.8B | Math | 14.58 | 58.33 | 8.35 | 37.80 | ||
| GPQA Diamond | 18.75 | 32.42 | 25.25 | 29.67 | |||
| MedXpertQA ∗ | 32.81 | 50.00 | 10.57 | 10.81 | |||
| MMLU-Pro ∗ | 34.92 | 42.86 | 34.17 | 35.07 | |||
| IFEval | 21.48 | 65.23 | 21.40 | 58.12 | |||
| Setting | Value |
| Forward budget | 50 successful requests; G and TF requests each count once |
| Python analyses | At most 300 per search |
| Edit arithmetic | Float32 computation, BF16 storage; no gradients or optimizers |
| Sampling | Temperature 0.6, top- 0.95, top- 20, presence penalty 1.5 |
| Reasoning mode | Thinking enabled |
| Final evaluation | max_new_tokens , seed 0, task-specific (Table 4 ) |
| Target | Development (editor-visible) | Held-out test |
| Math | 7,469 GSM8K train [ 1 ] + 7,275 MATH train + 714 AIME | 500 MATH500 [ 2 ] |
| GPQA [ 9 ] | 250 Main minus Diamond | 198 Diamond |
| MedXpertQA [ 16 ] | 1,273 MedQA English test (external) + 5 MedXpertQA Text dev | 2,450 MedXpertQA Text test |
| MMLU-Pro [ 13 ] | 70 validation | 12,032 test |
| IFEval [ 15 ] | 270 official prompts | 271 official prompts |
| SciBench [ 12 ] | 112 worked examples | 580 text problems |
| Benchmark | Target | Update | Changed BF16 |
| Math (Primary) | , column 507 | 1,023 | |
| Math (Rerun 1) | , dense | 1,037,572 | |
| Math (Rerun 2) | , dense | , | 1,981,083 |
| GPQA Diamond | (cols. 1536–1791) | set to | 262,144 |
| MedXpertQA | 21 columns of – | columns | 21,504 |
| MMLU-Pro | (cols. 1792–2047) | set to | 262,144 |
| Benchmark | Target | Update | Changed BF16 |
| Math | , column 8004 | Negate column | 4,096 |
| GPQA Diamond | (columns 2304–2559) | Set block to zero | 1,048,576 |
| MedXpertQA | , head-11 gate rows 5888–6143 | 1,047,586 | |
| MMLU-Pro | 41,054,142 | ||
| IFEval | , column 5032 | Multiply by | 4,096 |
| SciBench | , six columns | Zero five columns; double column 5011 | 24,576 |
| Search | Operation | FP32 changed | BF16 changed |
| Math Primary | Column 507, | 1,024 | 1,023 |
| Math Rerun 1 | Dense rank-one update | 3,669,545 | 1,037,572 |
| Math Rerun 2 | Dense rank-one update | 3,669,949 | 1,981,083 |
| Model and candidate | Development set | Answers | Official | Deterministic |
| 0.8B, candidate F46 | Adaptive batch | 256 | ||
| 9B, final candidate (column 5032, ) | 120 disjoint questions 16 | 1,920 |
| F | Turn | Type | Batch | Cap | Base | Edited | pp | Intervention / purpose |
|---|---|---|---|---|---|---|---|---|
| 1 | 3 | G | 32k | 19/128 | – | – | Initial stratified diagnosis; no edit | |
| 2 | 9 | TF | 2 | – | – | – | – | Attention/MLP localization; chat-template artifact |
| 3 | 11 | TF | 2 | – | – | – | – | Repeat localization with corrected thinking prefix |
| 4 | 13 | G | 8k | 6/48 | 9/48 | +6.25 | L15 attention H7 output multiplied by 0.5 | |
| 5 | 14 | TF | 2 | – | – | – | – | Teacher-forced repeat probe of attenuated H7 |
| 6 | 16 | G | 8k | 6/48 | 8/48 | +4.17 | L15 H7 output zeroed |