# Byte pair encoding (BPE)

> Byte pair encoding (BPE): A way to learn a subword vocabulary: start from single symbols and repeatedly merge the most frequent adjacent pair. Encoding…

Canonical: https://llmdojo.dev/glossary/bpe

Also called byte pair encoding, BPE.

A way to learn a subword vocabulary: start from single symbols and repeatedly merge the most frequent adjacent pair. Encoding replays the learned merges in order.

Learn it in the lesson: [Byte pair encoding: learning merges](https://llmdojo.dev/learn/model-foundations/tokenization/byte-pair-encoding) (Model Foundations · Tokenization: From Text to Token IDs).

## Interview questions about Byte pair encoding (BPE)

- [How does byte pair encoding learn a vocabulary, and how does it then encode a word it never saw in training?](https://llmdojo.dev/interview/q/how-does-byte-pair-encoding-learn-a-vocabulary-and-how-does-it)
- [Compare the main NLP tokenization approaches. Then, how would you design a recommender that uses an LLM?](https://llmdojo.dev/interview/q/compare-the-main-nlp-tokenization-approaches-then-how-would-you-design-a)
- [How would you design a subword tokenizer for a new LLM? And separately, what is KL-regularised supervised fine-tuning, and why use it?](https://llmdojo.dev/interview/q/how-would-you-design-a-subword-tokenizer-for-a-new-llm-and)

## Related
- [Token](https://llmdojo.dev/glossary/token)
- [Tokenizer](https://llmdojo.dev/glossary/tokenizer)
- [Token ID](https://llmdojo.dev/glossary/token-id)
- [Vocabulary](https://llmdojo.dev/glossary/vocabulary)
- [Subword](https://llmdojo.dev/glossary/subword)
- [Special token](https://llmdojo.dev/glossary/special-token)
- [Glossary of every term](https://llmdojo.dev/glossary)
