Stanford CS336 restarts with Percy Liang on BPE tokenization in the LLM lifecycle

stanfordnlp · x · 2026-10-16

Stanford NLP shared a clip from the restarted CS336 "Language Modeling from Scratch" course: Percy Liang explains how tokenizers convert raw bytes into integer token sequences (with an encode/decode demo on "Stanford was founded in 1885."), and walks through Byte-Pair Encoding—starting from single bytes and repeatedly merging the most frequent adjacent pairs, so "unhappiness" can split into "un"+"happi"+"ness". BPE endures because it balances vocabulary size against context length.

Original post →

More from Research

Research channel →