AI News

An LLM Wrote the Initial Weights of an LLM — as Code: The Weights-as-Code Preprint, Checked

By Asad Ali ·

15 min read

Cover illustration for the Weights-as-Code preprint article: a language model pipeline turning corpus statistics into frozen weight tables.

An LLM has written the initial weights of a language model — as code. In a preprint published on 30 November 2026, independent researcher Youngseong Kim reports that a compiler designed by Gemini 4 Neon turns 31.8 billion tokens of corpus statistics into a 7.96 GiB bank of frozen sparse tables — over 97% of the model's stored bytes — without a single gradient step. Gradient descent then trains only a 103M-parameter network on top. This is a preprint, not a peer-reviewed paper, and the headline needs one correction up front: no LLM typed out the weights. An LLM wrote the compiler; a counting program computed the tables. The results are real, the code is public, and the limits are worth knowing before the hype does its work.

The paper is called "A Language Model Architecture Whose Initial Weights an LLM Can Write as Code", published on Preprints (DOI 10.20944/preprints202611.3172.v1) on 30 November 2026. It reached the Hacker News front page at number 3 with 483 points on 1 December 2026, and stood at 528 points with 182 comments the next day. The code and all result files are public in the repository github.com/Kim-Ai-gpu/wtable-lm (MIT licence, 131 stars as of 1 December 2026), with a project page at weights-as-code.pages.dev. The trained weights themselves are not released yet — the repository says the model weights and the 8 GB table bank are still to come.

What the paper actually did

The idea starts from weight-space programming: the notion that a frontier LLM can read and write the weights of a neural network directly, without gradient descent. Until now, the paper's abstract says, that idea had only been shown on small networks or as sparse edits to existing models — never to build a language model from scratch. This paper takes a different route. Instead of asking an LLM to write weights directly, it asks an LLM to write a compiler, and the compiler builds the weights.

Three parts have to be kept apart, because the headline blurs them:

1. The compiler. This is the part an LLM designed. According to the project page, the compiler was designed by Gemini 4 Neon. The repository README says what the LLM chose: the 18 channels and what each one counts, the hashing, which keys to keep, and how values are encoded. The compiler is a program — code, not weights.

2. The tables. The compiler runs over 31.8 billion tokens of FineWeb-Edu text and counts things: which words follow which words, which words appear near each other, which words are synonyms, which concepts go together. The results are stored as a 7.96 GiB bank of sparse hash tables. No gradient step is involved at any point in this stage, and the tables stay frozen while the network trains. The table values are corpus statistics — n-gram counts, skip-gram counts, synonym clusters, concept associations. No LLM wrote those numbers; a counting program did.

3. The trained network. A 103M-parameter Transformer is trained on 10 billion tokens on a single GPU, on top of the frozen tables. The network reads the tables at every position through an Engram block after its fourth layer, and through gated fusion with its output logits — it learns how much to trust each table channel, not the table contents themselves. The embeddings are initialised from a PPMI/SVD-128 geometry written by the table compiler. Training took about 23.6 hours on one A100 40 GB GPU at roughly 116,000 tokens per second, using the Muon optimiser for two-dimensional matrices plus AdamW.

From corpus statistics to a trained modelCorpus31.8B tokensFineWeb-Edu→Compilerdesigned byGemini 4 Neon→Frozen tables7.96 GiB, 97% ofstored bytes→Transformer103M paramstrained, 10B tokensEdit layer (external records)10,000 facts added later, no trainingNo gradient step anywhere in the compiler or the edit layer.

What is inside the 7.96 GiB of tables?

The tables are not one big lookup. They are 18 channels in six groups, and every channel answers the same question in the same form: a short list of next-token candidates with scores. The network only learns how much to trust each channel at each position. The first five groups are counted from the 31.8 billion FineWeb-Edu tokens, kept disjoint from the network's training data; the sixth group is computed from the document being read right now.

GroupPredicts the next token fromChannels
N-gramThe last 1 to 5 tokens5
Skip-gramEarlier tokens, with gaps between them3
SynonymSynonym clusters of recent tokens2
ConceptAssociations between concepts2
RuleExplicit phrase and fact rules, hot-swappable2
In-contextThe current document (induction, cache, repetition)4

Building the tables was itself a job: 19 map workers ran on free cloud CPU virtual machines, and the merge took 5.4 hours on a 30 GB RAM machine. The compiler is a C++ and OpenMP map-reduce program.

What the numbers say

The headline result is perplexity — how surprised the model is by held-out text. The table model (T) and the no-table baseline (B) share the same backbone and the same 10-billion-token training schedule. The baseline's MLP is widened slightly so the trained parameter counts match: 103.25 million for the table model, 103.34 million for the baseline. The only difference is the frozen tables.

MeasureTable model (T)Baseline (B)Difference
Word-level perplexity (2,000 held-out FineWeb-Edu documents)46.452.111% lower
Token-level perplexity (same documents)16.4317.888.1% lower
Mean zero-shot accuracy, 10 tasks56.1154.87+1.24 points
Training tokens10 billion10 billionSame

Two honest notes on these numbers. First, the 11% figure is the word-level perplexity improvement; the same experiment measured in token-level perplexity is 8.1% lower, and in loss terms the gap is about 0.084 nats, or 2.9% lower loss. All three numbers describe the same result — the project page leads with the largest. Second, the paper's "about 1.5 times larger" claim is an estimate, not a measurement: it uses the Kaplan et al. (2020) parameter scaling law (loss proportional to N to the power of −0.076) to say the perplexity gain is comparable to making the network about 1.5 times larger. Scaling-law estimates are a way of sizing a gain, not proof of one.

The zero-shot gains are uneven, which is itself informative. The table model gains most where common associations between words and events matter, and gains nothing on two tasks:

TaskTable modelBaselineGain
SciQ77.373.9+3.4
ART56.554.0+2.5
CSQA (cloze)31.729.7+2.0
CBT-NE80.278.6+1.6
PIQA65.163.5+1.5
HellaSwag36.535.8+0.7
BLiMP80.980.1+0.7
WinoGrande50.750.4+0.3
OpenBookQA31.231.20.0
ARC-Easy51.151.3−0.3

Scores are zero-shot accuracy with lm-eval 0.4.13, length-normalised where available. Results on all 21 evaluated tasks are in the paper's appendix; the ten above are the headline set. The tables help most on knowledge-heavy and commonsense tasks, and not at all on OpenBookQA — which fits the mechanism: tables store what words go with what, not reasoning.

The edit layer: adding facts without training

The second result in the paper may matter more than the first. After pretraining, an external edit layer adds new facts without any training at all — and it does so far better than fine-tuning. The idea is deliberately simple.

Adding a fact takes three steps:

1. Store a record. A fact is stored as plain data: the subject tokens, a key (the hidden state where the answer should be given), and the answer tokens. One forward pass, about 12 ms per fact on a T4 GPU, no gradient step. Records are plain data, so a person or an LLM can write, inspect or delete them, and a new edit for the same subject and relation replaces the old one.

2. Fire only when it should. The subject must appear verbatim in the last 64 tokens, and the raw hidden state must match the stored key with a cosine similarity of at least 0.93. Writing facts into the tables themselves was tried and failed, the paper says, because the last few tokens before an answer are almost always the same question template — so the edit layer keeps facts outside the tables instead.

3. Push the answer. The stored answer token is raised 1.5 above the current top logit, one token after another, until the answer ends.

Over 10,000 sequential WikiBigEdit edits, applied one batch of 100 after another and never undone, the edit layer answered 99.9% of the edited questions and 97.4% of their paraphrases, left 98.2% of unrelated answers unchanged, and changed perplexity by only 0.003% — a change of +0.0004 in token-level perplexity. The first 10% of edits were still recalled at 99.6% after all 10,000. Fine-tuning and LoRA, by comparison, recalled at most 36.3% of the edits and pushed perplexity above 1,000:

Method (after 10,000 edits)Edited questionsParaphrasesUnrelated unchangedPerplexity change
Edit layer (proposed)99.9%97.4%98.2%+0.0004
Table model, full fine-tuning34.3%23.8%0.0%+202.7
Baseline, full fine-tuning36.3%27.4%0.4%+527.4
Baseline, LoRA23.9%16.0%0.4%+1,386
Baseline, LoRA merged after each batch22.6%15.5%0.5%+20,899

The honest limits are in the repository, not hidden. The layer fires only when the subject appears verbatim, so aliases are missed. Answers are emitted verbatim. Reverse questions ("who coaches X" versus "which team does Y coach") and multi-hop questions are not answered from an edit. And the edit layer uses the model's final hidden state but does not read or write the tables — it also runs on the no-table baseline, and the authors say plainly that these results do not show the tables make editing easier. The edit layer is a strong method on its own; the tables are a separate idea.

What this is not

Four corrections keep the story straight.

It is a preprint, not peer review. Preprints.org publishes without peer review. Nothing here has been independently reproduced yet, and the trained weights are not released, so nobody outside the author has run this exact model. The code and the result files are public, and one independent check recomputed every headline number from the repository's own result files and found them consistent — but recomputing the author's numbers is not the same as re-running the training.

97% is a storage share, not a capability share. The tables are 7.96 GiB and the trained network is about 0.2 GB in bf16, so the tables are over 97% of the stored bytes. Store the same network in fp32 and the share falls to about 95%. The 97% describes the checkpoint format, not how much of the model's ability comes from the tables. The tables demonstrably help — perplexity and zero-shot scores both improve — but "97% of the weights" does not mean "97% of the intelligence".

It is small-scale. A 103M-parameter model trained on 10 billion tokens is a research-scale result, not a frontier-scale one. Whether tables keep helping at billion-parameter scale is untested. The project page does show perplexity improving with every doubling of the table fraction, with no sign of saturating — but that is within this one model, not across model sizes.

The "LLM wrote the weights" wording is doing a lot of work. The LLM designed a compiler. The compiler counted a corpus. The counts became the tables. Each step is real, and the chain is the contribution — but the weights themselves are statistics, not something a model reasoned out token by token. "Weights as code" means the program that computes the weights, not weights typed out by a model.

Why it still matters

Strip away the headline and three ideas remain, each worth watching.

Pretraining could get cheaper in a specific way. If a large share of a model's starting point can be compiled from statistics instead of learned by gradient descent, the expensive part of training shrinks to the network on top. At this scale the saving is modest — one A100 for a day — but the direction is clear: spend compute on counting once, then train small networks on top of the counts.

Knowledge updates stop needing retraining. The edit layer's 99.9% recall after 10,000 edits, with perplexity essentially unchanged, is the strongest number in the paper — and it does not depend on the tables at all. Any model that needs facts corrected after deployment, from support assistants to internal tools, faces exactly this problem today, and fine-tuning is the current answer. A 12-millisecond record write with no gradient step is a different kind of answer, even with the verbatim-subject limitation.

Weight-space programming gets its first language model. The paper's own claim is about the field, not the leaderboard: until now, writing weights as code had not built a language model from scratch. This one does, with public code and public results. That makes it a starting point other researchers can build on — or refute — rather than a claim that has to be taken on trust.

The honest test is what happens next: an independent reproduction, the release of the trained weights, and a larger-scale run. Until then, the paper is best read as a working demonstration with strong numbers at small scale, not as a new way to train frontier models.

How to try it

The code is MIT-licensed in the wtable-lm repository. A CPU smoke test runs in under a minute — python wtable/test_local_smoke.py — and the repository documents the full pipeline: compile the tables from FineWeb-Edu shards, pretrain on one GPU, evaluate, and run the continual-editing harness. The trained weights and the 8 GB table bank are not released yet, so reproducing the results means running the compile and training steps yourself, not downloading a finished model. Data is FineWeb-Edu under ODC-By for pretraining and tables, and WikiBigEdit T1 under Apache-2.0 for editing.

For developers and small teams, the practical takeaway is narrower than the headline: the edit layer is the part you can use soonest, because it runs on the no-table baseline too and needs no training. Watch for the weight release and for a reproduction before building on either.

Frequently Asked Questions

Did an LLM really write the weights of a language model?

Not directly. An LLM — Gemini 4 Neon, according to the project page — designed a compiler. The compiler counted 31.8 billion tokens of text and turned the counts into a 7.96 GiB bank of sparse tables. The tables are the model's initial weights, and they hold over 97% of its stored bytes. So the accurate sentence is: an LLM wrote the program that builds the weights. The table values themselves are corpus statistics, not learned weights.

Is this paper peer-reviewed?

No. It is a preprint on Preprints.org, published 30 November 2026, and Preprints does not peer-review submissions. The code and result files are public, and one independent check recomputed the headline numbers from the repository's own files and found them consistent — but the work has not been independently reproduced, and the trained weights are not released yet.

What does the 97% figure actually mean?

It is a share of stored bytes: 7.96 GiB of tables against about 0.2 GB of trained network weights in bf16, which works out to over 97%. It is not a share of the model's ability, and it depends on the storage format — in fp32 the same network would make the share about 95%. The tables do help measurably (perplexity 46.4 versus 52.1 word-level), but 97% describes the checkpoint, not the intelligence.

How good is the model, really?

At research scale, better than its own baseline: word-level perplexity 46.4 against 52.1 (11% lower), token-level 16.43 against 17.88 (8.1% lower), and mean zero-shot accuracy 56.11 against 54.87 (+1.24 points) on ten tasks. The paper estimates this is comparable to making the network about 1.5 times larger under standard scaling laws. It is a 103M-parameter model trained on 10 billion tokens — a strong small-scale result, not a frontier model.

Can I download and use the model?

Not yet. The code is public under the MIT licence, and a CPU smoke test runs in under a minute, but the repository states that the trained weights and the 8 GB table bank are not released yet. Reproducing the results means compiling the tables and training the model yourself. Check the repository for the release before planning around it.

What is weight-space programming?

The idea that a frontier LLM can read and write the weights of a neural network directly, without gradient descent. Until this paper, it had only been shown on small networks or as sparse edits to existing models. This paper's version is indirect: the LLM writes a compiler, and the compiler builds the initial weights from corpus statistics.

Does the edit layer work on other models?

In principle, yes. The edit layer uses the model's final hidden state and does not read or write the tables, and the repository reports it also runs on the no-table baseline — though no baseline editing run is reported yet. It stores facts as plain records, fires on a verbatim subject match with a cosine threshold of 0.93, and needs no training. Its limits are verbatim subjects only (aliases are missed) and no reverse or multi-hop questions.

Sources

Want a website or web app that works as hard as your ideas do? Talk to Asad Webs — we build web apps, AI-powered tools and fast, search-friendly websites for teams in the USA, UK, UAE, KSA and Spain.

Related reading: Google DeepCrossAttention: 3x Faster Transformer Training · NVDRIVER v0.1: The AI-Reverse-Engineered NVIDIA Driver in Rust · Browse all free tools.

Category: AI News

Tags: technology

About Asad Ali

Asad Ali is a graphics designer with over 20 years of experience — designing since 2003 — and the founder of Asad Webs, based in Pakistan. He builds the free online tools on this site and writes the guides published here.

LinkedIn Facebook Website
KEEP READING

Next guide

Philipp Emanuel Weidmann, Creator of Heretic, Has Died at 41 →

Related articles

Join the conversation

No account needed. Comments appear only after approval. Your email address will not be published.

Be the first to share a useful question or thought.

You won’t be subscribed to any mailing list.
WELCOME BACK

Sign in

Access your orders, saved products and account.