I built an LLM where Gemini 4 wrote the initial weights as code (97% of bytes)
A language model, Gemini 4, was used to construct the initial weights of another language model. A staggering 97% of the model's stored weights were generated by Gemini 4, without the need for any gradient steps. The only training that took place was to a 103M-parameter network, which was built upon these initial weights. This approach, known as weight-space programming (WSP), involves an LLM directly reading and writing the weights of a neural network.
In this case, Gemini 4 created a compiler that transformed 31.8B tokens of corpus statistics into a 7.96 GiB bank of sparse tables. These tables formed over 97% of the model's stored bytes, all without a single gradient step. Following the initial pretraining, an external edit layer enabled continual knowledge updates to the model. This allowed new facts to be added without any training.
When tested on FineWeb-Edu documents, the table model achieved a word-level perplexity of 46.4, which is 11% lower than a model with matching parameters but without the tables. This result is comparable to the improvement one would see by increasing the network size by about 1.5 times, following standard parameter scaling laws. The model also demonstrated a 1.2-point increase in mean zero-shot accuracy on ten tasks.
The model's ability to handle sequential edits was impressive. After 10,000 WikiBigEdit edits, the edit layer answered 99.9% of the edited questions and 97.4% of their paraphrases. It also left 98.2% of unrelated answers unchanged, and changed perplexity by only 0.003%. The entire process took 12 ms per fact, with no gradient step involved. The code and results are available on GitHub at github.com/Kim-Ai-gpu/wtable-lm.
Rewritten by urgent.news; may contain errors — check the original.
Source: weights-as-code.pages.dev