Skip to content
Query Feedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  • News
  • Business
    • Digital Marketing
      • Marketing & Sales
      • SEO
      • Content Marketing
      • AEO and GEO
    • Startups
      • Founder Stories
      • Funding & VC
      • Product & Growth
    • Money
      • Investing
      • Markets & Economy
      • Saving & Budgeting
  • AI & Technology
    • Technology
      • Consumer Tech
      • CRM
      • Cyber Security
      • Software Engineering
      • WordPress
      • Hardware
    • Artificial IntelligenceAI Glossary
      • LLMs
      • Machine Learning
      • AI Fundamentals
      • Generative AI
      • Deep Learning
    • AI Use Cases
      • Automation
      • Content
      • Customer Support
      • Finance
      • Marketing
      • View All
  • Tools & Software
  • Account
    • Submit Guest Post
    • Submit a tool
    • My listing
  • Contact
QueryFeedz
  1. Home /
  2. AI Glossaries /
  3. LLMs /
  4. What is Tokenization?
LLMs

What is Tokenization?

Updated September 21, 2026 Read 3 min

Tokenization is the process of splitting text into tokens, the small units a language model can process, and mapping each to a number. Most modern LLMs use subword tokenizers such as byte-pair encoding (BPE).

Contents 12
  1. 01Key takeaways
  2. 02Tokenization explained in simple terms
  3. 03Why subword tokenization?
  4. 04How byte-pair encoding (BPE) works
  5. 05Common tokenization methods
  6. 06Vocabulary size trade-offs
  7. 07Tokenization and languages
  8. 08Quirks caused by tokenization
  9. 09Tokenization in practice
  10. 10Common Use Cases
  11. 11Frequently Asked Questions
  12. 12Related Terms

Tokenization is the process of splitting text into small units called tokens and converting each one into a numeric ID that a language model can process. It is the first step whenever an LLM reads text, and the last step in reverse when it writes. Most modern LLMs use subword tokenization, which breaks rare words into smaller pieces while keeping common words whole.

Key takeaways

  • Tokenization turns text into a list of numbers from a fixed vocabulary.
  • Subword methods such as byte-pair encoding (BPE), WordPiece and Unigram dominate.
  • Vocabulary sizes typically range from tens of thousands to a few hundred thousand tokens.
  • The tokenizer is trained before the model and is fixed afterwards.
  • Tokenizer design affects cost, multilingual performance and some odd model behaviours.

Tokenization explained in simple terms

A model cannot read letters or words directly; it only works with numbers. Tokenization is like a dictionary lookup that turns text into page numbers. The dictionary contains whole common words and useful fragments. Any word, even a brand-new one, can be spelled out using fragments, so the model never meets a word it cannot represent.

Why subword tokenization?

ApproachProblem
Word-levelHuge vocabulary; cannot handle new or misspelled words
Character-levelSequences become very long, making models slower and less effective
Subword-levelBalances both: common words stay whole, rare words split into known pieces

How byte-pair encoding (BPE) works

BPE started as a data compression method and was adapted for language models in 2016 by Rico Sennrich and colleagues. To build a BPE vocabulary:

  1. Start with individual characters (or bytes) as the vocabulary.
  2. Count every adjacent pair of symbols in a large training text.
  3. Merge the most frequent pair into a new single symbol and add it to the vocabulary.
  4. Repeat thousands of times until the vocabulary reaches the target size.

Worked example: in a text where “low”, “lower” and “lowest” are common, the pair “l” + “o” is merged into “lo”, then “lo” + “w” into “low”. Later, “est” might become a token. Now “lowest” can be written as “low” + “est”, and a new word like “slowest” as “s” + “low” + “est”. Byte-level BPE, used by GPT-2 and many later models, starts from raw bytes, so it can represent any text, emoji or script.

Common tokenization methods

MethodHow it worksUsed in
Byte-pair encoding (BPE)Merges frequent symbol pairsGPT family and many modern LLMs
WordPieceMerges pairs based on likelihoodBERT
UnigramStarts large and prunes the least useful piecesMany multilingual models
SentencePieceLibrary that treats text as raw characters including spaces; supports BPE and UnigramT5, many Llama-era models

Vocabulary size trade-offs

A larger vocabulary means more words and scripts are represented as single tokens, so text uses fewer tokens and costs less. But it also makes the model’s embedding and output layers larger. Newer models have generally moved to larger vocabularies to improve multilingual and code efficiency.

Tokenization and languages

Tokenizers trained mostly on English split other languages into more pieces. The same sentence in Hindi, Marathi or Tamil can take noticeably more tokens than in English, which increases cost, uses more of the context window and can reduce quality. Multilingual models address this with more balanced training data and larger vocabularies.

Quirks caused by tokenization

  • Spelling and counting letters: the model sees “straw” + “berry”, not individual letters, so letter-counting questions can fail.
  • Arithmetic: numbers split in inconsistent chunks can make maths harder.
  • Leading spaces: “hello” and ” hello” may be different tokens.
  • Rare names and code: unusual strings split into many tokens.

Tokenization in practice

  • Use the correct tokenizer for each model; they are not interchangeable.
  • Count tokens before sending large documents.
  • When chunking documents for retrieval, split by token count, not character count.
  • Libraries such as Hugging Face Tokenizers and OpenAI’s tiktoken make this easy.

Common Use Cases

01

Preparing model input

Convert user text into token IDs for every LLM request.

02

Cost and limit planning

Count tokens to estimate API cost and check context limits.

03

Document chunking

Split long documents into token-sized pieces for retrieval systems.

04

Multilingual model design

Build tokenizers that represent Indian and other languages efficiently.

05

Training custom models

Train a tokenizer on domain text before training or adapting a model.

06

Debugging model behaviour

Inspect token splits to explain odd outputs on names, numbers or code.

Frequently Asked Questions

The process of splitting text into tokens and converting them to numeric IDs that a language model can process.

A subword tokenization method that repeatedly merges the most frequent pairs of symbols to build a vocabulary.

Subwords keep common words whole while allowing any rare or new word to be built from smaller known pieces.

No. Each model family has its own tokenizer and vocabulary, so token counts differ.

They see tokens, which are chunks of letters, rather than individual characters.

Related Terms

  • Token
  • Byte-Pair Encoding
  • Large Language Model
  • Embedding
  • Context Window
  • Vocabulary

Related AI Terms

What is Self-Attention?Self-attention is a mechanism where each position in a sequence attends to every other position in the same…What is Positional Encoding?Positional encoding is the method transformers use to represent the order of tokens in a sequence, because the…What is an Attention Head?An attention head is a single attention unit inside a transformer layer, with its own query, key and…What is Multi-Head Attention?Multi-head attention runs several attention operations in parallel, each with its own learned projections, so a model can…What is Prefix Tuning?Prefix tuning is a parameter-efficient fine-tuning method that learns trainable vectors inserted into the attention keys and values…What is RoPE (Rotary Positional Embedding)?RoPE (rotary positional embedding) encodes a token's position by rotating its query and key vectors by an angle…

Contents

  1. 01Key takeaways
  2. 02Tokenization explained in simple terms
  3. 03Why subword tokenization?
  4. 04How byte-pair encoding (BPE) works
  5. 05Common tokenization methods
  6. 06Vocabulary size trade-offs
  7. 07Tokenization and languages
  8. 08Quirks caused by tokenization
  9. 09Tokenization in practice
  10. 10Common Use Cases
  11. 11Frequently Asked Questions
  12. 12Related Terms

AI Topic

  • LLMs

Related Terms

  • What is Self-Attention?
  • What is Positional Encoding?
  • What is an Attention Head?
  • What is Multi-Head Attention?
  • What is Prefix Tuning?
  • What is RoPE (Rotary Positional Embedding)?

Quick Navigation

  • Common Use Cases
  • Frequently Asked Questions
  • Related Terms
  • Back to top

Details

Updated
September 21, 2026
Read
3 min
  • Forum
  • Submit a tool
  • Submit Guest Post
  • List Your Startup
  • Privacy Policy
  • Editorial Policy
  • Account
  • Contact
  • AI Productivity
  • AI Video
  • AI Coding
  • AI Chatbots
  • Sales
  • AI Business
  • View All Tools

Subscribe our Newsletter

Get weekly exclusive content - No spam.

Copyright © 2026 -  Query Feedz

Manage Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
View preferences
  • {title}
  • {title}
  • {title}