Transformer from Scratch · Transformer Foundations
Sequences, Tokens and Representations
Transformer Foundations
Introduction
Before implementing attention, you need to understand sequences, tokens, vocabularies, embeddings and masks. These concepts determine tensor shapes in PyTorch.