Skip to content
The Transformer · Vaswani et al., 2017Six encoder layers and six decoder layers. Encoder output supplies keys and values to each decoder cross-attention sublayer. Residual connections use post-normalization. Inputs and shifted outputs receive positional encoding.Encoder × 6Decoder × 6Input embeddingOutput embedding+Positionencoding+PositionencodingMulti-HeadAttentionAdd & NormFeed ForwardAdd & NormMasked Multi-HeadAttentionAdd & NormMulti-HeadAttentionAdd & NormFeed ForwardAdd & NormLinearSoftmaxOutput probabilitiesSource tokensTarget tokens · shifted rightKVQStructure: Vaswani et al., Figure 1 (2017) · Diagram: LiminalML

The Transformer architecture

The complete encoder–decoder, grounded in the original paper.

Explore the architecture

Preparing the 3D view…

LoRA update space

Change the adapter rank and watch its outputs open from a line into a plane and a volume.

Explore in 3D

Preparing the 3D view…

Rotary position encoding

Turn three coordinate pairs at different frequencies and inspect how position changes their phase.

Explore in 3D

Preparing the 3D view…

KV-cache memory

Step through decoding and see keys and values accumulate in separate banks for each layer.

Explore in 3D

Preparing the 3D view…

PCA projection

Move a three-dimensional point cloud onto its first principal component and inspect the lost directions.

Explore in 3D
DEMONSTRATIONResponse 1The target ✓Response 3Response 4LEARN THE TARGET

Supervised fine-tuning

Choose the demonstrated response. Watch cross-entropy move probability toward it, one gradient update at a time.

Explore the mechanism
Preferred +Rejected −Preference marginlog σ

Direct preference optimization

Pick a preferred and rejected response. Compare their log-probability ratios against a frozen reference.

Explore the mechanism
TEACHERSTUDENTSoft targets · temperature

Knowledge distillation

Reveal a teacher’s softened distribution and watch a student learn its relative preferences.

Explore the mechanism
1 − ε1 + εCLIPPED SURROGATE

PPO clipping

Change the clip range and inspect where the policy surrogate stops rewarding movement in the same direction.

Explore the mechanism
A GROUP OF RESPONSESABCDEFReward relative to the group mean

Group-relative optimization

Score six candidate responses, normalize their rewards, and trace the clipped policy update.

Explore the mechanism
SAMPLE → REWARD → UPDATE23%70%40%A policy learns through experience

Policy-gradient bandit

A seeded agent samples actions, receives their rewards, and updates its categorical policy with REINFORCE.

Explore the mechanism
TEACHERREWARDmixAnneal the schedule · gate each turn

Teacher-to-reward guidance

Explore ATOD’s annealing and turn-level gates using editable synthetic signals.

Explore the mechanism

Follow an idea into the details.

Worked examples that connect the picture, the calculation, and the implementation.

Where the ideas are going.

Further reading discovered through alphaXiv.

Distilled Reinforcement Learning for LLM Post-training

This July 2026 paper, revised in September, investigates selective teacher signals inside reward-based learning. It is further reading, rather than an implemented training algorithm in Studio.

Discover on alphaXivRead the primary paper