WeightCode: Installing New Capabilities into Neural Networks via Weight-Space Programming

WeightCode lets a frozen language model generate weight programs that install and accumulate new capabilities in a network without gradient training.
WeightCode proposes Weight-Space Programming (WSP): a frozen language model generates executable "weight programs" based on task knowledge and the target network's existing weights and writes them into the network to install new capabilities—without gradient descent, labeled data, or fine-tuning—and the new capabilities run independently of the language model. This fundamentally differs from parameter-efficient fine-tuning like LoRA, which still relies on gradient signals. Experiments show exact-match on unseen command combinations rising from 0% to 99.8%, a new grasp action at 98.4% success with original capabilities intact; on ImageNet, four weight programs yield 8.84–17.62 point net gains while preserving clean accuracy, outperforming the best of eight fine-tuning methods. Weight programs also show reusability (83%–110% gains retained across five independent ViTs) and capability accumulation.

How can a trained neural network acquire new skills? The traditional approach is fine-tuning—continuing to train with new data and adjusting the weights. But this process requires gradient descent, labeled data, and compute resources, and it may cause the model to forget its existing capabilities. A paper titled WeightCode: Installing New Capabilities into Neural Networks via Weight-Space Programming proposes a different idea: let a frozen language model directly write executable "weight programs" that install new computational logic into an existing network—all without any gradient training.
What Is Weight-Space Programming (WSP)
The core claim of Weight-Space Programming (WSP) is that executable programs can directly read, construct, or modify the weights of a neural network. WeightCode is a concrete implementation of this framework—it uses a frozen language model to generate executable weight programs based on task knowledge and the target network's existing weights. Once these programs are written into the network, the new capabilities run independently and no longer depend on the language model.
This is fundamentally different from mainstream parameter-efficient fine-tuning. Methods like LoRA still rely on gradient signals to update additional parameters, whereas WSP treats "modifying weights" itself as a programming act—the language model plays the role of a programmer, not an optimizer.
Parameter-Efficient Fine-Tuning (PEFT) and LoRA
Parameter-efficient fine-tuning is a class of methods that, while keeping the main weights of a pretrained model frozen, train only a small number of new or existing parameters. LoRA (Low-Rank Adaptation) is a representative example: it decomposes the weight update into the product of two low-rank matrices, i.e., ΔW = BA, optimizing only A and B during training, and either merging ΔW back into the original weights or computing it as a side path at inference time. Such methods significantly reduce memory and storage overhead, but they still fundamentally rely on backpropagation and gradient signals to determine the values of the new parameters, requiring labeled data and multiple rounds of optimization. Weight-space programming, as represented by WeightCode, skips the gradient step entirely: the language model directly produces read/write and construction instructions for the weights, with modifications based on task knowledge and the target network's existing weights rather than on gradients of a loss function. Therefore, the difference between the two lies not in the number of parameters but in "where the modification comes from"—one is a numerical value searched out by an optimizer, the other is an executable program generated by a model.
Experimental Results: From Instruction Composition to Image Robustness
The paper validates WSP's effectiveness on multiple tasks, with impressive numbers.
In the instruction-following setting, given a grammar or eight demonstrations, weight programs enabled the model to handle previously unseen command combinations, raising the exact-match rate from 0% to 99.8%; it also learned a new "grasp" action with a 98.4% success rate, while the original command and navigation capabilities remained intact. This means the installation of new capabilities did not come at the expense of old ones.
On ImageNet, four weight programs delivered net gains of 8.84 to 17.62 percentage points while maintaining clean accuracy. Under the conditions of matched examples, checks, and held-out constraints, this result outperformed the best of eight fine-tuning methods. The study also used causal interventions to show that, in a Vision Transformer, the installed noise-correction gating is the direct driver of the robustness improvement, and their selective activation is precisely why clean accuracy is preserved.
Clean Accuracy and Robust Accuracy
In adversarial robustness research, "clean accuracy" refers to a model's classification accuracy on the unperturbed original test set, while "robust accuracy" refers to accuracy under adversarial perturbations or distribution shifts (such as noise or contrast changes). The two are typically in tension: methods that improve robustness often come at the cost of performance on clean samples—a phenomenon known as the robustness–accuracy trade-off. Therefore, evaluating a robustness method cannot rely solely on gains under perturbation; it must also report whether clean accuracy is maintained. The paper's emphasis that weight programs deliver "net gains" while "maintaining clean accuracy" is precisely to show that it does not fall into the old path of trading accuracy for robustness. The "gating" mentioned in the paper refers to a mechanism that selectively switches specific feature channels or paths on and off; "selective activation" means these correction gates only take effect under specific perturbation conditions and largely do not intervene on clean inputs, which explains why clean accuracy is preserved while robustness improves.
Reusability and Capability Accumulation
An even more noteworthy aspect of WeightCode is the reusability of weight programs. When re-run on five independently trained Vision Transformers (without calling the language model again), ten weight programs on average retained 83% to 110% of the source network's gains; in contrast, directly copying the fixed weight edits they made yielded negligible gains. This shows that the programs carry transferable "how to modify" logic rather than a rigid set of numerical values.
Capability accumulation was also verified: six programs written for an already-edited network added 5.23 to 14.50 percentage points of contrast robustness while preserving the previously installed noise gains. New capabilities can stack on top of old ones rather than overwriting each other.
Vision Transformer (ViT) and the Transferability of Weight Edits
Vision Transformer is an architecture that splits an image into patches, linearly projects them into a token sequence, and feeds it into a Transformer encoder; its weights consist of the projection matrices of attention layers, feed-forward networks, and patch embeddings, among others. ViT's weight structure is regular and highly modular, making it a convenient subject for studying weight-space operations: structured modifications to the weights of a given layer or submodule make it relatively easy to localize their functional impact. The significance of "re-running weight programs on five independently trained ViTs" in the paper lies in the fact that independently trained networks, though architecturally identical, differ greatly in their concrete weight values; if a program merely recorded a fixed set of numbers, it would fail on a different network. The experiments show that the programs on average retained 83%–110% of the source network's gains, indicating that the programs encode modification logic that depends on the target network's current weights (for example, reading the statistics of a certain channel and constructing a gate accordingly), and thus possess cross-network transferability. This is also why it contrasts sharply with "directly copying fixed weight edits."
Why It Matters
The significance of this work lies in opening a new path: acquiring and accumulating capabilities through reusable weight programs, rather than fine-tuning from scratch every time. Here the language model is not an inference engine but a code generator for weight space—a positioning that is itself quite thought-provoking. Of course, the current results are concentrated on specific tasks and architectures, and questions remain: whether weight programs can generalize to more open-ended tasks and larger models, and how the safety of the programs themselves should be constrained. But as a proof of concept, WeightCode demonstrates the potential of weight-space programming as a new paradigm.
One-line Summary
WeightCode lets a frozen language model generate weight programs that install and accumulate new capabilities in a network without gradient training.
Paragraph Summary
WeightCode proposes Weight-Space Programming (WSP): a frozen language model generates executable "weight programs" based on task knowledge and the target network's existing weights and writes them into the network to install new capabilities, all without relying on gradient descent, labeled data, or fine-tuning, and with the new capabilities running independently of the language model after installation. This is fundamentally different from parameter-efficient fine-tuning methods like LoRA, which still rely on gradient signals. Experiments show that in instruction-following tasks, the exact-match rate on unseen command combinations rose from 0% to 99.8%, a new grasp action achieved a 98.4% success rate with original capabilities unchanged; on ImageNet, four weight programs delivered net gains of 8.84–17.62 percentage points while maintaining clean accuracy, outperforming the best of eight fine-tuning methods. Weight programs also exhibit reusability (retaining 83%–110% of gains across five independent ViTs) and capability accumulation.
Related articles

Google Stitch Skills: Connecting Coding Agents to the Design Workflow
Google Stitch Skills is an Agent Skills library following the open standard, adding a design-to-code workflow to the Stitch MCP Server. This article breaks down its three skill groups, SKILL.md directory structure, installation paths, and dependency pitfalls.

40.5-Inch Color E-Paper Art Frame: An Art Display You Charge Once a Year
The Ink Poster Tella 40.5-inch color e-paper art frame uses the E Ink Spectra 6 full-color solution: A1 format, no backlight, no noise, about one charge a year, 2,000+ licensed artworks built in, and automatic adaptation of phone photos.

Jingle Jam Memories: RT's Awkward First Encounter with Lewis
RT shares his awkward first Jingle Jam experience: unexpectedly pushed into the studio, meeting Lewis and Yogg's cast, and Toddy appearing in armor.