Knowledge Sprint SeriesMT24 Learning

Phase 8 · Summary · Sprints 22–25 of 90

Tokenization & Parsing

Pieces, merges, trees and a release: four sprints on turning text into structure, every number rerun in code.

4 sprints, 4 code runsVerified sourcesOne phase project

Phase 8 summary, a one-page catalog: Tokenization & Parsing. The full text of the page follows.
Full resolution2160 × 2700 PNGPhase on GitHub

The part of the image you are reading lights up. Tap a part to jump to its text.

Figure in words

  • A dark code window
  • three word pieces: un · believ · ably
  • e + s → es
  • toytok 0.1.0 · wheel
  • run 1 = run 2 ✓
  • a tree: + over 2 and a * node over 3 and 4
  • four tags beside it: Pieces · Merges · Trees · Release

The Sprints

Subword Pieces

23 chars, two [UNK] words, or 7 pieces that glue back into the text.

Sprint 22

Merge Ties

Ten merges: 95 symbols to 28. Six were ties, and ties change splits.

Sprint 23

Parse Trees

2 + 3 * 4: 14 by the grammar, 20 by the other tree. Readings grow 2, 5, 14…

Sprint 24

Sealed Release

Built twice, same SHA-256. PyPI never reuses a filename.

Sprint 25

Now I Can Outcome

Tokenize, train BPE merges, parse with precedence, ship a wheel.

Mistakes Avoided Lessons

Words counted as tokens, hidden tie rules, silent duplicate keys.

Habits Kept Practice

Round-trip encodings. Print the merges. Reject with a reason.

Phase Project

One small library: a tokenizer with BPE merges and a strict parser, tested and released on TestPyPI.

R Trusted Sources

  1. Sennrich et al. 2016
  2. Kudo & Richardson 2018
  3. Petrov et al. 2023
  4. Church & Patil 1982
  5. PEP 440

The Sprint Pages

  1. Sprint 22/90How Tokenization WorksA model never reads my words. It reads the numbers a tokenizer hands it.
  2. Sprint 23/90Byte Pair Encoding & Its Edge CasesA tokenizer is a list of merges. Change the list or its order, and words split differently.
  3. Sprint 24/90Parsing Structured Meaning from TextText has an order. Meaning has a shape. A parser finds the shape, or says it cannot.
  4. Sprint 25/90Publishing a PackageA release is a promise kept in a file. Once it is out, it cannot be quietly changed.

Cite this phase

Tahri, M. (2026). MT24 Learning — Knowledge Sprint Series, Phase 8: Tokenization & Parsing (Version 1.0) [Educational resource]. Zenodo. https://doi.org/10.5281/zenodo.23213765

Version DOI 10.5281/zenodo.23213765 · all versions 10.5281/zenodo.23213764 · first published 2 October 2026