You Can Learn Tokenization End-to-End with Reinforcement Learning
Abstract
Lay Summary
Before a language model can read text, the text is first chopped into small pieces in a step called tokenization; grouping letters into larger chunks lets the model process language faster. Today this is done by a separate, hand-built program that follows fixed rules chosen in advance and, unlike the rest of a modern AI system, never learns or improves from data. We asked whether a model could instead figure out for itself where to cut the text, as part of its ordinary training. Our method lets the model try different ways of splitting the text and rewards the choices that make what comes next easier to predict — a trial-and-error approach borrowed from reinforcement learning. Remarkably, without being told anything about words or grammar, the model discovers sensible boundaries on its own, such as breaking at the spaces between words, and it does so better than previous attempts to learn this step. This brings us closer to AI systems that are learned from start to finish, with no hand-designed parts. The same idea could eventually help models handle data such as audio or video, where there is no obvious way to divide the stream into pieces.