Language models are trained under a deterministic canonical tokenization, yet every byte string admits exponentially many non-canonical token sequences that decode to it. Although such sequences never occur during training, models exhibit partial invariance to them, and in some settings, such as character-level word games, non-canonical inputs even improve accuracy. This invariance is nevertheless fragile: byte-identical prompts can induce divergent behavior, and adversarial tokenizations were found to circumvent safety alignment. We give a mechanistic account of this fragility and introduce a family of consistency-training objectives that enforce agreement across retokenizations of the prompt while keeping the output space canonically tokenized. We prove that retokenizing only the prompt leaves the training optimum unchanged, whereas retokenizing the target raises the irreducible entropy of the target distribution. Across three model families, consistency-tuned models are more robust to adversarial tokenization, at some loss of benchmark accuracy, while transfer to other attacks depends on the objective. Probing shows that the attack suppresses the linearly decodable refusal signal in the residual stream, and that after consistency training the signal persists under attack in its original subspace.
翻译:暂无翻译