After BPE has an ordered merge list, applying it to a word is a deterministic replay. This lesson starts from one displayed word, applies the existing merges in order, and shows the exact token states.

highlighted = computed this step

Start from one word

Use the displayed word hug with starting symbols h u g. The merge list is the ordered list already shown, and this lesson simply replays that list on one word.

hug:h u g\text{hug}:h\ u\ g
Apply the Merge ListThe ordered merge list is replayed on one displayed word.Apply the Merge ListThe ordered merge list is replayed on one displayed word.apply merge list to hugfocus word: hug; each state is previous tokens plus the pinned mergestate 0hugh u gmerge (u,g)->ugstate 1hugh ugmerge (h,ug)->hugstate 2hughugstatic replay only; no client computation

Apply merges in order

First apply merge 1: (u,g) becomes ug, so h u g becomes h ug. Then apply merge 2: (h,ug) becomes hug, so h ug becomes hug. The order matters because the second pair exists only after the first merge.

m1:(u,g)ug,m2:(h,ug)hugm_1:(u,g)\to ug,\quad m_2:(h,ug)\to hug
Apply the Merge ListThe ordered merge list is replayed on one displayed word.Apply the Merge ListThe ordered merge list is replayed on one displayed word.apply merge list to hugfocus word: hug; each state is previous tokens plus the pinned mergestate 0hugh u gmerge (u,g)->ugstate 1hugh ugmerge (h,ug)->hugstate 2hughugstatic replay only; no client computation

Summary

The exact final token list for this displayed word is hug. This is only a deterministic replay of the shown merge order for one word.

final tokens=[hug]\text{final tokens}=[hug]
Apply the Merge ListThe ordered merge list is replayed on one displayed word.Apply the Merge ListThe ordered merge list is replayed on one displayed word.apply merge list to hugfocus word: hug; each state is previous tokens plus the pinned mergestate 0hugh u gmerge (u,g)->ugstate 1hugh ugmerge (h,ug)->hugstate 2hughugstatic replay only; no client computation