Home/Learning hub/Inside a language model

Inside a language model.

Follow a prompt from text to the next token. Turn the 3D model, open its blocks and try the calculation with your own text. Unfamiliar words are explained in the AI glossary.

The model, opened upLoading the 3D model
The 3D model of a language model: a board with the prompt, tokens, embeddings, three Transformer blocks and the output probabilities.
0.0 of 12 s

Drag to turn the model. Click it once, then scroll to zoom. On a phone, use two fingers. Click a part or its label to learn what it does. The shapes are a simplified picture. The number lab below runs a real calculation.

Number lab

What the model calculates for your text

A small Transformer runs here in your browser. Before the page was built, it learned its weights from 25 short sentences, so it continues texts like the examples well and anything else poorly. Nothing you type leaves your device.

The sequence

Pick an example or type your own text, then ask for the next token.

Next-token probabilities

Check yourself

Six short questions

Pick an answer to see a short explanation. Nothing is scored or saved.