BPE started as a text-compression technique and was adapted to subword tokenization for language models. Training begins with single characters or bytes and learns an ordered list of merge rules; new text is tokenized by applying those rules in order.
Byte-level BPE, used by GPT-2 and RoBERTa tokenizers, starts from the 256 possible byte values, so any text can be encoded without an unknown-token symbol. See our explainer on how tokenization works.