← Speech and Language Processing
NLP›Popular Textbooks› SLP · Chapter 2

Chapter 2

Words and Tokens: How Text Becomes Model Input

Chapter: Words and Tokens, in Daniel Jurafsky and James H. Martin, Speech and Language Processing, 3rd edition draft, August 19, 2026.

Topics to learn

Page numbers refer to the linked chapter PDF.

FAQ

Does duplicating a sentence double its vocabulary?

No. The instance count doubles. The type count stays the same if no new word appears. Type-to-instance ratios change with corpus length.

What is the difference between BPE training and BPE encoding?

Training learns an ordered list of merges from a corpus. Encoding applies that fixed list to new text. An unseen word can still be represented if its pieces are in the learned vocabulary.

Why can the same sentence cost more tokens in one language than another?

A tokenizer trained mostly on English often keeps English words close to one token and splits other languages into smaller pieces. Token count is not a neutral measure of length.

Can Unicode normalization change edit distance?

Yes. Two strings that look like the same word can use different code points. Normalize both before comparing if you mean the linguistic form rather than the raw encoding.