This section is at https://rollingedition.com/language-models-from-the-ground-up/tokens#merge-frequent-pairs.