Lune

NeurIPS2024Top-tier venue

An Analysis of Tokenization: Transformers under Markov Data

Nived Rajaraman, Jiantao Jiao, Kannan Ramchandran

Abstract

While there has been a large body of research attempting to circumvent tokenization for language modeling (Clark et al., 2022; Xue et al., 2022) , the current consensus is that it is a necessary initial step for designing state-of-the-art performant language models. In this paper, we investigate tokenization from a theoretical point of view by studying the behavior of transformers on simple data generating processes. When trained on data drawn from certain simple k th -order Markov processes for k > 1, transformers exhibit a surprising phenomenon -in the absence of tokenization, they empirically are incredibly slow or fail to learn the right distribution and predict characters according to a unigram model (Makkuva et al., 2024) . With the addition of tokenization, however, we empirically observe that transformers break through this barrier and are able to model the probabilities of sequences drawn from the source near-optimally, achieving small cross-entropy loss. With this observation as starting point, we study the end-to-end cross-entropy loss achieved by transformers with and without tokenization. With the appropriate tokenization, we show that even the simplest unigram models (over tokens) learnt by transformers are able to model the probability of sequences drawn from k thorder Markov sources near optimally. Our analysis provides a justification for the use of tokenization in practice through studying the behavior of transformers on Markovian data.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Exploiting Vocabulary Frequency Imbalance in Language Model Pre-training cites Causal Estimation of Tokenisation Bias
  • Exploiting Vocabulary Frequency Imbalance in Language Model Pre-training cites Language Models are Few-Shot Learners
  • Pre-trained Large Language Models Learn to Predict Hidden Markov Models In-context cites Language Models are Few-Shot Learners
  • How Transformers Learn Causal Structure with Gradient Descent cites Language Models are Few-Shot Learners
  • From Bytes to Ideas: Language Modeling with Autoregressive U-Nets cites Language Models are Few-Shot Learners
  • From Bytes to Ideas: Language Modeling with Autoregressive U-Nets cites Dynamic Chunking for End-to-End Hierarchical Sequence Modeling
  • Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites From Bytes to Ideas: Language Modeling with Autoregressive U-Nets
  • Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. Dynamic Chunking for End-to-End Hierarchical Sequence ModelingSukjun Hwang, Brandon Wang, Albert GuICLR 2026 · 76 citations
  2. From Bytes to Ideas: Language Modeling with Autoregressive U-NetsMathurin Videau, Badr Youbi Idrissi, Alessandro Ferreira Leite, Marc Schoenauer et al.NeurIPS 2025 · 14 citations
  3. Exploiting Vocabulary Frequency Imbalance in Language Model Pre-trainingWoojin Chung, Jeonghoon KimNeurIPS 2025 · 6 citations
  4. Pre-trained Large Language Models Learn to Predict Hidden Markov Models In-contextYijia Dai, Zhaolin Gao, Yahya Sattar, Sarah Dean et al.NeurIPS 2025 · 2 citations
  5. Causal Estimation of Tokenisation BiasPietro Lesci, Clara Meister, Thomas Hofmann, Andreas Vlachos et al.ACL 2025

Builds on8

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. How Transformers Learn Causal Structure with Gradient DescentEshaan Nichani, Alex Damian, Jason D. LeeICML 2024 · 117 citations
  3. Rare Tokens Degenerate All Tokens: Improving Neural Text Generation via Adaptive Gradient Gating for Rare Token EmbeddingsSangwon Yu, Jongyoon Song, Heeseung Kim, Seongmin Lee et al.ACL 2022 · 42 citations
  4. Outline, Then Details: Syntactically Guided Coarse-To-Fine Code GenerationWenqing Zheng, S. P. Sharan, Ajay Kumar Jaiswal, Kevin Wang et al.ICML 2023 · 35 citations
  5. A Formal Perspective on Byte-Pair EncodingVilém Zouhar, Clara Meister, Juan Luis Gastaldi, Li Du et al.ACL Findings 2023 · 28 citations

Related papers

  1. Transformers on Markov data: Constant depth sufficesNived Rajaraman, Marco Bondaschi, Ashok Vardhan Makkuva, Kannan Ramchandran et al.NeurIPS 2024 · 33 citations
  2. Attention with Markov: A Curious Case of Single-layer TransformersAshok Vardhan Makkuva, Marco Bondaschi, Adway Girish, Alliot Nagle et al.ICLR 2025
  3. Local to Global: Learning Dynamics and Effect of Initialization for TransformersAshok Vardhan Makkuva, Marco Bondaschi, Adway Girish, Alliot Nagle et al.NeurIPS 2024 · 16 citations
  4. Over-Tokenized Transformer: Vocabulary is Generally Worth ScalingHongzhi Huang, Defa Zhu, Banggu Wu, Yutao Zeng et al.ICML 2025
  5. The Foundations of Tokenization: Statistical and Computational ConcernsJuan Luis Gastaldi, John Terilla, Luca Malagutti, Brian DuSell et al.ICLR 2025 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines