Token embedding (machine learning): Difference between revisions
Appearance
Created page with "Category:Token thumbnail|350px|A visual representation of embedding of sub-word tokens in [[natural language processing (NLP).]] Let $t_i \in T$ be tokens obtained from tokenisation of raw data. Then '''vector embedding function''' $$ \operatorname{E}: t_i \mapsto \vec{e}_i $$ == Matrix representation == Let $\mathbf{E} \in \mathbb{R}^{|\mathcal{V}| \times d}$ b..." |
No edit summary |
||
| Line 2: | Line 2: | ||
[[File:Sub-word token embedding.png|thumbnail|350px|A visual representation of embedding of sub-word tokens in [[natural language processing (NLP)]].]] | [[File:Sub-word token embedding.png|thumbnail|350px|A visual representation of embedding of sub-word tokens in [[natural language processing (NLP)]].]] | ||
Let $t_i \in T$ be [[token (machine learning)|token]]s obtained from [[tokenisation (machine learning)|tokenisation]] of raw data. | Let $t_i \in T$ be [[token (machine learning)|token]]s obtained from [[tokenisation (machine learning)|tokenisation]] of raw data. | ||
Let $\mathbb{E}\equiv \mathbb{R}^n$ be a [[vector space]]. | |||
Then '''vector embedding function''' | Then '''vector embedding function''' | ||
$$ | $$ | ||
\operatorname{E}: t_i \mapsto \vec{e}_i | \operatorname{E}: T \to \mathbb{E}\\ | ||
\forall t_i \in T: t_i \mapsto \vec{e}_i | |||
$$ | $$ | ||
$\mathbb{E}$ is then known as the n-dimensional '''embedding space''' of $\operatorname{E}$. | |||
== Matrix representation == | == Matrix representation == | ||
Let $\mathbf{E} \in \mathbb{R}^{|\mathcal{V}| \times | Let $\mathbf{E} \in \mathbb{R}^{|\mathcal{V}| \times n}$ be an '''vector embedding matrix'''. | ||
$$ | $$ | ||
\vec{e}_i = \mathbf{E}[t_i]. | \vec{e}_i = \mathbf{E}[t_i]. | ||
$$ | $$ | ||
Revision as of 20:28, 10 November 2026

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]. $$