liveBook · Manning

Token

As explained in Grokking AI Applications

A token is a discrete text unit that a language model converts into numerical representations and processes as input or output.

A token is a small text unit that an LLM reads and produces. Tokenization splits language into words, parts of words, or punctuation marks, so a single complex word may become several tokens. section 1.5

After splitting text, the model converts each token into numbers called an embedding. These numerical representations become the atomic units used in computation; tokens with related meanings can occupy nearby positions in the embedding space. section 1.5 section 1.6

Completing a sentence one token at a time

For the prompt “The capital of Italy is ...”, the model uses the token representations and their context to predict a likely next token, such as “Rome.” Repeating that process builds longer text, including sentences, paragraphs, or reports. section 1.5 section 1.7

Figure 1.7 Words are numbers in the eyes of an LLM.

Visualizes how an LLM represents words as numerical coordinates rather than treating them as ordinary text. section 1.5

How Grokking AI Applications covers it

How deep it goes
Defines tokenization and embeddings, illustrates next-token generation, and stops short of detailed tokenizer or transformer internals.
Examples
Uses words, punctuation, “The capital of Italy is ...”, an eight-token vocabulary, and GPT-3’s larger vocabulary as examples.
What you can do after
Evaluate how prompts become numerical representations and how LLMs build responses through repeated next-token prediction.
How it connects
Connects tokens to tokenization, embeddings, context, prompts, autoregressive models, and transformer models.

Also explained in

Compare how 31 books explain token →

Related concepts

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