glassllmDocumentation

DOCUMENTATION · TRANSFORMER IN NUMPY

See the calculation.
Understand the model.

From the first token to the gradient: explore the network, follow the values and open the code behind each operation.

4Transformer blocks77calculations per predictionNumPyinspectable engine
A prediction's path through the TransformerTokens enter as vectors. Four blocks combine attention and SwiGLU. The output supplies the next-token distribution. This is a schematic drawing.INSIDE ONE PREDICTIONtextastokensE[ids]vectors · 128 dimensionsTransformer block × 4QKVattention → residuals → SwiGLURMSNorm → Eᵀ1024 logitssoftmax(z / T)next tokenback into context
Schematic model flow. Explore actual values in the lab.

CHOOSE WHERE TO START

Explore. Understand. Experiment.

  1. 01

    Explore with one token

    Generate a prediction, read the tokens and explore the lab controls.

  2. 02

    Understand each calculation

    Connect vectors, attention and rotations to equations and actual values.

  3. 03

    Program with the engine

    Use the same Transformer in Python: inference, snapshots, autograd and training.

FOLLOW THE DATA

One model, two paths

Each step opens its explanation

FROM DIAGRAM TO VALUES

Make time for each step.

Enable slow motion, pause at Q, K or V and compare the equation with the computed matrix. The inspector shows dimensions, statistics and the Python line that produced the result.

  • 01Generate an actual token.
  • 02Pause at the calculation you want to study.
  • 03Read the explanation, values and source.
Slow-motion guide
Actual causal-mask inspector: future positions marked −∞, matrix and source line
The causal mask blocks access to future positions. Inspect its actual values.

ONE LIBRARY, TWO WAYS TO EXPLORE

The site uses the same Python engine.

Lab

Controls, diagram and matrices

TypeScript

Web Worker

Python in the browser

Pyodide · wheel

glassllm

Model, autograd and snapshots

Python · NumPy

Generation runs locally after loading the runtime and weights. The interface receives results and replays the path; training runs through the Python library.

Understand the integration

LOOK IT UP WHEN YOU NEED IT

All documentation

35 pages per language

Usage guides, foundations, function reference and papers organized around the path you are studying.