ENGRAFT
Early-stage researchENGRAFT is an experimental technique, a few weeks old. What you read here are first measurements on one model, not a product.

Open research · Qwen3.8-Flash-Next · llama.cpp

Facts written into a language model's n-gram table.

ENGRAFT trains selected rows of the lookup table that some models carry next to the transformer, and nothing else. The transformer's weights stay frozen and the model file is never modified. The new facts ship as one small overlay file; remove it and the model is back, bit for bit.

Douglas Quail’s profession is

  • rows keyed by the last two words
  • rows keyed by the last three
  • rows the overlay rewrote
illustration: words stand in for tokens and the row addresses are made up; nothing here computes the model's real hashes · the real table has 320 million rows

Three numbers, and what limits each one

All results

0.841707 / 841

Exact answers, 100 facts about one invented world

0.841
0.005
  • with the overlay
  • base model
Limit841 test sentences, frozen before training and never used to stop it, but in the corpus's phrasings. Asked freely, one fact at a time: 35 of 98 with the overlay, 0 of 98 without.

s0b/engine_results.json

300facts

No capacity ceiling found so far

24 facts
0.804
100 facts
0.792
300 facts
0.821
LimitA separate corpus of short facts, not Quail, and a different metric: the answer's first token ranked first, not the exact answer. One fact per subject; many facts about one subject is untested.

capacity-curve/

0.0131KL

Collateral damage on neutral text, 100 facts

KL divergence: how far the model's next-token probabilities move away from the base model's, averaged over text that mentions none of the facts. Zero means identical.

100 facts
0.0131
storage noise
0.0033
LimitAbout 4× the noise of the table's own 4-bit storage, and it grows with the number of facts.

s0b/damage_it_text.json

What the model does at every token

The method
How one position reads the tableThe last two and three tokens are hashed by 16 heads into 16 rows of a 320-million-row table; the rows are added to the model at block 1. An overlay rewrites some of those rows.1The last two and three tokens216 rows of 320 million3Added early in the modelDouglasQuail’sbigram · 8 rowstrigram · 8 rowsone position of“Douglas Quail’s profession is”hasha 14 × 8 slice · red rings: rows an overlay rewritesaddblock 47⋮block 1 + 16 rowsblock 0token embeddingthe rest of the model readswhat the rows added

What it is

Memory addressed by tokens

  • A fact lives in the rows its n-grams hash to, and fires when a prompt contains those n-grams.
  • It sits inside the model's own forward pass: no context tokens, no retriever, no second model.
  • It travels as one file next to the model. The model files on disk are never modified.
  • The headline results are checked on the real inference engine, not only on a replica.

What it is not

Not general editing, not a RAG rival

  • It does not change what the model believes in general, only what some token windows read.
  • A sentence that shares no n-gram with the training corpus is not covered, by construction.
  • A fact written in Chinese left Italian questions exactly where the base model had them. Measured on one pair of languages and one cell.
  • Writing takes a gradient descent of hours, not a millisecond update.

Where we are

At the beginning

ENGRAFT is young research. Everything on this site was measured on one model, Qwen3.8-Flash-Next. The main benchmark is Quail, a corpus of 100 invented facts; the capacity curve comes from a separate corpus of short facts. On test sentences shaped like the training corpus the overlay is right 84.1% of the time (707 of 841); asked freely in a chat, it answers 35 of 98 questions. Composition across different subjects, crowding, updates and comparisons with other methods are still unmeasured.

We publish it this early so that it can be checked and challenged. The open problems are the plan.

How this was built

One human, and Claude Code

The code, the experiments and the write-ups were produced in Claude Code sessions driven by a single human operator, who set the goals, approved every design step, ran the hardware and read every result. Design, implementation, adversarial review and independent verification were done by separate model instances. You should know it before reading the numbers. We want the method checked, broken and improved.

Releases

Full log
  • v0.2.2

    A working demo, and the first reader debts

    Positioning as token-addressed memory, a corrected engine demo, the row-sharing measurement, the first open problems raised by readers.

    Release ↗
  • v0.2.1

    Three languages, and the mirror test

    The Quail corpus in English and Chinese next to Italian, and the Italian test set run against the Chinese overlay.

    Tag ↗
  • v0.2

    Usage-corpus descent, 100 facts

    The Quail corpus in Italian, one hundred facts written by a descent over a usage corpus, and a preliminary second language.

    Tag ↗
  • v0.1.0

    The surgical graft

    Eight neutral facts, each written into the trigram rows of one trigger. Seven of eight took, with zero interference between overlays.

    Release ↗