atlas

Research map / Architectures and efficiency / Attention and transformers

An Analysis of Tokenization: Transformers under Markov Data

NeurIPS 2024 · Architectures and efficiency › Attention and transformers · approach: Transformer expressivity and learnability · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Studies why transformers fail to learn kth-order Markov sources without tokenization (collapsing to unigram) but succeed with tokenization, and proves LZW and a sequential BPE variant yield tokenizers whose best unigram model is near-optimal in cross-entropy.

Problem

Transformers trained on kth-order Markov character sequences without tokenization learn only unigram-like predictions and have high cross-entropy; the paper asks why tokenization helps and how tokenizer choice affects end-to-end loss.

Approach

Frames tokenization as a statistical problem: end-to-end cross-entropy of a unigram model over tokens. Shows a toy fixed-length tokenizer needs exponential dictionary size, while LZW and a sequential BPE variant achieve near-optimal unigram loss with polynomial dictionaries, via a heavy-hitter dictionary argument.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
use Phi-2 BPE unigram instead of ByT5 character bigramunigram likelihood modeling · Rotten Tomatoes (RT)cross-entropy loss: 2.40 vs 1.54Helped
use BERT Wordpiece unigram instead of ByT5 character bigramunigram likelihood modeling · Wikitext-103-v1 (Wiki)cross-entropy loss: 2.45 vs 1.55Helped
use BERT Wordpiece unigram instead of ByT5 character bigramunigram likelihood modeling · Yelp reviewcross-entropy loss: 2.46 vs 1.60Helped
use Phi-2 BPE unigram instead of ByT5 character bigramunigram likelihood modeling · GLUEcross-entropy loss: 2.38 vs 1.45Helped
add BPE tokenization (ablation)transformer on order-1 switching Markov chain · order-1 switching Markov chaintraining time to target test lossHelped
add BPE tokenization (ablation)transformer on order-1 switching Markov chain with the same architecture · order-1 switching Markov chainlimiting test lossHurt
add BPE tokenization (ablation)transformer on order-2 switching Markov process · order-2 switching Markov processtest cross-entropy lossHelped

Surprising findings

Limitations

Experimental setup

Datasets: Wikitext-103-raw-v1 GLUE Rotten Tomatoes Yelp review Wikitext-103-v1

Benchmarks: Rotten Tomatoes Wikitext Yelp review GLUE

Metrics: cross-entropy loss test loss vs. training time cross-entropy vs. dictionary size

Baselines: character-level tokenizer Unigram tokenizer Wordpiece BPE

Builds on: Makkuva et al. 2024 Edelman et al. 2024 LZW (Zouhar et al. 2023) BPE (Sennrich et al. 2016)

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy