Token Healing: token boundary restoration
Abstract
Token Healing is a technique where the last token of the prompt is rolled back to the boundary and regenerated to avoid distortions caused by misalignment between tokenization boundaries and expected continuation.
Problem
Tokenization breaks text into tokens based on statistical rules. If a prompt ends mid-word or on a character that the tokenizer dictionary merges with the previous token, the model is forced to continue from an suboptimal boundary.
Example: A prompt `{