What is byte-pair encoding?
A way of building a tokeniser: start from single characters and repeatedly merge the most frequent neighbouring pair into one new token.
Where it is taught
How tokenisers are built. Real models do not read letters or whole words. They read word pieces, found by an algorithm that merges the most frequent pairs again and again.
What the lesson leaves you with
- BPE starts from characters and repeatedly merges the most frequent neighbouring pair.
- Common words become single tokens. Rare words are built from pieces.
- Models see token ids, not letters, which explains some of their odd weaknesses.
Questions
- What is byte-pair encoding?
- A way of building a tokeniser: start from single characters and repeatedly merge the most frequent neighbouring pair into one new token.
- Where is byte-pair encoding used in AI?
- Real models do not read letters or whole words. They read word pieces, found by an algorithm that merges the most frequent pairs again and again.
- What is the key idea to remember about byte-pair encoding?
- BPE starts from characters and repeatedly merges the most frequent neighbouring pair.
- Where can I learn byte-pair encoding step by step?
- In the lesson “How tokenisers are built” in Gradient’s course on the maths behind AI, with interactive diagrams and questions.