GPT-2 small's learned position embeddings drawn as a greyscale field of overlapping waves
GPT-2 small's learned position embeddings, computed locally: the 64 smoothest of its 768 dimensions across 1,023 positions, each scaled on its own. Weights are numbers, but they are not noise.

Notes on weight‑space programming

Frontier models can now read another network's weights, name a defect and patch it without training. What has been shown, why it might work, where it breaks, and the harness we are building to find out.

For most of the history of deep learning there has been one way to change what a network does: show it more data and take gradient steps. Fine-tuning, RLHF and distillation are all versions of that. They work, but they are blunt. You describe what you want through examples and a loss, and the optimiser decides which of the billions of numbers to move.

A different route has started to work, at least on small models. A frontier language model is given the weights of another network, asked to work out why that network fails, and allowed to change the numbers directly. There is no training run and no loss function, only reading and writing.

This note sets out what has been shown, why we think it can work, where we expect it to break, and what we are building to test it.

What has been shown

A recent write-up, Weight-Space Programming, [1] collects a set of early demonstrations. The author calls them sparks, which is the right word. Three stand out.

  • A reasoning-loop repair. A Qwen model that tended to repeat a reasoning step until it ran out of tokens was patched by editing about 0.016% of its weights. The author reports accuracy on MATH-500 [6] rising from roughly 8% to roughly 48%.
  • Policies written from rules. Small networks for Breakout-style games were produced from a plain-language description of the rules. They matched or gave a strong starting point to policies trained with PPO, with little or no interaction with the environment.
  • A controller fix. A small policy for a car on a ramp had a specific failure that was corrected by an edit rather than by retraining.

We have not reproduced these results yet, and reproducing them is the first thing the work below is for. Read them as reports of a capability, not as measurements.

Update, 19 November 2026. We have now replicated them with Claude Opus 5.5: Same fix, different weights. The Qwen edit reproduces, by a different mechanism.

Why editing weights directly could work

Editing weights by hand is not new. ROME located factual associations in particular MLP layers of GPT models and changed them with a rank-one update [2]. MEMIT scaled that to thousands of facts at once [3]. Task arithmetic showed that the difference between a fine-tuned model and its base can be added, subtracted and combined like a vector [4].

What is new is who does the editing. In those methods a person designs the procedure and an optimiser computes the numbers. Here a model reads activations and weights, forms a hypothesis about which components cause the failure, and proposes the change, roughly the way an engineer reads a stack trace before touching the code.

Two conditions seem to make this tractable today:

  1. The defect is local. A loop caused by a few neurons over-amplifying a "keep going" signal is a small mechanism. A missing skill is not, and nobody has shown that an edit can add one.
  2. The model is small enough to inspect. Every demonstration so far is on models of a few billion parameters or fewer, or on networks with a few thousand.

Some mechanisms really are that local. The figure below is a real attention pattern from GPT-2 small, for a sentence written twice. One head in layer 5 does almost nothing on the first copy; on the second, each word looks back at the word that followed it last time. That is an induction head [7], one of the best understood circuits in language models, and it lives in a handful of heads you can name.

Attention pattern of GPT-2 small, layer 5 head 1, over a sentence written twice. In the second copy each word attends to the word that followed it in the first, drawn as a mint diagonal.
GPT-2 small, layer 5, head 1, run locally. Rows are the word doing the looking, columns the word looked at. Brighter means more attention; the mint cells are the induction pattern, and they carry 73% of this head's attention on the second copy.

The obvious threat is superposition [5]. If a neuron takes part in many features at once, an edit that fixes one behaviour can quietly damage others that share it. That is why we think verification, not diagnosis, is the hard part of this problem.

Count what you claim

"0.016% of the weights" is a useful number only if everyone counts the same way, and there are two reasonable ways to call an edit small.

  • A sparse edit changes a handful of individual entries. The fraction of parameters touched is tiny.
  • A low-rank edit, like ROME's rank-one update, is described by very few numbers, but it usually changes every entry of the matrix it is applied to.

Take a model with a hidden size of 1,536, such as a 1.5B-parameter Qwen2.5. One rank-one update to a 1,536 × 1,536 attention output projection changes about 2.36 million entries, roughly 0.16% of the model. That is ten times the figure above, for an edit most people would also describe as minimal.

Neither number is wrong. They measure different things, so we will report both for every edit: the fraction of entries changed, and the rank of the change to each matrix it touches.

import torch

def edit_footprint(before: dict[str, torch.Tensor],
                   after: dict[str, torch.Tensor],
                   tol: float = 0.0) -> dict:
    """Fraction of entries changed, and the rank of each changed matrix."""
    changed, total, ranks = 0, 0, {}
    for name, w0 in before.items():
        delta = after[name].float() - w0.float()
        mask = delta.abs() > tol
        changed += int(mask.sum())
        total += w0.numel()
        if mask.any() and delta.ndim == 2:
            ranks[name] = int(torch.linalg.matrix_rank(delta))
    return {"fraction_changed": changed / total, "ranks": ranks}

Where it breaks

Context. The weights of a 1.5B-parameter model in bf16 take about 3 GB. No context window holds that, so the editing model has to work through tools: it asks for a layer, a slice of a tensor, or the activations on inputs it chooses. The quality of those tools sets a ceiling on what it can find.

Regressions. A patch that lifts one benchmark and costs a point on everything else is not a fix. Without a broad regression suite you cannot tell the two apart, and a single headline number hides exactly the damage superposition predicts.

Reproduction. Early results here come from a small number of runs. Reviewers, customers and we ourselves will want to see the gain on our own evaluations, with the seed and the edit published so anyone can apply it.

Scale. Whether any of this holds at 70 billion parameters is an open question. We would rather find the point where it stops working than assume there isn't one.

What we are building

First a harness, then a benchmark.

The harness gives an editing model a sandboxed, read-only copy of the weights. It also provides tools to read tensors and run probes, a hard budget on how much may change, and checkpoints so that any edit can be rolled back exactly. Every edit it accepts is logged with its footprint, its result on the target and its results on the regression suite.

The benchmark, PatchBench, plants known defects in open models (loops, stale constants, a narrow bias) and scores an editor on three things: whether the target failure is fixed, what else moved, and how large the edit was by both of the measures above. The first release will include the reasoning-loop case as a fixture, so the published result can be checked against an independent run.

If the results hold up, the uses are clear: surgical fixes for deployed models, audits that read weights for backdoors instead of only probing behaviour, and small controllers written directly from a specification. If they don't hold up, we will publish that too.

References

  1. "Weight-Space Programming." rikiyat.github.io.
  2. K. Meng, D. Bau, A. Andonian, Y. Belinkov. Locating and Editing Factual Associations in GPT. NeurIPS 2022.
  3. K. Meng, A. Sen Sharma, A. Andonian, Y. Belinkov, D. Bau. Mass-Editing Memory in a Transformer. ICLR 2023.
  4. G. Ilharco et al. Editing Models with Task Arithmetic. ICLR 2023.
  5. N. Elhage et al. Toy Models of Superposition. Transformer Circuits Thread, 2022.
  6. H. Lightman et al. Let's Verify Step by Step. 2023. The source of the MATH-500 subset.
  7. C. Olsson et al. In-context Learning and Induction Heads. Transformer Circuits Thread, 2022.