Transformer Architecture and Tokenization Explained
Foundational module on Transformer mechanics and tokenization: embeddings, the attention family, encoder/decoder architectures, and subword tokenization.
Master the Transformer architecture end to end: tokenization, embeddings, the attention family, encoder and decoder families, hands-on fine-tuning, and fast inference with scaling laws.
Browse, search, and work through all available articles for this category.
Foundational module on Transformer mechanics and tokenization: embeddings, the attention family, encoder/decoder architectures, and subword tokenization.
The four ways to tokenize text, word, character, subword, and byte-level, and the trade-offs in vocabulary size, sequence length, and out-of-vocabulary words.
How Byte-Pair Encoding builds a subword vocabulary by merging the most frequent character pairs, how it encodes new words, and why GPT uses byte-level BPE.
How WordPiece tokenizes words for BERT, the ## continuation marker, greedy longest-match encoding, and how it differs from BPE by merging on likelihood.
How SentencePiece tokenizes raw text with no spaces to split on, the meaning of the underscore marker, the Unigram model, and why T5 and Llama use it.
A side-by-side comparison of BPE, WordPiece, and SentencePiece: how each picks its merges, how to spot them in the tokens, and which models use which.