Training Vision Models for LLM-Driven Weight-Space Programming
Organizations: Ulm University
Abstract
It has been demonstrated that, in certain settings, large language models can perform weight-space programming to directly modify the weights of neural networks. However, it is unknown how dedicated training of these networks can contribute to the successes of weight-space programming. We present a benchmark of LLM-driven weight-space programming on vision models, in which five LLMs edit convolutional networks and vision transformers on relabeling and error-correction tasks on Waterbirds, CIFAR-100, PACS and Entity-30. We report more than 2,600 such edit processes, whereby each edit is scored on held-out images for success, side effects and accuracy loss. We compare standard training with label smoothing, gradient-based editable training, and our Edit-Ready Training (ERT), a novel method that rehearses the direct, closed-form weight edits LLMs perform. We show that preparing networks for editing raises the success of LLM edits substantially where standard networks are hard to edit. ERT further achieves the highest mean score for GPT-6 Astra and Claude Opus 5.5 across all evaluated baselines. We will release our LLM testing framework alongside all tasks, editing trajectories and scores. Project page: https://viscom.uni-ulm.de/wsp
Figures & tables
| Relabel | Confusion fix | Subgroup fix | |||||||||
| WB | WB | C100 | C100 | C100 | C100 | E30 | PACS | PACS | |||
| Method | R18 | ViT | R18 | ViT | R18 | ViT | R50 | R18 | ViT | Mean | |
| GPT-6 Astra | ERM (standard) | .40 [.32, .48] | .50 [.37, .64] | .64 [.52, .74] | .77 [.68, .85] | .60 [.50, .72] | .67 [.49, .80] | .46 [.37, .55] | .77 [.66, .86] | .82 [.78, .87] | .63 [.59, .66] |
| LS | .42 [.34, .50] | .57 [.44, .70] | .68 [.50, .80] | .80 [.71, .89] | .50 [.43, .58] | .74 [.61, .86] | .53 [.43, .62] | .71 [.57, .83] | .72 [.60, .81] | .63 [.59, .67] | |
| ENN | .47 [.42, .52] | .74 [.68, .81] | .58 [.45, .73] | .85 [.76, .92] | .73 [.60, .85] | .68 [.54, .81] | .81 [.72, .89] | .74 [.60, .84] | .78 [.74, .82] | .71 [.68, .74] | |
| ERT (ours) | .63 [.54, .71] | .74 [.65, .82] | .71 [.53, .84] | .81 [.70, .91] | .65 [.42, .84] | .75 [.69, .80] | .79 [.71, .87] | .81 [.71, .88] | .81 [.77, .84] | .74 [.70, .78] | |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| Tool | Charged as | Function |
| open_task | free | Returns the task objective, a summary of the network and the budget |
| budget_status | free | Returns the remaining budget |
| list_parameters | read | Names and shapes of the editable tensors |
| list_layers | read | Layers whose activations can be probed, with their number of channels |
| read_weights | read | Values of a tensor slice (at most 512 numbers), or summary statistics per slice |
| probe_predictions | probe | Accuracy and mean logit margin on the support and reference images, optionally per image |
| Method | Hyperparameter | Search space |
|---|---|---|
| ERT | edit weight | |
| reference weight | ||
| warm-up (epochs) | ||
| ENN | step size | |
| gradient steps | ||
| reference weight | , then |
| Setting | ERT | ENN |
|---|---|---|
| Waterbirds, 100 ep. | , , | , 1 step, |
| no warm-up | (ViT-B/16: ) | |
| CIFAR-100, 30 ep. | , 2-ep. | , 5 steps, , |
| warm-up, LS 0.2 | LS 0.2 | |
| PACS, 50 ep. | as CIFAR-100 | as CIFAR-100 |
| Entity-30, 20 ep. | as CIFAR-100, | as CIFAR-100, |
| Waterbirds | CIFAR-100 | ||||
| Method | 20 ep. | 100 ep. | 20 ep. | 100 ep. | Gain |
| ERM | 0.39 | 0.36 | 0.38 | 0.36 | – |
| Dropout | 0.39 | 0.36 | 0.39 | 0.37 | |
| SAM | 0.40 | 0.36 | 0.41 | 0.37 | |
| Concept labels | 0.56 | 0.55 | 0.38 | 0.36 | |
| Sparse final layer | 0.57 | 0.53 | 0.46 | 0.47 | |
| LS ERM | ENN ERM | ERT ERM | |||||||
| Setting | diff. | wins | diff. | wins | diff. | wins | |||
| GPT-6 Astra | |||||||||
| Waterbirds relabel, ResNet-18 | 4/8 | 0.719 | 7/8 | 0.195 | 8/8 | 0.008 | |||
| Waterbirds relabel, ViT-B/16 | 6/8 | 0.391 | 7/8 | 0.039 | 7/8 | 0.016 | |||
| CIFAR-100 relabel, ResNet-18 | 4/8 | 0.578 | 3/8 | 0.523 | 5/8 | 0.438 | |||
| CIFAR-100 relabel, ViT-B/16 | 6/8 | 0.516 | 7/8 | 0.062 | 5/8 | 0.391 | |||
| ERM | LS | ENN | ERT | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Setting | succ. | side | acc | acc | succ. | side | acc | acc | succ. | side | acc | acc | succ. | side | acc | acc |
| Waterbirds relabel, ResNet-18 | 0.51 | 0.101 | 87.5 | 0.62 | 0.144 | 84.7 | 0.63 | 0.109 | 91.4 | 0.73 | 0.107 | 91.4 | ||||
| Waterbirds relabel, ViT-B/16 | 0.39 | 0.059 | 87.5 | 0.72 | 0.099 | 89.1 | 0.87 | 0.081 | 93.2 | 0.85 | 0.085 | 93.2 | ||||
| CIFAR-100 relabel, ResNet-18 | 0.71 | 0.035 | 86.9 | 0.85 | 0.050 | 87.6 | 0.71 | 0.050 | 87.4 | 0.72 | 0.046 | 85.7 | ||||
| CIFAR-100 relabel, ViT-B/16 | 0.84 | 0.029 | 93.1 | 0.84 | 0.027 | 93.4 | 0.94 | 0.027 | 93.5 | 0.88 | 0.020 | 93.0 | ||||
| CIFAR-100 confusion fix, ResNet-18 | 0.61 | 0.014 | 86.9 | 0.50 | 0.016 | 87.7 | 0.63 | 0.026 | 87.4 | 0.64 | 0.024 | 85.7 | ||||
| Setting | ERT ENN | wins | |
|---|---|---|---|
| Waterbirds relabel, ResNet-18 | 10/16 | 0.043 | |
| Waterbirds relabel, ViT-B/16 | 4/8 | 0.414 | |
| CIFAR-100 relabel, ResNet-18 | 4/8 | 0.805 | |
| CIFAR-100 relabel, ViT-B/16 | 2/8 | 0.062 | |
| CIFAR-100 confusion fix, ResNet-18 | 5/8 | 0.820 | |
| CIFAR-100 confusion fix, ViT-B/16 | 4/8 | 0.719 |
| Relabel | Confusion fix | Subgroup fix | ||||||||
| WB | WB | C100 | C100 | C100 | C100 | PACS | PACS | |||
| Method | R18 | ViT | R18 | ViT | R18 | ViT | R18 | ViT | Mean | |
| GLM-5.3-Flash | ERM (standard) | .44 [.28, .59] | .32 [.14, .52] | .43 [.19, .66] | .66 [.42, .85] | .69 [.56, .79] | .54 [.32, .74] | .48 [.19, .70] | .44 [.22, .65] | .50 [.42, .57] |
| LS | .24 [.12, .35] | .19 [.03, .38] | .59 [.36, .78] | .48 [.25, .70] | .39 [.17, .61] | .51 [.27, .72] | .56 [.29, .76] | .07 [ .18, .34] | .38 [.30, .45] | |
| ENN | .30 [.15, .46] | .53 [.32, .73] | .49 [.23, .74] | .27 [.06, .51] | .76 [.60, .88] | .57 [.35, .79] | .34 [.09, .61] | .29 [.10, .50] | .44 [.37, .52] | |
| ERT (ours) | .38 [.18, .58] | .24 [.03, .48] | .66 [.45, .82] | .46 [.21, .69] | .73 [.50, .88] | .46 [.21, .71] | .59 [.32, .82] | .42 [.22, .59] | .49 [.41, .57] | |
| Rehearsed edit | Net | Pairs | ||
| One training seed, 8 species | ||||
| ERT (reference) | 0.72 | |||
| + bias compensation | 0.76 | 4/8 | 0.55 | |
| 32 units instead of 8 | 0.76 | 4/8 | 0.51 | |
| 8 to 64 units, drawn per episode | 0.68 | 2/8 | 0.62 | |
| step size 1 to 3 | 0.66 | 2/8 | 0.26 | |
| Task | Dataset | Network | Pairs | ERT | Variant | ||
| Stronger rehearsal (16 episodes, 64 units, two support images) | |||||||
| Relabel | Waterbirds | ResNet-18 | 16 | 0.68 | 0.73 | 0.20 | |
| Relabel | Waterbirds | ViT-B/16 | 8 | 0.82 | 0.76 | 0.38 | |
| Relabel | CIFAR-100 | ResNet-18 | 8 | 0.67 | 0.61 | 0.47 | |
| Relabel | CIFAR-100 | ViT-B/16 | 8 | 0.86 | 0.88 | 0.58 | |
| Confusion fix | CIFAR-100 | ResNet-18 | 8 | 0.61 | 0.51 | 0.20 | |
| ENN | ERT | ||||
| Editor | Backbone | rehearsed | held out | rehearsed | held out |
| Astra | ResNet-18 | 0.52 | 0.47 | 0.57 | 0.63 |
| ViT-B/16 | 0.71 | 0.74 | 0.78 | 0.74 | |
| Opus | ResNet-18 | 0.58 | 0.52 | 0.72 | 0.63 |
| ViT-B/16 | 0.83 | 0.79 | 0.82 | 0.76 | |
| GLM | ResNet-18 | 0.59 | 0.30 | 0.52 | 0.38 |
| Net score | Edit calls used | ||||
|---|---|---|---|---|---|
| Budget | ERM | ERT | ERM | ERT | |
| First run | 1 | 0.38 | 0.56 | 1 | 1 |
| 2 | 0.47 | 0.66 | 2 | 2 | |
| 8 | 0.46 | 0.69 | 6 | 6 | |
| Second run | 4 | 0.39 | 0.68 | 4 | 4 |
| 8 | 0.40 | 0.68 | 6 | 6 | |
| Edited units | Change of a unit | Change of the head | ||||||||||
| Edits | Head | min | mean | max | min | mean | max | min | mean | max | Outside | |
| ResNet-18 (512 units) | ||||||||||||
| Opus | 144 | 142 | 1 | 20 | 75 | 0.39 | 22.1 | 0.19 | 2.15 | 22.2 | 13 | |
| Astra | 128 | 128 | 1 | 206 | 512 | 0.05 | 10.2 | 0.13 | 1.53 | 17.7 | 4 | |
| Gemma | 125 | 63 | 1 | 47 | 512 | 0.16 | 7.07 | 0.08 | 1.98 | 10.1 | 1 | |
| GLM | 126 | 107 | 1 | 37 | 512 | 0.12 | 8.00 | 1.14 | 11.3 | 3 | ||
| Tool calls | Changed weights | Editing time | ||||||
|---|---|---|---|---|---|---|---|---|
| Editor | Edit processes | all | probes | edits | weight reads | (median) | total (h) | median (min) |
| GPT-6 Astra | 401 | 11,782 | 7,038 | 1,845 | 926 | 252 | 27.2 | 3.1 |
| Claude Opus 5.5 | 1,098 | 25,354 | 13,882 | 5,646 | 609 | 27 | 65.4 | 2.7 |
| GLM-5.3-Flash | 401 | 14,027 | 6,752 | 2,073 | 3,166 | 24 | 26.4 | 2.7 |
| DeepSeek-V4.1-Flash | 315 | 10,831 | 5,789 | 1,749 | 1,211 | 44 | 104.4 | 17.1 |
| Gemma-4-26B | 448 | 14,638 | 6,996 | 2,770 | 1,425 | 10 | 11.0 | 0.7 |