Jump to content

Tokenisation (machine learning)

From Wikibase
Revision as of 19:11, 10 November 2026 by Rongzhou (talk | contribs) (→Vocabulary size)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Languages: English · français · Esperanto

Tokenisation is the process of segmenting raw data into tokens.[1]

Definition

Formally, let $\mathcal{S}$ be a sequence of data. Any function

$$ \tau: \mathcal{S} \to \mathcal{V}^{*} $$

is a tokenisation function, sometimes called a tokeniser.

where $|\mathcal{V}| \ll \infty$ is known as the token vocabulary.

Vocabulary size

The vocabulary size $|\mathcal{V}|$ is a key design choice in tokenisation functions, controlling the trade-off between expressiveness and computational cost.

Typical vocabulary size is $10^4 \to 10^5$.