Quick Answer: When an LLM writes model weights, the result can be a compiler that builds a network's initial weights from corpus statistics, with no gradient steps. In one preprint, that compiler filled over 97% of stored bytes with frozen sparse tables. Gradient descent trained only a 103M-parameter network on top, reaching 46.4 word-level perplexity against 52.1 for a parameter-matched baseline.
Here's a claim that sounds wrong on first read: an LLM wrote the program that set most of a language model's stored weights, and gradient descent never touched them. The preprint "A Language Model Architecture Whose Initial Weights an LLM Can Write as Code" describes this setup in detail. The project was shared on Hacker News, and the code is public. Whether the approach holds up is a fair question, so let's go through what was built, what it achieved, and where it's fragile.
What the LLM Actually Wrote
The core idea is weight-space programming (WSP): a frontier model reads and writes the weights of a neural network directly, instead of learning them through gradient descent. Earlier WSP work stayed small, either on tiny networks or on sparse edits to existing models. This project pushes it further by using the LLM to build a model from scratch.
The LLM's output is a compiler, not a set of weights. That compiler takes 31.8 billion tokens of FineWeb-Edu text and produces a 7.96 GiB bank of sparse tables. Those tables account for over 97% of the model's stored bytes. According to the author, the compiler was designed by Gemini 4 Neon.
Here's the part that matters for your own work. The tables are frozen. Gradient descent trains only a roughly 103M-parameter network that reads them at every position. The tables feed in through an Engram block after the fourth layer and through gated fusion with the output logits. Most of the "knowledge" lives in lookup structures, and the trained network learns how much to trust them.
Eighteen Channels, One Interface
Each table is a channel, and every channel answers the same way: a short list of candidate next tokens with scores. The network doesn't need to understand how each channel was built. It only learns how much to trust each one at each position.
The channels fall into five groups:
- n-gram (5 channels): predicts from the last 1 to 5 tokens.
- Skip-gram (3 channels): uses earlier tokens with gaps.
- Synonym (2 channels): draws on synonym clusters of recent tokens.
- Concept (2 channels): captures associations between concepts.
- Rule (2 channels): applies explicit phrase and fact rules.
- In-context (4 channels): reads the current document.
The first five groups are counted from the 31.8B FineWeb-Edu tokens, which are disjoint from the network's training data. That separation matters. If the tables were built from the same text the network trains on, the evaluation would be quietly contaminated.
Here's where most readers get stuck: why use n-gram statistics at all when transformers are supposed to learn those patterns? The answer is that the network doesn't have to spend its capacity memorizing frequent co-occurrences. A 103M-parameter model can focus on the harder work of combining evidence.
The Numbers: Same Network, Lower Perplexity
The headline comparison is clean. Both models share the same backbone, about 103M trained parameters, and the same 10B training tokens. The only difference is the frozen tables. On 2,000 held-out FineWeb-Edu documents at context 1,024, the table model reaches word-level perplexity 46.4. The parameter-matched baseline without tables reaches 52.1, roughly 11% higher.
The author also estimates the equivalent scale-up using the parameter scaling law from Kaplan et al. (2020), where loss scales as N^−0.076. By that estimate, the tables are comparable to making the network about 1.5 times larger. That's an extrapolation, not a measured result, so treat it as a directional claim.
Downstream gains are smaller. Mean zero-shot accuracy across ten tasks rose by 1.2 points, evaluated with lm-eval 0.4.13 using length-normalized accuracy where available. The largest gains came on tasks that reward common associations between words and events. That pattern fits the channel design: the tables store exactly that kind of co-occurrence.
Now for the counter-intuitive part. Most people assume that once you have a fixed table, more data is the only lever. Here, the author reports that bigger tables keep helping. You can keep only the most frequent fraction F of table entries in the trained model without retraining, and perplexity improves with every doubling without sign of saturating. The source doesn't establish where that curve flattens, so don't assume it won't.
That said, the 1.5× figure and the doubling curve both come from a single preprint with a single training budget. Independent replication at other scales is the real test.
Adding Facts After Pretraining Without Retraining
The second claim is more surprising than the first. After pretraining, an external edit layer adds new facts with no gradient step. Over 10,000 sequential WikiBigEdit edits, applied in batches and never undone, the edit layer answers 99.9% of the edited questions and 97.4% of their paraphrases. It leaves 98.2% of unrelated answers unchanged and changes perplexity by only 0.003%. Each fact costs about 12 ms on one T4 GPU.
Writing facts directly into the tables fails, the author argues, because the last few tokens before an answer are almost always the same question template. Every fact ends up competing with every other fact for the same generic context. So the edit layer keeps facts outside the tables. Each edit goes through three steps:
- Store a record. Save the subject tokens, a key (the hidden state where the answer should appear), and the answer tokens. This takes one forward pass and no gradient step.
- Fire only when it should. The subject must appear verbatim in the last 64 tokens, stored with and without a leading space and never inside a longer word. The raw hidden state must also match the key, with cosine similarity at least 0.93.
- Push the answer. The stored answer token is raised 1.5 logits above the current top token, one token at a time, until the answer ends.
Records are plain data. A person or an LLM can write, inspect, or delete them. A new edit for the same subject and relation replaces the old one, which is a design choice that avoids silent conflicts.
Most people stop here and ask the obvious question: why not just fine-tune? The source answers with numbers. Fine-tuning and LoRA recalled at most 36.3% of the edits and pushed perplexity above 1,000. Weight editing kept learning new facts but forgot the old ones and damaged the model.
| Approach | Cost per fact | Edited answers recalled | Effect on the rest of the model |
|---|---|---|---|
| Edit layer (this work) | ~12 ms, no gradient step | 99.9% of edits, 97.4% of paraphrases | Unrelated answers unchanged for 98.2%; perplexity change 0.003% |
| Fine-tuning and LoRA | Gradient steps on each batch | At most 36.3% | Perplexity above 1,000 |
| Weight editing | Not reported in the source | Keeps learning new facts | Forgets earlier edits and damages the model |
Where This Approach Breaks Down
Every design choice here carries a trade-off, and a responsible reader should know them before building on this.
The biggest one is the trigger. The edit layer fires only when the subject appears verbatim in the last 64 tokens. That's a precise rule, and it's also brittle. A misspelled subject, a nickname, or a reference that falls outside the 64-token window won't fire. The 97.4% paraphrase score is encouraging, but the source doesn't break down which paraphrase styles failed.
The second caveat is measurement. Perplexity here is word-level, not token-level, so comparisons to published token-level numbers need care. The evaluation used 2,000 held-out documents, and the training budget was 10B tokens on a single GPU. That's a small, controlled setting. Whether the gains hold at frontier scale is an open question.
The third caveat is provenance. This is a preprint on Preprints.org, not a peer-reviewed publication. The author has released code at github.com/Kim-Ai-gpu/wtable-lm, which lets you check the claims directly. That's the right first step before trusting any of the numbers.
Here's the tension I'd keep in mind: the same design that makes edits cheap and auditable, plain records you can read and delete, also means the model's behavior depends on a rule-based gate. Good for control, but it's a different kind of system than a pure neural model, and it needs its own testing.
Frequently Asked Questions
What is weight-space programming?
Weight-space programming is the idea that a capable LLM can read and write the weights of a neural network directly, without gradient descent. In this preprint, the LLM writes a compiler that turns corpus statistics into frozen sparse tables. Gradient descent then trains only a smaller network that reads those tables. Earlier work in this area was limited to small networks or sparse edits to existing models.
How do you add facts to an LLM without fine-tuning?
You can add facts through an external edit layer that stores each fact as a record with a subject, a key hidden state, and answer tokens. The record fires only when the subject appears verbatim in the last 64 tokens and the hidden state matches the key at cosine similarity 0.93 or higher. The reported cost is about 12 ms per fact on one T4 GPU, with no gradient step.
Why does fine-tuning make a model forget older knowledge?
Gradient updates change shared weights, so new training can overwrite what the model already encodes. The preprint reports that fine-tuning and LoRA recalled at most 36.3% of 10,000 sequential edits and pushed perplexity above 1,000. Keeping facts in separate records avoids that overlap, since unrelated answers stayed unchanged for 98.2% of questions.
Can an LLM write model weights for a full language model?
In this experiment, yes, but only for the frozen part. The LLM wrote a compiler that produced sparse tables covering over 97% of stored bytes. A trained network of about 103M parameters still does the learning on top. Whether the same approach scales to frontier-sized models hasn't been shown in the source.
Try the edit layer on a single fact this week: store one record, ask the model the question with the exact subject and then with a paraphrase, and note where it fails. Pass this to anyone trying to update an LLM's knowledge without retraining, since the LLM writes model weights in a form you can actually inspect. Start with the source at weights-as-code.pages.dev, and check the code at github.com/Kim-Ai-gpu/wtable-lm before you rely on any single number.