Alignment training seems to be revertible and unstable to simple re-tokenizations. Under which conditions does it happen, and could we build defenses by consistency training with respect to re-tokenizations?
this seems absolutely fundamental to a theory of LLM alignment. however, given the existing vast tokenization efforts of the frontier models, I wonder if the focus shouldn’t be on the auto-refactoring that seems to occur when new libraries of tokens are added, such as we saw for math and coding?
TLDR: Tokenization is the way that text is segmented before being input to a language model. Despite never being exposed to alternative tokenizations during training, LLMs unexpectedly develop the capacity to comprehend and even produce incorrectly tokenized text. We believe that these behaviors are understudied from an alignment perspective, and hope that this post will provoke discussion of the topic.
We aim to develop a guide to recent progress in understanding tokenization through a sequence of blogposts, geared toward alignment researchers, synthesizing recent literature and reporting experiments we conduct. This first post highlights counter-intuitive, safety-relevant behaviors of models with regard to tokenization and presents a guiding research agenda.
0. How tokenization works, quick recap
In modern LLM research, tokenization is an essential initial step before pretraining. The tokenizer (commonly, byte-level byte-pair encoding or BBPE (Gage, 1994)) splits the internet-scale dataset into byte-level chunks and begins a sequence of merges, optimizing compression (via frequency-based merging in BPE) or pointwise mutual information (as in WordPiece (Song et al., 2021)). Building the vocabulary is usually greedy, in the sense that merges only add new tokens and do not remove previous ones, implying that individual characters are valid tokens. Throughout subsequent model training, the tokenizer is usually left unchanged.
Although the choice of tokenizer is known to affect multi-lingual capabilities (Limisiewicz et al., 2023) as well as math and coding performance (Singh & Strouse, 2024), it rarely attracts the attention of alignment researchers.
The mapping between token and character alphabets is uniquely determined by the tokenizer, which can be defined as a pair of maps . [1] The encoding function provides an injective mapping from byte/character sequences to token sequences [2]. Thus, any tokenization that lies in the image of , i.e. for any is a canonical token sequence. (Gastaldi et al., 2024).
Unlike the encoding function, decoding is surjective, so multiple token sequences can map to the same character sequence. In addition to the canonical tokenization, , for example, each character sequence admits a character-based tokenization, where each symbol is treated independently. A paper by Veira et al. (2025) provides a nice illustration of various tokenizations of a single string.
Thus, following Gastaldi et al. (2024), we call the tokenization canonical, iff for a particular token sequence .
What's the object we are dealing with?
In general, language modelling is a task of learning a probability distribution over , a possibly infinitely long sequence of bytes[3]. Models are only exposed to the canonical token sequences during pretraining and SFT, and, statistically speaking, a theoretically optimal language model would assign zero probability to any non-canonical token sequence to preserve consistency with the underlying measure .
However, this isn't the case for real models due to non-negativity of the softmax function. Yet it seems reasonable to assume that any local sub-sequence of tokens that was never observed in the training dataset (and, unlike synonyms or any other semantic relations), should be assigned a negligibly low probability. After all, unlike synonyms, non-canonical sequences have no clear frequency co-occurrence patterns which could serve to infer the underlying meaning, as there's no shared context where such tokenizations could be found.
Here's the argument. There's a well known quote:
This is the basic principle initial static language models, like Word2Vec (Mikolov et al., 2013), more modern masked language models (Le Breton et al., 2025) and general masked autoencoders (He et al., 2021) are built around: some parts of the object get masked, and the model is trained to infer the correct ones from the present ones. If we retokenized just one word, or a small subset, we could argue that the model is performing such error-correction, internally estimating the correct "misspelled" parts.
Importantly, this is not the case. When the whole context gets re-tokenized[4], the model still appears to infer the meaning of the sentence, despite not having any in-distribution context it could rely on. Thus, it seems to operate on some level that, unlike semantics in its late Wittgensteinian view (1953), can not be inferred from frequency patterns alone.
Below, we give a compact overview of some key ideas and research questions as thesis statements. The claims may not make sense without reading the full post, and will be further developed in future writing-- worry not if you are lost!
Here are some key ideas to keep in mind while reading this post.
Here is an overview of our guiding research questions:
Now the heart of the post. There are two sections. The first surveys recent research, including a few of our own experiments, on tokenization symmetries from a fundamental alignment perspective. The second introduces a conceptual research agenda that we have been working on for a few weeks. We seek feedback and questions on the agenda.
1. Re-tokenization displays unexpected symmetries and evades alignment
1.1 LLMs learn partial symmetry over re-tokenizations
So LLMs are trained on canonical token sequences to predict canonical token sequences. What could go wrong? Yet something interesting happens. Despite never being exposed to non-canonical tokenizations, modern LLMs appear to be capable of both reading and writing non-canonical token sequences.[5]
Essentially, we can assume that models end up learning either the merge structure of the tokenizer to perform several tasks -- especially the ones that require handling arithmetic, bracket balance etc., or the underlying byte sequence distribution. Mechanistically, Yang et al. (2026) showed that some early layer attention heads can perform "word recovery" from character-level tokenizations, building residual stream representations similar to the one of the canonical token embedding. Yet the question of how these attention heads emerge, whether they are stable across re-tokenizations options, and why re-tokenizations can appear beneficial in certain domains, despite requiring additional computations, are left without answers. Psycho-linguistic experiments in token counting (Kaushal & Mahowald, 2022) and morphological and phonological feature inference (Hiraoka & Okazaki, 2024) seem to further support the hypothesis that models develop byte-level awareness.
The input string contains 30 characters, but only 29 of them contain the letter "i" and the last
one is the white-space. The model (incorrectly) responds with 30 and writes a string of 30 "i"-s.
Adapted from Trott (2024)
Task examples where improves with non-canonical tokenization of the prompt. Adapted from Zheng et al. (2026)
Similar experiments were previously performed by Lui Geh et al. (2025). As more tokens get sampled (unconditionally), the probability of generating non-canonical tokenization grows -- yet the growth laws differ between models. Notably, some non-canonical tokenizations were found to be more likely than their canonical counterparts. They provide the string
Canonicity in generated text. Percentage of canonicity drops as more tokens are generated.
Adapted from (Lui Geh et al., 2025)
Conditional generation seems to be more stable, yet still falls into non-canonicity from appx. 512 tokens
1.3 We should care about tokenization more
Although LLMs seem to be aware of their tokenization to some extent, their understanding is fragile and context-dependent. If they could indeed infer and encode the merge structure into their computational circuits[9], they wouldn't be dependent on the "distance" from the canonical tokenization. If LLMs encode the tokenizer's merge structure in some lossy way, understanding why and categorizing settings where they fail is relevant for the general study of what models know about their own properties and training.
LLM performance declines as the tokenization becomes more granular.
Adapted from Zheng et al., (2025)
Most importantly, Lui Geh et al. (2025) showed that re-tokenization can evade alignment without any changes to the prompt. Thus, by just re-tokenizing the prompt non-canonically, an attacker has an increased likelihood to bypass guardrails and alignment monitors. As most commonly used monitors are usually LLM-based as well, this attack vector could be effective at both levels, while being completely identical to regular text from the logger's perspective (assuming that the logger is unaware of the tokenization.)
Recent studies (Zheng et al., 2025; Lui Geh et al., 2025; Jain et al. (2026)) indicate that models do not have a systematic understanding of the merge structure or the underlying byte sequence distribution. Rather, the model has learned a partial symmetry over tokenizations of the same string with residual sensitivities that become more pronounced as the tokenization becomes more granular (see above figure). We are not aware whether residual sensitivity follows a similar pattern in frontier models.
In smaller models, the symmetry remains relatively underdeveloped and fragile. For example, Ismayilzada et al. (2025) evaluated several LLMs, from small models to GPT-4 and Gemini, for the ability to infer morphological compositional structures, and found performance to decrease sharply as morphological complexity increased. The extent of symmetry is not uniform across languages, either: Ghosh & Jyothi (2026) found that tokenization-invariance is mostly preserved for English, where most tokens have 1-to-1 lemma correspondence, while languages with higher token fragmentation show increased variance across re-tokenizations.
Although users cannot explicitly control the tokenization for closed-source LLMs, models expose themselves to non-canonical sequences during generation (Lui Geh et al., 2025). A model conditions on its own output. Non-canonical tokens it emits become context it must read, and reading non-canonical context is exactly what adversarial tokenization exploits. Therefore, non-canonical tokens could pose a problem during in-context learning (ICL) and cross-agent communication channels. If sampling non-canonical token sequences steers the model off-manifold (Wurgaft et al., 2026) of typical activations, it might eventually lead to dramatic changes in the residual stream while generating coherent and plausible text for CoT monitors.
2. Re-tokenization symmetry: research agenda
Here's the list of questions and problems we find the most interesting. We are open to adjusting our research direction based on the feedback we get from the community.
We think most problems in this domain arise from the incompleteness of deep learning theory, entangling frequency-induced biases, optimization dynamics, feature learning and semantic generalization. Although there have been increasing attempts to build a theory of data attribution (Zhu & Cangelosi, 2025), inner lexicon generalization (Kaplan et al., 2025), effects of softmax, token frequency and optimization on latent stuctures (Gao et al., 2019) and exploration-driven incentives in advanced agents (Simchowitz & Slivkins, 2023), given that we don't have a well-developed deep learning applicable theory in either domain, we don't suspect any general theory of tokenization to arise soon.
Due to the emergent nature of the phenomena above, most experiments required to connect this application to learning theory will either be too costly (e.g. pretraining with a different tokenizer which has several desirable properties) or confounded by effects we can't control for (e.g. adding tokens or doing tokenizer transfer, similar to Minixhofer et al. (2025) or Haltiuk & Smywinski-Pohi (2026)). Thus, we target our efforts towards defense mechanisms and obtaining sufficient empirical evidence of the tokenizer-related behavioral patterns found in modern LLMs.
2.1 Our initial focus: Prompt re-tokenization symmetry and reader invariance.
Do small changes to the tokenization ever have large effects?
While previous approaches have studied how model performance, as measured by various benchmarks, depends on the prompt tokenization's distance from the canonical[10], we are interested in fine-grained analysis of model behavior under single edits and sequences of edits to the context. Beyond performance evaluations, our upcoming posts will define behavioral metrics that attempt to capture the model's understanding of the context, instead of simply pass or fail.
Excluding the final bullet point, initial experiments have revealed partial answers to the questions above, and we expect to release an overview soon.
Do models necessarily learn invariances over tokenizations and which effects its reinforcement begets?
The counterpart to sensitivity is invariance, the symmetry that models learn over non-canonical tokenizations. We will deepen the study of reader invariance (does the model treat various tokenizations of the same text equivalently?) and raise new, unexplored questions of writer invariance (does the model assign significant probability to non-canonical token sequences?).
2.2 Tokenization curvature and in-context learning (ICL) equilibria states
Finding a clean variational structure with a known ground truth is rare in theoretical deep learning settings, and most examples of this kind reduce to toy models with fixed decision rules or data generation routines. Due to emergent partial symmetry (see section 1.2 above), re-tokenization appears to be a useful playground for understanding language models' responses to small contextual changes, as re-tokenization isolates semantic meaning from learned representations. The possibility of varying the context in a controlled way motivates a dynamical systems view of the context-continuation divide, where the dynamics are defined by sampling from a model but are probed using re-tokenization. Thus in-context learning can be understood using mathematical tools from discrete differential geometry. This is one of the most exciting directions. We have some initial results here and plan to release a follow-up post in the upcoming weeks.
2.3 Long context ICL, RL exploration efficiency and writer invariance
Jain et al. (2026) showed that conditioning on non-canonical tokens in the prompt promotes diverse reasoning. We are interested in a separate question: would a model with writer-invariance, i.e. one that fluently produces various tokenizations of the same text during generation, have greater capability for diverse reasoning?
Models firstly expose themselves to non-canonical token sequences and start learning on them in online RL / RLVR. Most commonly used RL algorithms are known to trigger entropy collapse and fall to exploitation, which may hinder exploration and exploitation of non-canonical token sequences for computations . The idea is analogous to the neuroscientific result that knowing multiple languages can improve cognitive capabilities in humans (Bialystok et al., 2012). To address this issue in deep learning, entropy-regularized RL approaches, such as GFlowNets (Y. Bengio et al., 2021) perform amortized MCMC-like inference, and sample from the distribution proportional to the reward function without collapsing to a narrow set of solutions. Although this approach hasn't found as much use in LLM training as e.g. GRPO (Shao et al., 2024), there has been a growing body of evidence towards the benefits of entropy-regularized approaches for latent reasoning and improving exploration (Takase et al., 2024; Younsi et al., 2025).
Another recent line of work investigates the role of initialization for on-policy RL. Warm-start off-policy learning and distillation (Shrestha et al., 2025) are known as biased, but sample-efficient alternatives to on-policy RL. Some reweighting-based approaches like dynamical fine-tuning (DFT) (Wu et al., 2025) and bounded log-likelihood (BLL) (Zhao et al., 2026) have modify SFT so that it introduces less variance and mitigates overfitting to the SFT data distribution.
Separately, several works have proposed to depart from enforcing canonicity and explored an effect of stochastic re-tokenizations (Sims et al., 2026, Steger et al., 2026) on pretraining, supervised finetuning and in-context learning, and found them to improve robustness to both random and stochastic perturbations. In addition, it allowed to obtain more isotropic and disentangled concept features.
StochasTok was found to improve similar feature clustering across contexts and beget robustness.
Adapted from Sims et al. (2026)
Essentially, stochastic tokenization imposes some degree of path invariance over the tokenization lattice, beyond increasing the entropy of the resulting distribution.
Let parametrize the joint distribution of byte sequences and their tokenizations , and let denote the number of distinct tokenizations obtainable from the tokenizer .
Then, if the distribution over tokenizations is uniform:
We can lower bound the entropy of the joint distribution as:
So the cross-entropy loss for each sample is lower-bounded by the logarithm of the number of plausible re-tokenizations, which becomes astronomically large for long contexts[11]. This should also significantly increase the entropy of the resulting unconditional distribution , parametrized by the model.
Although imposing a uniform distribution over tokenizations could be too strict, biasing it towards non-canonicity should increase the entropy and, supposedly, promote larger exploration rates during on-policy RL.
Several questions we find interesting on this topic:
2.4 Theoretical or compute-heavy questions
Given two models trained on the same data, with the same optimizer and batch sequence converge to different minima? Several studies have manipulated How different and tokenizer-dependent they are? How much inductive biases does the choice of tokens and merges in the tokenizer impose on the model and its alignment susceptibility?
Could we balance uniform token-splitting with PMI to obtain a pareto-optimal solution and an adaptive tokenizer size? Which implications on scaling laws, misalignment and efficiency will it have?
We wonder if such capabilities be "disabled" / pruned, and which other capabilities get lost as a side effect?
We will update this list as we make these problems more concrete and identify new open problems.
We develop this project as MARS V fellows, working under the supervision of Dmitry Vaintrob. Thanks to all the MARS team for making this happen and bringing us together.
In some cases, like BPE-dropout, the maps are allowed to be stochastic.
In this post we don't make a distinction between byte and character sequences, unless it's stated otherwise.
This makes it general enough to incorporate multimodal models of any kind, as their inputs are inevitable representable as sequences of bytes as well. This is what byte-latent transformers (BLT) (Pagnoni et al., 2024) seek to exploit. And fortunately, we can restrict it to all the sequences that end in the token to avoid the formalism defining the measure on infinite sequences.
And the number of such re-tokenizations scale exponentially with length.
Some models are exposed to non-canonical sequences during on-policy RL, but the phenomena we describe emerge already in pre-trained models and are not fundamentally modified during RL, modulo entropy statistics.
We will use the term "reader invariance" to refer to this behavioral pattern later.
However, besides re-tokenizations, similar effects can be produced by random context perturbations, and might be attributable to significantly increased entropy of the conditional distributions.
Which appears to align with the morphological structure of the word. Contrary to this, tokenization algorithms (at least the most widely used) are optimizing for compression, not for linguistic compositionality.
And the merge structure is relatively small in comparison to the number of tokens in pretraining data - for example, Qwen3.8-2.4T-A95B (Qwen Team, 2026) tokenizer has 248,320 tokens, while being pretrained on trillions of tokens
Distance between two tokenizations is defined by the minimum number of legal edits (splits and merges that respect the vocabulary) that transform one segmentation into the other; see (Levenshtein, 1966; Zheng et al., 2025; Geh et al., 2025).
Note, that this distribution is a direct generalization of the commonly written distribution and it still factorizes over tokens autoregressively. For a common theoretical model that only assumes canonical tokenizations to be learned, the conditional probability for the canonical , and is otherwise.