Byte-Pair Encoding and Out-of-Vocabulary Vulnerabilities
Before a language model computes self-attention or samples next-token probabilities, it must convert raw text into numerical identifiers. This conversion relies on tokenization algorithms, with Byte-Pair Encoding (BPE) being the standard implementation across most modern foundation models. BPE was originally designed for data compression. In natural language processing, it builds a fixed-size vocabulary of subword units that balances vocabulary size against sequence length. While BPE solves the classical out-of-vocabulary (OOV) problem by falling back to raw byte representations, it introduces operational and security vulnerabilities.
Read More
| Share
