Subword Tokens and Embedding Lookups

Map text into reusable units and distinguish a vocabulary identifier, learned embedding, and contextual output.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Token boundaries depend on a trained representation
  2. Lookup parameters are shared across token occurrences

Token boundaries depend on a trained representation

A byte- or character-based vocabulary can define merges used to form common longer units. A tokenization model supplies the vocabulary and the order or scoring rules deciding segmentation. Text processed under a different vocabulary can yield a different sequence length, even when decoded text is identical. Special tokens have documented meanings, so preprocessing and tokenization belong to the model’s reproducibility contract.

Lookup parameters are shared across token occurrences

An identifier selects a row in an embedding matrix. Two occurrences of one token start with the same lookup vector, before any position or context computations. They can develop different states after attending to their neighbors. Position does not live in the token identifier itself. Positional encodings show how sequence order enters representations. Attention explains how other tokens change the context.[1][2]

References

  1. Ashish Vaswani et al., Attention Is All You Need ↩
  2. Ian Goodfellow, Yoshua Bengio and Aaron Courville, Deep Learning ↩