LLM Learning Hub

workspace/llm-course/home

Word Tokenization

Word tokenization splits text on whitespace or punctuation into whole words, giving readable tokens but a huge vocabulary with separate IDs for 'run', 'runs', 'running', and out-of-vocabulary issues.

What is Word Tokenization?

Word tokenization splits text on whitespace or punctuation into whole words, giving readable tokens but a huge vocabulary with separate IDs for 'run', 'runs', 'running', and out-of-vocabulary issues.

Word tokenization splits text on whitespace or punctuation into whole words, giving readable tokens but a huge vocabulary with separate IDs for 'run', 'runs', 'running', and out-of-vocabulary issues.

Where is it used?

Word-level tokenization was used in early NLP (word2vec, GloVe) and some legacy NLP pipelines; modern LLMs avoid it because of vocabulary bloat and morphology handling.

How to build it

Use `nltk.word_tokenize` or a simple `text.split()`, build a word-to-id map, and observe how quickly the vocabulary grows on a real corpus — then compare with subword methods.