tito: the hidden tokenizer bugs breaking RL training, and a Lean-verified fix

VoidAsuka · x · 2026-11-02

Background

A long-standing tito (token-in, token-out) problem plagues reinforcement learning: the transformations between messages, bytes, and tokens are not bijective—decoding and re-encoding tokens may not recover the original sequence, and byte-level edits can propagate tokenization changes in both directions. This is harmless in pretraining/SFT (fixed tokenized representations) but causes a nasty class of training bugs in RL rollouts.

Developments

The core mismatch

Agents communicate via structured tool-call messages, yet message renderers allow arbitrary global Python code (e.g., rewriting prior assistant messages when a user message is added, stripping thinking), compounding the inconsistency.

Original post →

More from coding & agent

coding & agent channel →