A language model on this week's Hacker News front page keeps 97% of its bytes in tables that no gradient step ever touched.
No LLM typed those numbers in. Gemini 4 Neon wrote the program that counts them out of 31.8 billion tokens of text.
That difference is the whole story, and it's a pattern you can borrow without a GPU.
What Gemini actually wrote
The post is "I built an LLM where Gemini 4 wrote the initial weights as code" (469 points). Behind it are a demo page, a preprint by Youngseong Kim, and the code, wtable-lm, under MIT.
The title made people picture an LLM writing floats one by one. That's not what happened, and andai, causal and Sena_997 said so in the thread. Gemini designed a compiler: which 18 channels to keep (n-grams of one to five tokens, skip-grams, synonym clusters, concept pairs, rule and in-context channels), how to hash them, which keys survive, how to pack the values. The values themselves are plain corpus statistics. The result is a 7.96 GiB bank of sparse tables, frozen before training starts.
Then a 103M-parameter Transformer is trained the normal way, on 10B other tokens, with the tables bolted on.
How the tables reach the output
The bolt is small. I read fuse_chunk in sparse_engine.py and compute_gates in model_fw.py. Paraphrased:
logits = network(h) # one score per vocab token gates = gate_mlp(h, channel_hit_flags) # 18 numbers, one per channel for c in channels: logits[cand_tokens[c]] += gates[c] * cand_scores[c] Each channel looks up the current context and offers a few candidate next tokens with scores. A tiny MLP decides, at every position, how much to trust each channel. There's also one "Engram" block after the fourth layer that feeds table hits back into the hidden state. Everything the network learns is either language modeling or trust.
I built the same split at toy scale
The trained weights and the 8 GB tables aren't released, so I couldn't run the model. The repo does ship its 2,000 validation and 2,000 test documents from FineWeb-Edu, so I wrote a small stand-in in plain Python: a program counts unigram, bigram and trigram tables from 1,800 validation docs, and the only thing "trained" is the mixing weights, fit by EM on the other 200. The compiler half:
for d in train: seq = [BOS, BOS] + [w if w in vocab else UNK for w in d] + [EOS] for i in range(2, len(seq)): u, v, w = seq[i - 2], seq[i - 1], seq[i] uni[w] += 1 bi[(v, w)] += 1 tri[(u, v, w)] += 1 Then I scored all 2,000 test docs:
$ python3 -I tables_toy.py assets/val_docs.jsonl assets/test_docs.jsonl compiled from 1,749,143 words: 1,886,189 table entries (34,643 uni, 573,274 bi, 1,278,272 tri) tune on 200,929 words, test on 1,780,998 words (2000 docs) unigram only test ppl 969.2 equal weights, 0 learned test ppl 389.0 one learned mix, 3 numbers test ppl 388.4 weights 0.38 0.51 0.11 per-bucket mix, 24 numbers test ppl 373.0 trigram context seen 1-2 times: uni/bi/tri weights 0.41 0.52 0.06 trigram context seen 10+ times: uni/bi/tri weights 0.27 0.44 0.29 Word-level perplexity with my own tokenizer, so don't hold it next to the paper's 46.4. The shape is what matters. Counting alone takes you from 969 to 389, and nothing was learned. A single global mix barely moves it. Letting the weights depend on how often the context was seen buys another 4%, from 24 numbers. And the weights it learns make sense: a trigram seen once or twice gets 0.06 of the vote, one seen ten or more times gets 0.29.
That's the gate in wtable-lm, at a vastly smaller scale. The counts carry the knowledge. The learned part decides when to believe them.
Why code beats hand-written weights
The best comment in the thread wasn't about this paper. riverdweller had an LLM hand-build a network that copied a slow Monte Carlo risk model, with no training data. It agreed with the simulation about 98% of the time. But some weights were around 10^10, so the answer came from subtracting two huge numbers, and any gradient step blew it up. The network worked, and gradient descent could never improve it.
Counts don't have that problem. They're bounded, they mean something you can check, and the program that made them can be rerun on more data, reviewed in a diff, or swapped out. The paper's own probe shows the scaling: keep only the most frequent eighth of the table entries and validation perplexity is 50.8, already better than the baseline's 52.6. Keep them all and it's 47.2.
So my claim: when you want an LLM's knowledge inside a model, have it write the program that computes the weights, not the weights. The program is the artifact a person can read. agnosticmantis described it in the thread as the LLM building the features and gradient descent fitting a model on top. Call it feature engineering with an LLM in the engineer's seat. That's exactly why it's useful.
What the headline number costs
The demo page leads with "11% lower perplexity." That's word-level. The same result is 8.1% in token perplexity (16.43 vs 17.88) and 2.9% in bits per byte (0.891 vs 0.918). One result, three units, and the page picks the biggest.
The comparison holds trained parameters equal, which benob and lumost pushed on: the table model also carries 8 GB of frozen numbers. In the repo's own result files, the table model used 8.34 GB of GPU memory after loading on a T4. The baseline used 0.39 GB. That's 21 times the memory for the 2.9%.
There's also a row the README leaves out. results/benchmarks/ includes Qwen3.5-0.8B, about 750M parameters. On the FineWeb-Edu test docs the table model edges it, 0.891 bits per byte to 0.899. On general benchmarks Qwen leads by a mile: HellaSwag 49.6 to 36.5, ARC-Easy 61.6 to 51.1, SciQ 86.6 to 77.3. Tables compiled from FineWeb-Edu help most on text that looks like FineWeb-Edu.
The edit layer is a separate story
The other headline is adding 10,000 facts after training with no gradient step: 99.9% recall, 12 ms per fact, perplexity flat, while fine-tuning and LoRA wreck the model. Each fact is a record (subject tokens, a hidden-state key, answer tokens) that fires only when the subject appears verbatim in the last 64 tokens and the hidden state matches the key.
The README is honest about the scope. The edit layer reads no tables, runs on the baseline too, and the results don't show tables make editing easier. 13rac1 pointed out it misses aliases, reverse questions and multi-hop questions, and antonvs placed it in the memory-based editing family with GRACE and SERAC. It's a solid pattern (facts as data you can inspect and delete), but it's not a consequence of weights as code.
What you can do today
Reproducing the paper isn't a weekend job. The full compile ran 19 map workers on cloud CPU VMs plus a 5.4 hour merge, and training took 23.6 hours on an A100. What you can do:
- Read
fuse_chunkandcompute_gates. The whole fusion idea fits on one screen. - Open
results/. Every number above, including the Qwen row, is in plain JSON. - The README says
python wtable/test_local_smoke.pyruns on a CPU in under a minute. I didn't install PyTorch for it, so I haven't seen it pass. - Try the split on your own corpus. Have your LLM design the counting program for your domain, freeze the counts, and fit only the mixer.
If you had an LLM write the counting program for your own data (logs, support tickets, a codebase), what's the first channel you'd have it count?

