HackerTube / Video
Let's build the GPT Tokenizer
Andrej Karpathy

Andrej Karpathy builds the GPT tokenizer from scratch, implementing byte pair encoding along with encode and decode. He shows how many odd LLM behaviors trace back to tokenization, and covers Unicode byte encodings along the way.
Recommended as the best deep dive on tokenizers, worth the two hours for anyone working with LLMs.
8 Hacker News mentions · 2024–2025