AIFEATURE

How Do Large Language Models Turn Text Into Tokens? Subword Tokenization and Byte-Level BPE Explained

N
NathanTechnology Editor · Technical Lead
Published · Updated
Large language models process text as tokens, not raw characters or words. Subword methods, especially byte-level BPE, merge frequent adjacent units from a 256-value base vocabulary to keep the token list compact while still handling rare words. On Gemini models, one token equals about 4 characters, and 100 tokens correspond to roughly 60-80 English words.

What Is a Token, and Why Do Large Language Models Need to Split Text Into Them?

A token is the basic unit of language that a machine can process, usually a word or part of a wordCITE:E1. IBM describes tokenization in natural language processing as breaking text into these individual units so that a model has a fixed, learnable vocabulary to work with rather than raw, unbounded strings of charactersCITE:E1.

How Does Subword Tokenization Balance Vocabulary Size Against Unknown Words?

Subword tokenization splits text into units that sit between full words and single charactersCITE:E2. According to Hugging Face's documentation, this keeps the vocabulary compact while still capturing meaningful pieces of textCITE:E2. In practice, common words stay intact as single tokens, while rare or unknown words are decomposed into subwordsCITE:E3 — this is the mechanism that lets a tokenizer with a limited vocabulary still represent words it has never seen as a whole unit.

How Does the BPE (Byte Pair Encoding) Algorithm Work?

BPE builds its vocabulary bottom-up by repeatedly merging the most frequent adjacent pair of unitsCITE:E4. Hugging Face explains that the algorithm starts with individual characters and iteratively merges whichever adjacent pair occurs most often, building longer subword units step by stepCITE:E4. A byte-level variant of this process changes the starting point: instead of beginning from characters, byte-level BPE uses 256 byte values as its base vocabularyCITE:E5.

What Is the Practical Ratio Between Tokens and Text Length?

For Google's Gemini models, one token is equivalent to about 4 charactersCITE:E6, and 100 tokens correspond to roughly 60-80 English wordsCITE:E7. These reference points, published by Google, give a concrete way to estimate token counts from a body of English text without running a tokenizer.

MetricValueSource
Byte-level BPE base vocabulary256 byte valuesHugging FaceCITE:E5
Gemini token-to-character ratio1 token ≈ 4 charactersGoogleCITE:E6
Gemini token-to-word ratio100 tokens ≈ 60-80 English wordsGoogleCITE:E7

What Does This Mean?

The token-based unit that IBM defines as the basic building block of NLP processingCITE:E1 is what subword methods are built to optimize: Hugging Face's description of keeping the vocabulary compact while capturing meaningful piecesCITE:E2, and letting common words stay whole while rare words decomposeCITE:E3, is a direct description of the tradeoff BPE's merge process is designed to solveCITE:E4. The byte-level variant's move to a 256-value base vocabularyCITE:E5 is a specific implementation of that same tradeoff at the byte level. The Gemini ratios — about 4 characters per token, and 60-80 words per 100 tokensCITE:E6CITE:E7 — are the measurable, downstream result of a tokenizer built on these subword and byte-level principles.

📊 Evidence

FAQ

What Is a Token, and Why Do Large Language Models Need to Split Text Into Them?

A token is the basic unit of language that a machine can process, usually a word or part of a wordCITE:E1.

How Does Subword Tokenization Balance Vocabulary Size Against Unknown Words?

Subword tokenization splits text into units that sit between full words and single charactersCITE:E2.

How Does the BPE (Byte Pair Encoding) Algorithm Work?

BPE builds its vocabulary bottom-up by repeatedly merging the most frequent adjacent pair of unitsCITE:E4.

What Is the Practical Ratio Between Tokens and Text Length?

For Google's Gemini models, one token is equivalent to about 4 charactersCITE:E6, and 100 tokens correspond to roughly 60-80 English wordsCITE:E7.

📎 Sources

  1. ibm.com
  2. huggingface.co
  3. ai.google.dev

Related data

Author's TakeNathan

The technical detail worth isolating here is the base vocabulary itself: byte-level BPE starts merging from a fixed set of 256 byte values rather than an open-ended character set, and that choice is what lets the merge process build a compact vocabulary while still letting rare words fall back to subwords instead of an unrecognized unit. That is a structural reason, not a coincidence, why common words stay as single tokens and rare ones decompose — the vocabulary is built to make that split hold. The Gemini figures — about 4 characters per token and 60-80 words per 100 tokens — are the observable output of that structure, not independent facts. The metric to watch going forward is whether that token-to-character ratio stays stable as text moves further from typical English word and character patterns, since the ratio is a product of the base vocabulary and merge rules, not a fixed constant.

N
NathanTechnology Editor · Technical Lead

Related

BRIEF

GreenTrans Unveils GT5X, GT3X Quadruped Robots, Targets 100% Taiwan-Made Content by 2027

GreenTrans (綠捷), the robotics subsidiary of China Motor (中華車), unveiled quadruped robots GT5X and GT3X at SEMICON Taiwan 2026, targeting 100% Taiwan-made content by 2027. The robots combine an in-house-designed control unit and battery management system, NVIDIA's Jetson Orin and Isaac Lab platforms, and a new LFP battery developed with Formosa Smart Energy (台塑新智能), while GreenTrans's inspection robots are already deployed in semiconductor fabs.

EffectStory 編輯部 ·
BRIEF

Nvidia Confirms $12.93 Billion Acquisition of Hugging Face

Nvidia confirmed on September 3, 2026 that it agreed to buy Hugging Face for $12.93 billion, exactly $12,930,300,000, gaining the open-source AI hosting platform used by over 18 million developers. CEO Jensen Huang pledged the platform will stay open, with no Nvidia compute required to build on or deploy through it.

EffectStory 編輯部 ·
BRIEF

NVIDIA to Subscribe US$3.5 Billion of MediaTek's Record US$3.9 Billion Convertible Bond

NVIDIA will subscribe US$3.5 billion of MediaTek's US$3.9 billion offshore convertible bond offering, the largest such issuance in Taiwan's capital market history, deepening cooperation in AI infrastructure, edge AI computing, and automotive platforms while marking NVIDIA's first major investment in a Taiwanese company.

EffectStory 編輯部 ·