Jump to content

Token embedding (machine learning)

From Wikibase
Revision as of 20:28, 10 November 2026 by Rongzhou (talk | contribs)

Languages: English · français · Esperanto

A visual representation of embedding of sub-word tokens in natural language processing (NLP). · Open in a new tab

Let $t_i \in T$ be tokens obtained from tokenisation of raw data.

Let $\mathbb{E}\equiv \mathbb{R}^n$ be a vector space.

Then vector embedding function

$$\begin{gathered} \operatorname{E}: T \to \mathbb{E}\\ \forall t_i \in T: t_i \mapsto \vec{e}_i \end{gathered}$$

$\mathbb{E}$ is then known as the n-dimensional embedding space of $\operatorname{E}$.

Matrix representation

Let $\mathbf{E} \in \mathbb{R}^{|\mathcal{V}| \times n}$ be an vector embedding matrix.

$$ \vec{e}_i = \mathbf{E}[t_i]. $$