# I built an LLM where Gemini 4 wrote the initial weights as code

- HackerByte page: <https://hackerbyte.net/en/stories/building-an-llm-with-initial-weights-written-as-code-by-gemini-4-50699217>
- Original source: <https://weights-as-code.pages.dev/>
- Hacker News discussion: <https://news.ycombinator.com/item?id=50699217>
- Submitted to Hacker News: 2026-11-30T13:00:19.000Z

Building an LLM with initial weights written as code by Gemini 4.

## AI-generated summary

Researchers have developed a novel language model architecture where an LLM, specifically Gemini 4, generated the program to create over 97% of the model's initial weights. This weight\-space programming approach bypasses traditional gradient descent for weight initialization, relying instead on corpus statistics compiled into sparse tables. A smaller 103M\-parameter network is then trained on top, and an external edit layer allows for continual knowledge updates without retraining, demonstrating significant improvements in perplexity and factual accuracy.

## Key points

- An LLM \(Gemini 4\) generated a program to create 97% of a new language model's initial weights.
- Corpus statistics are compiled into sparse tables, forming the bulk of the model's weights.
- A smaller 103M\-parameter network is trained on these frozen tables.
- An external edit layer enables continual knowledge updates without retraining.
- The model achieves lower perplexity and higher zero\-shot accuracy compared to traditional models.
