WeightCode: a frozen language model writes programs that add skills to trained networks

WeightCode: a frozen language model writes programs that add skills to trained networks

A preprint introduces Weight-Space Programming (WSP), an approach in which executable programs read, construct or modify a trained neural network's weights directly. The authors start from a familiar problem: networks store what they have learned in their weights, but adding explicit task knowledge to them is still hard. Their answer is WeightCode, a WSP framework that uses a frozen language model to write executable weight programs. These programs install new computations into a trained network using task knowledge and the network's existing weights, without gradient-based training. Once installed, the new capabilities run independently of the language model.

The first set of results covers command following and navigation. Given a grammar or eight demonstrations, weight programs enable previously unseen command compositions, taking exact match from 0% to 99.8%. They also add a new pickup action, taking success from 0% to 98.4%. The original command and navigation capabilities are preserved.

The second set is on ImageNet. Four weight programs achieve net gains of 8.84-17.62 points while preserving clean accuracy. The authors say this outperforms the best of eight fine-tuning methods under matched examples, checks and retention constraints.

In a Vision Transformer, the authors ran causal interventions. They report that installed noise-correction gates drive the robustness gains, and that selective activation of those gates preserves clean accuracy.

The programs also transfer. Rerun on five independently trained Vision Transformers without further language model calls, ten weight programs retain 83-110% of their source-network gains on average. Copying their fixed weight edits, by contrast, yields negligible gains. Capabilities can also stack: six programs written for an already edited network add 5.23-14.50 points of contrast robustness while keeping the noise gain installed earlier.

From this the authors conclude that WSP is a new route to acquiring and accumulating capabilities in trained neural networks through reusable weight programs.

Key facts

  • WeightCode has a frozen language model write executable weight programs that install new computations into trained networks without gradient-based training; once installed, they run independently of the language model.
  • With a grammar or eight demonstrations, unseen command compositions go from 0% to 99.8% exact match, and a new pickup action from 0% to 98.4% success, with original command and navigation skills preserved.
  • On ImageNet, four weight programs give net gains of 8.84-17.62 points while preserving clean accuracy, beating the best of eight fine-tuning methods under matched examples, checks and retention constraints.
  • Rerun on five independently trained Vision Transformers, ten weight programs retain 83-110% of their source-network gains on average; copying the fixed weight edits gives negligible gains.
  • Six programs written for an already edited network add 5.23-14.50 points of contrast robustness while keeping the earlier noise gain.

Why it matters

Fine-tuning is the usual way to teach a trained network something new, and it needs gradient-based training. This paper proposes another route: a language model writes a program that edits the weights directly, using task knowledge and what the network already contains. If the reported results hold, a capability becomes a reusable program rather than a one-off set of weight updates. The authors point to the rerun on five other Vision Transformers, where the programs kept most of their gains while copied fixed edits did not.

Who it affects

The work is aimed at researchers who want to extend trained networks with explicit task knowledge, such as new commands, new actions or robustness to noise and contrast changes. The results cover a command and navigation setting and Vision Transformers on ImageNet.

How to use it

The source describes the method, not a tool you can download. It says a frozen language model is given task knowledge, in the form of a grammar or eight demonstrations in the command task, and writes a weight program that is then applied to the trained network. After installation the language model is no longer needed. The source mentions no code or model release.

How solid is it

These are the authors' own reported results, taken from a paper listing, and they are concrete: the numbers come with matched comparisons against eight fine-tuning methods and causal interventions on a Vision Transformer. Still, the language model used to write the programs is not named. The ImageNet baseline accuracy and the type of robustness gain (which corruptions) are not stated, so the gains are given only as points. The source does not name the eight fine-tuning methods or give the margin by which WSP outperforms the best of them. The command, navigation and pickup benchmark is not named either.

Risks and caveats

The model sizes, compute cost and time needed to write or install weight programs are not given, so the practical price of the approach is unclear. No limitations or failure cases are described. The strongest claim, that WSP is a new route to accumulating capabilities, is the authors' own conclusion. The stacking evidence is a set of six programs on one edited network.

“Once installed, the new capabilities run independently of the language model.”

— WeightCode paper abstract