---
title: "Token (LLM)"
source: "https://systems-analysis.info/eng/Token_(LLM)"
wiki: "systems-analysis.info/eng"
article: "Token_(LLM)"
language: "en"
categories:
  - "Category:English"
  - "Category:Large language models"
  - "Category:LLM core concepts"
  - "Category:Machine learning"
  - "Category:Technology"
revision_id: 416
wiki_created_at: 2026-09-06T22:23:15Z
wiki_modified_at: 2026-09-06T22:23:15Z
downloaded_at: 2026-09-07T22:23:16Z
---

# Token (LLM)

**Token** — the smallest unit of text that [large language models](https://systems-analysis.info/eng/Large_language_model "Large language model") (LLMs) can work with. Before being processed by an LLM, any text is first converted into a sequence of tokens, which are then translated into numerical representations that are convenient for the model to analyze and process.

Depending on the [tokenization](https://systems-analysis.info/eng/Tokenization_(NLP) "Tokenization (NLP)") strategy used, a token can represent:

- A whole word (e.g., "house")
- A part of a word or a root (a subword), such as "run" in "running"
- A single character or punctuation mark (e.g., ",", "!")

The use of tokens allows language models to effectively learn and reproduce text structures, identify patterns, and understand the semantics and syntax of the text.

## Tokenization

**Tokenization** is the process of breaking down source text into tokens and subsequently converting them into numerical identifiers that the model can understand.

This stage is a mandatory and fundamental step for how large language models function. It enables an LLM to:

- Analyze syntax — the structure of the text and the arrangement of its elements (words and phrases);
- Extract semantics — the deeper meaning of the text and the relationships between its elements.

There are several main methods of tokenization, including:

- **Byte Pair Encoding (BPE)**: An algorithm that iteratively replaces the most frequent pairs of characters with new tokens, allowing for efficient processing of rare words and morphological variations.
- **WordPiece**: Used in models like [BERT](https://systems-analysis.info/eng/BERT_(language_model) "BERT (language model)"), it breaks words into subword units, which helps in processing unknown words.
- **SentencePiece**: A method that treats text as a sequence of raw characters and applies models based on BPE or Unigram for tokenization.

The choice of tokenization method affects the model's performance, its ability to process different languages, and the efficiency of its training.

## Special Tokens

In addition to regular tokens, models also use special tokens to denote functional elements of the text, such as:

- `[CLS]` (class) — a token indicating the start of a sequence, often used for text classification tasks;
- `[SEP]` (separator) — separates different parts of the text (e.g., a question and an answer, sentences, or paragraphs);
- `[MASK]` — a special token used to denote a word that the model must predict (used in BERT and other masked-language models);
- `[PAD]` (padding) — used to align sequences to a uniform length.

These special tokens help models more accurately perceive the structure and context of the text being processed.

## Tokens and the Context Window

The **[context window](https://systems-analysis.info/eng/Context_window "Context window")** is the maximum number of tokens that a model can simultaneously consider and process when generating text.

For example, the [GPT](https://systems-analysis.info/eng/GPT_(OpenAI) "GPT (OpenAI)")-3 model has a context window of 2048 tokens. This means that when generating text, the model can simultaneously consider information contained within a maximum of 2048 tokens of the source text. The size of the context window affects:

- The maximum amount of information available to the model;
- The quality and coherence of the generated responses;
- The model's ability to comprehend long texts and maintain context over long distances between tokens.

## External links

- <a href="https://en.wikipedia.org/wiki/Large_language_model#Tokenization" class="external text" rel="nofollow">Tokenization — Wikipedia</a>

## See also

- [Stop sequences (language models)](https://systems-analysis.info/eng/Stop_sequences_(language_models) "Stop sequences (language models)")

## Bibliography

- Sennrich, R.; Haddow, B.; Birch, A. (2016). *Neural Machine Translation of Rare Words with Subword Units*. <a href="https://arxiv.org/abs/1508.07909" class="external text" rel="nofollow">arXiv:1508.07909</a>.
- Kudo, T.; Richardson, J. (2018). *SentencePiece: A Simple and Language-Independent Subword Tokenizer and Detokenizer for Neural Text Processing*. <a href="https://arxiv.org/abs/1808.06226" class="external text" rel="nofollow">arXiv:1808.06226</a>.
- Kudo, T. (2018). *Subword Regularization: Improving Neural Network Translation Models with Multiple Subword Candidates*. <a href="https://arxiv.org/abs/1804.10959" class="external text" rel="nofollow">arXiv:1804.10959</a>.
- Devlin, J. et al. (2019). *BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding*. <a href="https://arxiv.org/abs/1810.04805" class="external text" rel="nofollow">arXiv:1810.04805</a>.
- Song, X. et al. (2021). *Fast WordPiece Tokenization*. \*EMNLP 2021\*. <a href="https://aclanthology.org/2021.emnlp-main.160.pdf" class="external text" rel="nofollow">ACL Anthology</a>.
- Mielke, S. J.; Dalmia, S.; Cotterell, R. (2021). *A Brief History of Open-Vocabulary Modeling and Tokenization in NLP*. <a href="https://arxiv.org/abs/2112.10508" class="external text" rel="nofollow">arXiv:2112.10508</a>.
- Xue, J. et al. (2022). *ByT5: Towards a Token-Free Future with Pre-trained Byte-to-Byte Models*. <a href="https://arxiv.org/abs/2105.13626" class="external text" rel="nofollow">arXiv:2105.13626</a>.
- Limisiewicz, T.; Balhar, J.; Mareček, D. (2023). *Tokenization Impacts Multilingual Language Modeling: Assessing Vocabulary Allocation and Overlap Across Languages*. <a href="https://arxiv.org/abs/2305.17179" class="external text" rel="nofollow">arXiv:2305.17179</a>.
- Pourmostafa Roshan Sharami, J.; Shterionov, D.; Spronck, P. (2023). *A Systematic Analysis of Vocabulary and BPE Settings for Optimal Fine-tuning of NMT*. <a href="https://arxiv.org/abs/2303.00722" class="external text" rel="nofollow">arXiv:2303.00722</a>.
- Batsuren, K. et al. (2024). *Evaluating Subword Tokenization: Alien Subword Composition and OOV Generalization Challenge*. <a href="https://arxiv.org/abs/2404.13292" class="external text" rel="nofollow">arXiv:2404.13292</a>.
- Chai, Y. et al. (2024). *Tokenization Falling Short: On Subword Robustness in Large Language Models*. <a href="https://arxiv.org/abs/2406.11687" class="external text" rel="nofollow">arXiv:2406.11687</a>.
