Stochasticity in Tokenization Improves Robustness
Summary
This paper demonstrates that training large language models with stochastic tokenization instead of deterministic canonical tokenization significantly improves robustness to adversarial attacks and random perturbations, with improvements shown across pre-training, fine-tuning, and in-context learning without increasing inference costs.
View Cached Full Text
Cached at: 04/20/26, 08:29 AM
# Stochasticity in Tokenisation Improves Robustness Source: https://arxiv.org/abs/2604.16037 View PDF (https://arxiv.org/pdf/2604.16037) > Abstract: The widespread adoption of large language models (LLMs) has increased concerns about their robustness. Vulnerabilities in perturbations of tokenisation of the input indicate that models trained with a deterministic canonical tokenisation can be brittle to adversarial attacks. Recent studies suggest that stochastic tokenisation can deliver internal representations that are less sensitive to perturbations. In this paper, we analyse how stochastic tokenisations affect robustness to adversarial attacks and random perturbations. We systematically study this over a range of learning regimes (pre-training, supervised fine-tuning, and in-context learning), datasets, and model architectures. We show that pre-training and fine-tuning with uniformly sampled stochastic tokenisations improve robustness to random and adversarial perturbations. Evaluating on uniformly sampled non-canonical tokenisations reduces the accuracy of a canonically trained Llama-1b model by 29.8%. We find that training with stochastic tokenisation preserves accuracy without increasing inference cost. ## Submission history From: Sophie Steger [view email (https://arxiv.org/show-email/c01e50c3/2604.16037)] **[v1]** Fri, 17 Apr 2026 13:05:46 UTC (88 KB)
Similar Articles
Language Models are not Equally Robust to Non-Canonical Tokenization across Languages
This paper investigates whether language models remain robust to alternative (non-canonical) tokenizations across 27 languages, finding that invariance observed in English does not generalize and that languages with higher token fragmentation show greater sensitivity. The authors demonstrate that LoRA fine-tuning with multi-tokenization data can mitigate this sensitivity.
When Is Noise Response Universal? Tokenization as the Hidden Variable in Language Models
The study finds that neural language models degrade similarly under word-level noise but differently under character-level noise, with tokenization identified as the key hidden variable. It provides a method to predict model robustness without noisy evaluation and suggests noise-augmented training for install robustness.
How Perturbations Propagate: A Multi-Level Analysis of Robustness in Large Language Models
This paper conducts a multi-level analysis of how input perturbations propagate through decoder-only language models, assessing robustness via output behavior, hidden-state geometry, and attention-head function across models like GPT-2 and Qwen2.5.
Probabilistic Attribution For Large Language Models
This paper proposes a model-agnostic probabilistic token attribution measure for LLMs using Bayes' rule to invert next-token log probabilities, capturing the model's internal representation of token sequences and improving interpretability through entropy analysis.
Demystifying Training-Time Augmentation for Data-Constrained Language Model Pretraining
This paper investigates training-time data augmentation techniques to mitigate overfitting in autoregressive language model pretraining under data-constrained, compute-abundant regimes, finding that combining token-level noise, sequence permutations, and target offset prediction improves validation loss.