An LLM wrote the code to set 97% of another model’s weights

A translucent neural network mesh overlaid on a vast library of ancient books, with glowing threads drawing direct connections from book spines to specific nodes—symbolising AI-written code mapping st

An independent researcher has developed a language model where 97% of its stored weights are written directly by an LLM—Gemini 4—without any gradient descent. The approach, called weight-space programming (WSP), marks a shift from traditional training: instead of learning all weights through backpropagation, the model uses a compiler designed by Gemini to convert 31.8 billion tokens of corpus statistics into a 7.96 GiB bank of sparse lookup tables. These tables form the bulk of the model’s parameters and remain frozen. Only a 103-million-parameter network on top is trained, using 10 billion tokens on a single GPU.

A new role for LLMs: weight programmers

Rather than fine-tuning or prompting, Gemini 4’s role here was architectural. It designed a compiler that programmatically generates initial weights based on n-gram, skip-gram, synonym, concept, rule, and in-context statistics from FineWeb-Edu—data disjoint from the model’s training set. The compiler outputs structured tables that respond to specific patterns in input sequences. This method bypasses the need to learn these associations during training. The result is a model that reaches a word-level perplexity of 46.4 on held-out data, 11% lower than a baseline of the same size without tables. According to Kaplan et al.’s (2020) scaling laws, this performance gain is equivalent to increasing the network size by about 1.5×—but without the compute cost.

Training minimal, updating instantly

Because most of the knowledge is stored in static tables, the trainable part of the model is small—just 103 million parameters. After initial pretraining, the system supports continual knowledge updates via an external edit layer. New facts are added as records containing subject tokens, a hidden-state key, and answer tokens. Each edit takes about 12 ms on a single T4 GPU and requires no gradient step. When a query matches both the subject and hidden-state similarity (cosine ≥ 0.93), the system overrides the next-token logits to produce the stored answer. Over 10,000 sequential WikiBigEdit updates, the model recalled 99.9% of edited questions and 97.4% of paraphrased versions, while leaving 98.2% of unrelated answers unchanged.

Outperforming fine-tuning and LoRA

Traditional methods like full fine-tuning or LoRA struggle with such edits. They recall at most 36.3% of updated facts and increase perplexity beyond 1,000, indicating severe degradation. In contrast, this model’s perplexity changes by just 0.003% after edits. The edit layer stores facts outside the main tables, avoiding interference—direct table writes failed because question templates dominate final tokens. Records are plain data, making them inspectable, deletable, or writable by humans or other LLMs. A new edit for the same subject-relation pair replaces the old one, ensuring freshness.

What it means

This architecture reduces reliance on large-scale training infrastructure, making it relevant for organisations in the UK, UAE, US, and Kazakhstan seeking cost-efficient, auditable AI systems. By decoupling knowledge storage from training, it enables real-time updates without retraining—critical for regulated or fast-moving domains. The use of Gemini 4 to design the compiler raises questions about vendor lock-in, but the open release of code and results at github.com/Kim-Ai-gpu/wtable-lm supports transparency and independent replication. Still, the dependency on a proprietary LLM for core design may concern teams prioritising full control.

The method also challenges assumptions about how knowledge should be embedded in models. If most linguistic patterns can be captured through static statistics, future models might shift toward hybrid architectures—part learned, part programmed. For founders and engineers, this suggests a path to lighter, more maintainable systems, especially where data privacy, cost, or update agility are priorities.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *