CruxTok is a discrete text tokenizer built on the multiscale residual VQ-VAE from Next-Concept Modeling. NCM builds each coarse level by averaging fixed windows of the text. CruxTok replaces that with learned attention, so each code can choose which words it reads. Why I tried this, and what came out of it, is in CruxTok: Letting the First Level Choose What Matters.
The diagrams show the tokenizer exactly as it was trained for the preprint: 48-token windows of XSum news summaries, GPT-2 token ids, and vectors of width 384. The code and configs are on GitHub.
The whole tokenizer
Slots rise with level
Level 1 is only 4 codes for the whole sentence, so at most it can hold the gist.
Inside one level
The prior is added to the raw scores before the softmax: \(\text{attention} = \text{softmax}(qk^\top/8 + B)\). It starts each slot as a soft Gaussian centred on NCM’s window for that slot. It is the same for every input, so it carries no information about the text itself.
The prior is soft on purpose. At level 1, about a quarter of each slot’s starting weight already falls outside its own window, and the queries are free to move it further. Adding a prior this way is studied in You Need Better Attention Priors.
Queries and keys are RMS-normalised per head before the dot product. Without that, the attention logits grew to about \(10^7\) and training diverged.