GyaanamKnowledge for All
Back to Science & TechnologyAll concepts

Tokenisation in Language Models

SyllabusAwareness in IT and computers: AI, data and digital technologies

Science & TechnologyPublished 23 November 2026

Tokenisation breaks text into smaller units, called tokens, that a language model can process. A token may represent a word, part of a word, a punctuation mark, or another text unit, depending on the tokeniser. Each token is assigned a numerical identifier, allowing text to be represented as a sequence of numbers.

From text to numerical input

A tokeniser applies a defined procedure to segment text and match the resulting units to entries in its vocabulary, which is the set of tokens it recognises.

  • For example, a word-level tokeniser might split “India learns.” into “India”, “learns” and “.”; a subword tokeniser could split the words further.
  • Each vocabulary entry has a token ID. Encoding replaces tokens with their corresponding IDs while preserving their order.
  • An embedding layer then maps these IDs to numerical vectors used by the model. Token IDs are labels, not measures of meaning or numerical similarity.
  • During text generation, the model predicts token IDs, and decoding converts the resulting token sequence back into text.

Common ways of forming tokens

Tokenisation methods balance vocabulary size, sequence length and the ability to represent unfamiliar text.

  • Word-level tokenisation treats words as units, but it can require a large vocabulary and encounter words absent from that vocabulary.
  • Character-level tokenisation uses individual characters, reducing reliance on a word vocabulary but generally producing longer sequences.
  • Subword tokenisation represents text using reusable word pieces. Frequent words may remain whole, while less frequent words can be divided into smaller units.
  • Byte-pair encoding, a common subword approach, builds a vocabulary by repeatedly merging frequent adjacent units in training text.

Why tokeniser design matters

Tokenisation determines how efficiently a model represents its input; it does not itself provide language understanding.

  • A model's context window is measured in tokens, not words, so a fixed token allowance can accommodate different amounts of text.
  • Languages differ in scripts, word formation and use of spaces. Consequently, splitting text only at spaces is not a universally suitable method.
  • A tokeniser whose vocabulary poorly represents a language may divide its words into many pieces, increasing sequence length and reducing the text that fits within the context window.
  • For multilingual models, representative training text helps build a vocabulary suited to the languages being served, although tokenisation alone cannot ensure model quality.

Keep reading

The news behind topics like this, explained every day

Every day Gyaanam reads The Hindu, the Indian Express and PIB and picks what matters for UPSC. Each story is written up against the syllabus line it belongs to. Your first 7 days or 3 articles are free, whichever ends first.

Sign up