Kim-Ai-gpu/wtable-lm
Machine LearningA research LM with 8 GB of LLM-designed sparse lookup tables compiled before training, plus a training-free fact-editing layer.
What it is
wtable-lm is the code and results release for a small research language model whose stored bytes are mostly a program-generated weight table rather than trained parameters. An 8 GB bank of sparse hash tables (about 7.96 GiB) carries over 97% of the model's stored bytes; a compiler builds it from 31.8B FineWeb-Edu tokens before any gradient step, and it stays frozen during training. A 103M-parameter Transformer with an Engram block and gated channel fusion is then trained on 10B unseen tokens. The compiler's 18 channel definitions were written by an LLM, while the table values are corpus statistics.
A second contribution is a training-free edit layer: each new fact is stored as subject tokens, a hidden-state key and answer tokens. The layer fires only when the subject span appears in context and the final hidden state matches the key above a cosine threshold, then boosts the answer tokens at the output logits. No weights or tables change.
The 103M table model (T) is compared against an equally sized no-table baseline (B): test perplexity 16.43 vs 17.88 and a mean zero-shot accuracy of 56.11 vs 54.87 across 11 tasks. The edit layer retains high update/rephrase/persona accuracy after 10,000 sequential WikiBigEdit edits while local questions stay stable; the README explicitly notes these results show a strong editing method on T, not that tables make editing easier. The paper is on Preprints.
Quick start
Requirements are Python with requirements.txt; a CPU is enough for the smoke tests. A GPU is needed for training and evaluation.
pip install -r requirements.txt
python wtable/test_local_smoke.py # hash parity, causality, document isolation, KV cache, rule hot-swap; under 1 min
python scripts/summarize_results.py # regenerates the result tables from results/
Full reproduction is a longer pipeline. Compile the tables on CPU first, using the released assets/ split and tokenizer so the val/test documents stay excluded by hash; phase 0 builds the BPE-32k tokenizer and SVD-128 geometry, phase 1 maps over FineWeb-Edu shard ranges (needs g++ with OpenMP) and merges them into artifacts/ with tables_fw.pt, svd128.npy, the tokenizer, held-out docs and split metadata. Then run MODEL=T bash scripts/train.sh (reported at about 116k tok/s, 23.6 h for 10B tokens on one A100 40GB; a TPU via DEVICE=xla is also supported) or MODEL=B bash scripts/train.sh. Both models initialise embeddings from svd128.npy, so B still needs artifacts/ minus the table file. Evaluation uses WEIGHTS=runs/train_T bash scripts/eval.sh; continual editing is prepared with python scripts/prepare_wikibigedit.py and run through METHOD=overlay|ft ... bash scripts/edit.sh. Re-running a training command resumes from the last checkpoint. The README's writing order is compile → pretrain → evaluate → edit (reproduction steps).
Constraints
- Checkpoints are not released yet. The T and B weights (~200 MB each) and the 8 GB table bank are promised but currently absent, so training and the edit layer cannot be run without going through the compile and pretrain pipeline.
- Heavy resources. Compiling the tables took 19 map workers over 2–4 shards each and a 5.4 h merge on a 30 GB RAM VM in the paper's run; pretraining a single model takes roughly a day on an A100. The edit-layer demo also needs GPU inference and the compiled tables.
- Edit-layer scope. It fires only on verbatim subject spans, so aliases are missed; answers are emitted verbatim, and reverse or multi-hop questions are not answered from an edit. It reads the final hidden state but does not read or write the tables, and a baseline run with the layer has smoke tests but no reported full results.
- Data and licence. Pretraining uses FineWeb-Edu (ODC-By), editing uses WikiBigEdit T1 (Apache-2.0), and code is MIT. In fp16, the baseline's MLP down-projection is switched to fp32 automatically to avoid overflow.
HotRepo's take
wtable-lm is a research artifact, not a usable model drop: the README is unusually careful about scope (the editing gains are attributed to the edit layer, not to the tables) and ships smoke tests, result JSONs and a result-summary script that make the claims easy to inspect. The catch mirrors that honesty: without the promised 8 GB table bank and weights, readers can verify the repository's tests and tables of numbers, but cannot reproduce the headline perplexity or editing results cheaply. On HotRepo it appeared on the new-project Python list on 2026-12-01, reaching 117 stars and 12 forks, with 17 of those stars added in the tracked window that day.
Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.
You might also like
- google-ai-edge/LiteRT-LMRun large language models locally on phones, browsers, desktops and IoT devices, with GPU/NPU acceleration and a C++, Python, Kotlin, Swift or web API.
- RikiyaT/lm_understand-logsOpen experiment logs showing how a language model reads, repairs and writes neural network weights from raw parameters.
- Prefrontal-AI/latent-sparse-attentionResearch code for Latent Sparse Attention, an SGLang plugin that speeds up long-context prefill, decode and training.