LLM Writes 97% of a New Model's Weights as Code
Original: I built an LLM where Gemini 4 wrote the initial weights as code
Why This Matters
Separates knowledge storage from learned computation, potentially cutting training costs.
Independent researcher Youngseong Kim built a language model where Gemini 4 wrote a compiler that converts 31.8B tokens of corpus statistics into 7.96 GiB of frozen sparse tables—covering 97% of stored weights—with zero gradient steps.
Kim's weight-space programming (WSP) approach flips the standard training script: instead of learning weights via gradient descent, a frontier LLM writes a program that compiles corpus statistics directly into the model's weight tables. Those frozen tables account for over 97% of stored bytes. A 103M-parameter network is then trained on top via gradient descent on 10B tokens on a single GPU.
The results are notable. Word-level perplexity on held-out FineWeb-Edu documents drops to 46.4 versus 52.1 for a parameter-matched baseline—an 11% improvement roughly equivalent, under Kaplan et al. scaling laws, to making the network 1.5× larger. Zero-shot accuracy across ten tasks improves by 1.2 points on average.
Perhaps the most striking claim involves continual editing. An external edit layer—requiring no gradient step—handles 10,000 sequential WikiBigEdit fact insertions at 12 ms per fact, recalling 99.9% of edited questions and 97.4% of paraphrases, while leaving 98.2% of unrelated answers unchanged and barely nudging perplexity (+0.003%). Fine-tuning and LoRA top out at 36.3% recall and blow perplexity above 1,000. The architecture includes an "Engram block" after the Transformer's fourth layer and gated fusion with output logits. Code and results are on GitHub.