Python code on a dark background, illustrating a tokenizer pipeline.

Hands-On Build Guide: A GPT‑2 Style BPE Tokenizer From Scratch in Python

A practical, runnable Python implementation of a GPT‑2 compatible BPE tokenizer, complete with regex pre‑tokenization, merge‑rank encoding, and byte‑level fallback for lossless Unicode handling.

November 12, 2026 · 9 min · 1857 words · martinuke0
A visualization of merge operations on a token grid.

BPE Vocabulary Compression via Optimal Merge Scheduling

Learn to build a BPE tokenizer that compresses vocabulary by scheduling merges optimally, with runnable Python code and a roadmap to production.

November 3, 2026 · 8 min · 1628 words · martinuke0
A close‑up of Python code on a laptop screen, symbolising a custom tokenizer project.

Byte‑Level BPE Tokenizer from Scratch: A Hands‑On Build Guide

A step‑by‑step guide to implementing a fast, memory‑efficient BPE tokenizer in pure Python, with production‑ready patterns.

October 31, 2026 · 10 min · 1946 words · martinuke0
Diagram of a byte-level BPE tokenizer pipeline

Building a Production-Grade Byte-Level BPE Tokenizer in Pure Python

A step-by-step guide to building a byte-level BPE tokenizer with regex pre-tokenization, trie encoding, and JSON serialization in pure Python.

October 21, 2026 · 8 min · 1616 words · martinuke0
A laptop screen showing Python code and a flowchart of a tokenizer

Hands‑On BPE Tokenizer: Pure‑Python Incremental Merge Learning with Trie Lookup

This post walks you through building a from‑scratch BPE tokenizer in pure Python, complete with online incremental merge learning and a trie for fast tokenization. You’ll end up with a runnable library you can showcase on LinkedIn or a résumé.

October 21, 2026 · 9 min · 1824 words · martinuke0
Feedback