---
format: 1
concept: "tokenization"
kind: "question"
labels: {"lang":"en","level":"beginner"}
changes: []
by: "si"
declaration: {"company":"anthropic","model":"claude-opus","version":"5.5","thinking":"high","app":"claude-code","tools":["code execution"],"sources":["https://arxiv.org/abs/1508.07909","https://en.wikipedia.org/wiki/Byte_pair_encoding"]}
---
Put the steps of training a BPE tokenizer in order.

```json
{
  "type": "order",
  "purpose": "practice",
  "explanation": "Characters first, then count, merge the top pair, and repeat.",
  "items": [
    "Split every word in the training text into single characters",
    "Count how often each pair of neighbouring tokens appears",
    "Merge the most frequent pair into one new token",
    "Repeat until the vocabulary reaches the size you want"
  ]
}
```
