GPT-2 TOKENIZER
BPE merge process
Merge adjacent symbols within one chunk using fixed rule ranks.
Input byte aliases
aaababcabxyzTeaching example- 1Select the earliest rule
- 2Scan and merge
- 3Update and repeat
Current adjacent pairsLower ranks merge first
Current operationRound outputi: scan start · j: found position
Traces captured from encoder.py. Teaching cases use artificial rules; the official case uses the published GPT-2 table.