AI Infra Interviews logo

Weights as Code: Sparse Tables, Training and Language Model Memory

Understand wtable-lm's compiled memory, what the 97% claim measures, and how its separate edit layer works. Read the results with the right units and deployment limits.

BY MORGAN FOSTER · AIINFRAINTERVIEWS EDITORIAL · UPDATED DECEMBER 2, 2026 · 4 MIN READ

PRACTICE THIS:Learn model memory accounting (free) ·Trace compiled statistical memory (Premium) ·Practice optimization payback (Premium) ·Explore inference engineering

An LLM can write a program that builds useful language-model memory from text statistics. In Youngseong Kim's weights-as-code project, that program produces a large frozen table bank, and a smaller neural network learns how to use it. The headline about 97% concerns stored bytes. The model still trains, and its later fact-editing capability comes from a separate external memory layer.

The November 30, 2026 preprint is not peer reviewed. This guide examines the mechanism and reported evidence, with code references pinned to wtable-lm revision 970a1fc, checked December 2. We have not reproduced its GPU training or benchmark runs.

What the LLM writes, and what still trains

The LLM designs a compiler: code that reads a corpus and converts recurring patterns into compact lookup tables. An n-gram is a short sequence of adjacent tokens; its counts can suggest which token commonly follows. The stored values come from the corpus. They are not billions of numbers individually invented by the LLM.

The paper describes a 7.96 GiB table bank compiled from 31.8 billion FineWeb-Edu tokens and a 103.25M-parameter network trained on a separate 10 billion tokens. Its 18 lookup channels include 14 stored channels and four computed from the current document. The network learns gates that control their contributions. Sections 3–4 of the paper describe two places where these suggestions enter the prediction.

Follow a token through the table-assisted network

Step 1 of 4: Embed the input and run four layers

  1. Embed the input and run four layers

    The neural network builds a hidden representation of the preceding tokens. Lookup channels also produce candidate next tokens and scores.

  2. Read memory inside the network

    An Engram block turns selected candidates into an embedding-based suggestion and gates it into the hidden state.

  3. Run eight more layers

    The remaining Transformer layers process the representation. These layers and the memory-reading gates belong to the trained network.

  4. Combine output scores

    Position-dependent gates add channel scores to the neural logits. The optional fact editor acts afterward, at the output.

Original explanatory sequence for the paper's 12-layer configuration. Frozen corpus tables are read during inference; four document-dependent channels are computed dynamically.

Our Compiled Statistical Memory concept, which is Premium, follows one table row through a runnable CPU example. For the broader pattern, COUNT also uses corpus counts without learning a new embedding for every entry. Engram is related conditional-memory research; its learned lookup embeddings should not be conflated with frozen corpus counts.

Read the 97% claim as a storage calculation

For an illustrative uniform BF16 checkpoint, 103.25 million × 2 bytes = 206.5 MB, about 0.1923 GiB. Combining that payload with 7.96 GiB of tables gives approximately 8.1523 GiB; the table share is 7.96 / 8.1523 ≈ 97.64%. This explains the magnitude of the headline. It excludes other allocations and does not establish an actual device-memory peak.

Frozen tables need no gradients or optimizer state, but they still occupy memory and perform lookups. The paper keeps them on the GPU. Host-memory offload is proposed as future work there, so a CPU-offloaded latency claim would need another experiment. Start with our free Model Memory Footprint reference when comparing a small neural checkpoint with its complete serving footprint.

Keep the result's denominator attached

Perplexity exponentiates average prediction loss. Dividing that loss by tokens or by words produces different numbers. Bits per byte uses a different normalization again. The paper and current repository therefore need to be read with their metric labels intact.

Three reported metrics, three different units
Comparison
Metric and sourceNo-table baseline BTable model T
Word perplexity: paper Table 252.1146.41
Token perplexity: repository JSON17.875216.4279
Bits per byte: repository JSON0.9176910.890819
Author-reported evaluation on 2,000 held-out FineWeb-Edu test documents at context 1,024. Lower is better within each row. These are source records, not our benchmark measurements.

The paper's word-perplexity reduction is about 10.94%; the recorded token-perplexity reduction is about 8.10%. Those percentages describe different transformations of loss. The repository's T results and B results explicitly label token perplexity and bits per byte.

The reported mean accuracy gain is 1.24 percentage points on the main ten tasks, but 0.38 points across all 21 evaluated tasks. Some tasks also informed development. A parameter-matched comparison answers a useful question, but does not equalize table storage, compilation work or the corpus information available through the tables. Both models share a corpus-derived embedding initialization. Use the fixed-budget experiment lesson (Premium) to specify which resource your own comparison holds fixed.

How the separate fact editor works

The editor stores subject tokens, a hidden-state key and answer tokens. A key is the model's representation at the point where an example question asks for an answer. At runtime the editor checks both the subject span and similarity to that key. The implementation changes output logits without updating the neural weights or corpus tables.

A stored answer needs two triggers before it can fire
  1. Find the subject span

    Look for the stored token sequence in the recent document window. An absent subject or an unmatched alias leaves the model's output alone.

  2. Compare the hidden-state key

    Among matching subjects, use a qualifying key with the highest cosine similarity. The reported configuration uses a 0.93 threshold.

  3. Raise the answer token's score

    Put the stored answer token 1.5 above the largest current logit. Continue the sequence while generated tokens follow the stored answer.

  4. Stop or leave the output untouched

    A failed trigger makes no edit. A diverging generated token stops the answer chain. Alias and multi-hop understanding are outside this rule.

The threshold and margin belong to the reported experiment, not universal settings. This side memory is separate from the table-assisted model.

After 10,000 applied edits, the published final record reports 99.9% update exact match and 97.4% paraphrase exact match, each on 1,000 scored examples. The evaluation code samples those examples from the applied stream. Its 98.2% locality-retention figure measures unchanged unrelated answers, including answers that may already be wrong.

The repository explicitly says these results do not establish that tables make editing easier: a comparable full editing run on the no-table baseline is not reported. The editor also misses aliases and cannot turn one stored answer into reverse or multi-hop reasoning. These boundaries matter when designing a knowledge-update service.

What an infrastructure engineer can investigate now

As checked December 2, the repository README says the trained checkpoints and large table bank are not yet released. Code and result files support inspection; they do not provide a ready-to-run trained model.

Read the compiler-to-runtime interface, account for table storage, and compare lookup behavior across intended batches before proposing deployment. Treat tokenizer, compiler, tables and checkpoint as one versioned artifact set. The model-artifact concept covers that release contract, while Inference Engineering connects memory decisions to serving measurements. Access is labeled on those resources.

For a first exercise, use the small CPU example in the companion concept and predict what happens when the table misses. Then write down the evidence needed to justify a GPU experiment: representative requests, peak memory, complete-step latency, quality checks and the cost of compiling the memory.

PRACTICE THIS

Turn it into offers. Work the real questions and concepts this maps to:

FAQ

In wtable-lm, an LLM designs a program that builds frozen tables from corpus statistics. A roughly 103M-parameter neural network still trains with gradient descent. The separate fact-editing layer adds records without taking a gradient step.

Discussion (3)

Brandon SullivanEditor

A table compiler can be amortized across several training runs, but the comparison should state how many runs share it. One-time CPU work still belongs in the total resource account.

Maya CastilloEditor

Prefill knows the prompt's token IDs in advance. Autoregressive decode discovers new IDs as it generates. Test the lookup pipeline separately for those phases before extrapolating an offload result.

Owen HartleyEditor

An additional ablation could disable one channel in the trained model, then compare that with retraining without the channel. The first measures dependence on an existing input; the second allows the network to learn a different solution.