ANIMATIX DEEP DIVE · COMPILATION-FIRST EXPLAINER
Every frontier language model is powered by one core machine repeated in a stack:
the transformer block. Dissect the architecture step by step below.
Every figure is a declarative .amx scene compiled live in your browser
and rendered at 60 FPS via WebGPU.
Tokens climb through repeated self-attention and feed-forward sublayers (× N). The winning token from the LM head appends back onto the input row — that feedback loop is autoregressive generation.
Neural networks compute on geometry, not strings. The input string fractures into sub-word tokens via Byte-Pair Encoding, each extruding a 768-dimensional coordinate row from a learned lookup matrix.
// Declarative token chips & coordinate extrusion
in_row: Row, at: (520, 190), gap: 18, align: "center" {
c1: LabeledBox, label: "The", width: 120, height: 56, text_size: 17
c2: LabeledBox, label: "animal", width: 120, height: 56, text_size: 17
c3: LabeledBox, label: "didn't", width: 120, height: 56, text_size: 17
c4: LabeledBox, label: "cross", width: 120, height: 56, text_size: 17
}
Self-attention is permutation-invariant — it treats tokens as an unordered bag of words. Word order is injected by adding a unique harmonic frequency fingerprint to each position.
Token "it" projects a Query probing preceding Keys.
Dot-product affinities are scaled by 1/√d_k and passed through Softmax to form attention weights.
A single attention head can only focus on one relationship at a time. Splitting coordinates into 12 parallel heads allows simultaneous tracking of syntax, coreference, and grammatical dependency.
While attention routes information between tokens, the FFN processes each token alone. Expanding coordinates 4× creates a rich associative memory space for factual recall.
Raw coordinates enter at block 1. Layer by layer, representation refines from low-level surface grammar to high-level abstract reasoning, culminating in vocabulary logit scoring at the LM head.
There are zero pre-rendered video files on this page. Every figure is a declarative .amx file compiled live in your browser and rendered at 60 FPS through WebGPU.
<script type="module" src="../../embed/amx-player.js" data-runtime-base="../../pkg-slim"></script> <amx-player src="scenes/attention.amx" autoplay loop controls hold="1.5" aspect="16:9"></amx-player>
Because these scenes use vector geometries and typography without Typst or SVG dependencies, they run on the lightweight pkg-slim runtime profile (~1.6 MB brotli-compressed).