# A language model architecture whose initial weights an LLM can write as code (HN 208) <!-- ref: @content/web/weights-as-code/2026-11-30-weights-as-code-llm-architecture tags: [weight-space-programming, language-models, knowledge-editing] version: 2 updated_at: 2026-11-30T22:45:31.230Z --> **[Read the original](https://weights-as-code.pages.dev/)** *Synthesized from the project page by Youngseong Kim (HN 208 points).* ## Core Thesis Instead of training all weights, an LLM writes a compiler that turns 31.8B tokens of corpus statistics into frozen sparse tables, over 97% of the model's stored bytes, with no gradient step. Gradient descent trains only a 103M-parameter network on top, and an external edit layer adds facts without training. ## Key Insights - The tables are 7.96 GiB; the Transformer reads them through an Engram block after its fourth layer and through gated fusion with its output logits. Eighteen channels (n-gram, skip-gram, synonym, concept, rule, in-context) each return next-token candidates with scores. The compiler was designed by Gemini 4 Neon. - With 10B training tokens on one GPU, word-level perplexity on held-out FineWeb-Edu is 46.4 against 52.1 for a parameter-matched model without tables, 11% lower, comparable to a network about 1.5 times larger, plus 1.2 points of mean zero-shot accuracy over ten tasks. - Over 10,000 sequential WikiBigEdit edits the edit layer answers 99.9% of edited questions and 97.4% of paraphrases, keeps 98.2% of unrelated answers unchanged and moves perplexity by 0.003%, at 12 ms per fact. Fine-tuning and LoRA recall at most 36.3% and push perplexity above 1,000. - An edit stores subject tokens, a hidden-state key and answer tokens as plain records; one fires only when the subject appears in the last 64 tokens and cosine similarity is at least 0.93. ## Actionable Takeaways - Shows a path for continual knowledge updates as inspectable, deletable records rather than weight edits, with code at github.com/Kim-Ai-gpu/wtable-lm. --- *You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).* *Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*