liveBook · Manning

Vocabulary

As explained in Applied Reinforcement Learning

A language model’s vocabulary is the set of tokens it can represent and select as output.

A language model’s vocabulary is the set of tokens it can represent and choose from. Text is split into tokens, which are mapped to integer IDs. During generation, the model selects one token at a time, appends it to the context, and chooses again. section 10.2

From words to choices

“Take aspirin today” might be split into three tokens, though a tokenizer may divide words into smaller pieces. At each generation step, the model chooses from its vocabulary; a typical vocabulary contains 30,000 to 150,000 tokens. section 10.2 section 10.3

Figure 10.2 Language generation mapped as a Markov Decision Process.

Shows language generation as a Markov decision process, with choosing a token from the vocabulary as the action. section 10.3

How Applied Reinforcement Learning covers it

How deep it goes
Traces tokenization into IDs and repeated next-token selection, then maps the model’s output to a categorical policy.
Examples
Uses “Take aspirin today” to illustrate tokenization and a lisinopril query to illustrate next-token choices.
What you can do after
Understand how vocabulary choices produce text through sequential next-token generation.
How it connects
Connects vocabulary to tokenization, token IDs, language-model policies, and discrete action spaces.

Also explained in

Compare how 17 books explain vocabulary →

Related concepts

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