liveBook · Manning

Token

As explained in Introduction to Generative AI, Second Edition

A token is a word or subword unit into which a text sequence is divided for computational processing.

A token is a word or partial word into which text is divided for computational processing. A language model converts tokens into a mathematical representation, processes them, and converts its output back into readable text. In machine translation, for example, “The cat wore red socks” becomes “El gato usó calcetines rojos.” section 1.2

Tokens can also serve as markers for tool use. A model trained with examples of API calls can learn to produce special tokens that signal when to use a tool, such as search, and include its result in the response context. section 8.11

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Defines tokens as words or partial words and describes special-token use in tool training, without detailing tokenization internals.
Examples
Uses “The cat wore red socks” for translation and special tokens to mark API calls.
How it connects
Connects tokens to natural language processing, neural networks, attention, machine translation, and API-based tool use.

Also explained in

Compare how 31 books explain token →

Related concepts

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