Broken Tokens? Your Language Model can Secretly Handle Non-Canonical Tokenizations

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Zheng, Brian Siyuan, Liu, Alisa, Ahia, Orevaoghene, Hayase, Jonathan, Choi, Yejin, Smith, Noah A.
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912869628510208
author Zheng, Brian Siyuan
Liu, Alisa
Ahia, Orevaoghene
Hayase, Jonathan
Choi, Yejin
Smith, Noah A.
author_facet Zheng, Brian Siyuan
Liu, Alisa
Ahia, Orevaoghene
Hayase, Jonathan
Choi, Yejin
Smith, Noah A.
contents Modern tokenizers employ deterministic algorithms to map text into a single "canonical" token sequence, yet the same string can be encoded as many non-canonical tokenizations using the tokenizer vocabulary. In this work, we investigate the robustness of LMs to text encoded with non-canonical tokenizations entirely unseen during training. Surprisingly, when evaluated across 20 benchmarks, we find that instruction-tuned models retain up to 93.4% of their original performance when given a randomly sampled tokenization, and 90.8% with character-level tokenization. We see that overall stronger models tend to be more robust, and robustness diminishes as the tokenization departs farther from the canonical form. Motivated by these results, we then identify settings where non-canonical tokenization schemes can *improve* performance, finding that character-level segmentation improves string manipulation and code understanding tasks by up to +14%, and right-aligned digit grouping enhances large-number arithmetic by +33%. Finally, we investigate the source of this robustness, finding that it arises in the instruction-tuning phase. We show that while both base and post-trained models grasp the semantics of non-canonical tokenizations (perceiving them as containing misspellings), base models try to mimic the imagined mistakes and degenerate into nonsensical output, while post-trained models are committed to fluent responses. Overall, our findings suggest that models are less tied to their tokenizer than previously believed, and demonstrate the promise of intervening on tokenization at inference time to boost performance.
format Preprint
id arxiv_https___arxiv_org_abs_2506_19004
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Broken Tokens? Your Language Model can Secretly Handle Non-Canonical Tokenizations
Zheng, Brian Siyuan
Liu, Alisa
Ahia, Orevaoghene
Hayase, Jonathan
Choi, Yejin
Smith, Noah A.
Computation and Language
Modern tokenizers employ deterministic algorithms to map text into a single "canonical" token sequence, yet the same string can be encoded as many non-canonical tokenizations using the tokenizer vocabulary. In this work, we investigate the robustness of LMs to text encoded with non-canonical tokenizations entirely unseen during training. Surprisingly, when evaluated across 20 benchmarks, we find that instruction-tuned models retain up to 93.4% of their original performance when given a randomly sampled tokenization, and 90.8% with character-level tokenization. We see that overall stronger models tend to be more robust, and robustness diminishes as the tokenization departs farther from the canonical form. Motivated by these results, we then identify settings where non-canonical tokenization schemes can *improve* performance, finding that character-level segmentation improves string manipulation and code understanding tasks by up to +14%, and right-aligned digit grouping enhances large-number arithmetic by +33%. Finally, we investigate the source of this robustness, finding that it arises in the instruction-tuning phase. We show that while both base and post-trained models grasp the semantics of non-canonical tokenizations (perceiving them as containing misspellings), base models try to mimic the imagined mistakes and degenerate into nonsensical output, while post-trained models are committed to fluent responses. Overall, our findings suggest that models are less tied to their tokenizer than previously believed, and demonstrate the promise of intervening on tokenization at inference time to boost performance.
title Broken Tokens? Your Language Model can Secretly Handle Non-Canonical Tokenizations
topic Computation and Language
url https://arxiv.org/abs/2506.19004