liveBook · Manning

Token

As explained in Inside AI

A token is a sequence of characters, word fragment, or related text unit processed by a language model.

A token is a text unit a language model processes. It may be a whole word, a word fragment, or characters such as a trailing space. As a rule of thumb, one token represents about four characters of standard English text; this varies. section 5.3.1

Language models use tokens to process text and predict what comes next from the preceding text. They may choose a likely continuation or sometimes select a lower-probability one, so predictions are not always the single most likely option. section 5.3.1

An electric-vehicle prompt

Given “The benefits of electric vehicles are …”, a model might predict “plentiful,” “numerous,” or “economic.” These continuations illustrate prediction; tokens need not correspond to complete words. section 5.3.1

How Inside AI covers it

How deep it goes
Defines tokens as whole words or fragments and gives a rough character rule of thumb.
Examples
Illustrates prediction with an electric-vehicle prompt and possible continuations.
What you can do after
Understand how language models divide text into tokens and predict continuations from preceding text.
How it connects
Links tokens to tokenization, language models, and next-token prediction.

Also explained in

Compare how 31 books explain token →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside AI. The section links point to the parts of the book it draws on.