Most language models read text through a tokenizer that is fixed before training. Recent models learn the segmentation, but they are autoregressive and still write character by character. Zonkey is a hierarchical, non-autoregressive language model trained from characters, with the tokenizer inside the network. Each level groups its tokens into units and compresses each into one vector, its code. A code unfolds back into its whole unit in one parallel step, and codes are the tokens of the next level: characters become word-like units, then longer ones. Zonkey rests on an unusual model of text: a unit has no hard end. It is an infinite sequence of tokens, each paired with the probability that it still belongs to the unit, its existence. A boundary discounts what comes after it and cuts nothing off, so units overlap and need no end token. Three ideas make this model trainable. First, Probabilistic Attention: existence enters attention as a bias, and that trains the tokenizer. Where a unit starts is a discrete choice with no gradient, but the boundary probabilities set existence, which is continuous, so the model's ordinary losses train them. Second, the model makes its own hard negatives. Above the characters a token is a vector, not an entry in a vocabulary, so a reconstructed token can only be scored against wrong candidates, and random ones are far too easy. Zonkey adds a hard one, the model's own guess of the token from its context, made without the code: the code must beat the context. Third, codes are generated by flow matching on a sphere, and the denoiser is the codec itself: a noisy code is unfolded into a unit and compressed again. Preliminary experiments with small models on one consumer GPU show all of this at work: word-like units are learned with no supervision, text is decoded from its codes through three levels, and short phrases are generated from noise.
翻译:暂无翻译