Introduction
Adding a capability to a neural network usually involves further training, fine-tuning, or attaching a new component around the model. WeightCode explores another route: treating weights as programmable objects and using code to install new computations directly into them. The authors call this approach Weight-Space Programming (WSP).
How it works
WeightCode uses a frozen language model to generate executable weight programs from task knowledge and the target network’s existing weights. A program can read, construct, or modify weights. Unlike gradient-based training, this process does not update parameters through backpropagation. Once a capability is installed, running it does not require the language model that wrote the program.
The proposal is therefore more specific than asking a language model to produce code: the code is intended to add a computation to an existing network. According to the paper, programs can use a task grammar or a small set of examples to build the requested capability. The experiments also examine whether the additions interfere with existing functions, including command understanding and navigation.
Reported results
For command tasks, providing a grammar or eight demonstrations raised exact-match accuracy on previously unseen command compositions from 0% to 99.8%. Installing a new pickup action raised success from 0% to 98.4%. These results suggest that weight programs can turn explicit task knowledge into executable behavior in the tested settings; they do not establish that every task will see similar gains.
On ImageNet, four weight programs produced net gains of 8.84 to 17.62 points while preserving accuracy on clean images. The paper says this outperformed the best of eight fine-tuning methods under matched constraints for examples, checks, and retention. Causal interventions in a Vision Transformer indicated that installed noise-correction gates drove the robustness gains, while selective activation helped preserve clean-data accuracy. The authors also reran programs on five independently trained Vision Transformers without further language-model calls. Across ten programs, the reported average retention was 83% to 110% of the gains on the source network.
Why it matters—and what remains open
WSP broadens the idea of model extension: instead of only training parameters, developers can write programs that operate on them. This could enable more targeted capability updates, but it also makes validation essential. Stability, effects on untested capabilities, and safe reuse all require scrutiny. The abstract reports promising results across several tasks, but does not show that weight programming can generally replace fine-tuning.
Source: Hugging Face Daily Papers
Comments
Checking sign-in status...
Loading comments...