BPE (Byte Pair Encoding) is a subword tokenization algorithm: start from byte/character-level units, count co-occurrence of adjacent symbol pairs, merge the most frequent byte pair into a new vocabulary symbol each iteration until the target vocab size
V is reached; encoding greedily matches the longest subword. Mainstream LLMs (GPT/LLaMA/Qwen) use byte-level BPE with vocabularies of 30K-150K tokens.