I built an LLM where Gemini 4 wrote the initial weights as code (97% of bytes)
By hackernews · · Models
An LLM writes the program that fills 97% of a language model's stored weights with corpus statistics, with no gradient step. Gradient descent trains only a 103M-parameter network on top, and the model supports continual knowledge updates without training.
Weight-space programming (WSP) is the idea that a frontier LLM can read and write the weights of a neural network directly, without gradient descent. So far, however, WSP has been limited to small networks or to sparse edits of existing models, and it has not been used to build a language model from scratch. We instead have an LLM write a compiler that builds the model's initial weights. The compiler turns 31.8B tokens of corpus statistics into a 7.96 GiB bank of sparse tables, over 97% of the model's stored bytes, without a single gradient step. Gradient descent then trains a 103M-parameter network on top of the frozen tables.
After pretraining, an external edit layer adds new facts without any training, enabling continual knowledge updates. Trained on 10B tokens on a single GPU, the table model reaches a word-level perplexity of 46.4 on held-out FineWeb-Edu documents, 11% lower than a parameter-matched model without tables (52.1), comparable under standard parameter scaling laws to making the network about 1.5 times larger, and raises mean zero-shot accuracy on ten tasks by 1.2 points. Over 10,000 sequential WikiBigEdit edits, the edit layer answers 99.9% of the edited questions and 97.4% of their paraphrases, leaves 98.2% of unrelated answers unchanged, and changes perplexity by only 0.003%, at 12 ms per fact with no gradient step. Fine-tuning and LoRA, by comparison, recall at most 36.3% of the edits and push perplexity above 1,000. Code and results are available at github.com/Kim-Ai-gpu/wtable-lm.
What Hacker News is saying
- “Just skimmed but this looks like llm doing feature extraction and then training with gradient descent on those features, which i feel is something like these kind of tasks were done before compute heavy learning by desti…”
- “Continual knowledge updates sound good on paper but give it time with me and it'll learn to curse back like a mofo…”
- “It must be tough being an ML specialist these days: do you want your account locked or do you want your work sabotaged.”
- “This is interesting! How much time do these compilations take, compared to training?”