Skip to content
CAS

Foundation · 2017 · the default substrate

Transformer

The architecture that replaced recurrence with attention: parallelizable sequence modeling whose scaled descendants power modern foundation models.

ModLensFoundation

Interactive Diagram

Focus the lens

Click any component to read what it does. Signal direction follows the edges.

Tokens + PosSelf-AttentionFeed-Forwardper positionResidual + NormRepresentation

inputTokens + Pos. Discrete inputs embedded into a continuous space with order restored by positions.

Core idea

Let every element query every other element directly. Attention routes information by content, not by distance, and the whole sequence trains in parallel.

Why it exists

Recurrent models bottleneck information through time steps; attention removes the bottleneck and the sequential training constraint at once.

Mathematics

\mathrm{softmax}\!\left(\frac{QK^{\top}}{\sqrt{d_k}}\right)V
Scaled dot-product attention
\mathrm{MultiHead} = \mathrm{Concat}(h_1,\dots,h_h)W^O
Multi-head

Data Flow

What moves through the system

  1. 01Tokens are embedded with positional information.
  2. 02Attention layers mix information across the sequence.
  3. 03Feed-forward layers transform each position independently.
  4. 04Residuals and normalization stack these into deep networks.

Strengths

  • + Parallel training
  • + Direct long-range connections
  • + Scales with data and compute

Limitations

  • Quadratic attention cost
  • Weak locality prior without structure

Applications

  • · Language
  • · Vision
  • · Speech
  • · Multimodal foundations
Ask CAS