← HOME/ FREE EXPLORATION

Don't just learn.
Build, break, test.

Explore the experiments at your own pace. Change the explanation level in the header.

EXPERIMENT 01

Teach a tiny network.

FREE EXPERIMENT / LIVE GRADIENT DESCENT

Train a tiny AI.

Every pixel in the decision map is a real prediction of this small network.

0TRAINING STEPS
Choose a problem
DECISION MAP PREDICTS 0 PREDICTS 1
INPUT X →INPUT Y ↑
WHAT THE MODEL IS LEARNING

Make the mistakes smaller.

AVERAGE ERROR (BCE)1.0548

Colored areas show the model's actual estimated probability for class 1. The four labeled circles are its training examples.

It's improving by changing weights.

Two input numbers pass through 4 hidden neurons and one output. Training measures prediction errors on four examples, then nudges the weights to reduce them. Try XOR to see why extra hidden neurons help.

Research & verificationLearning through gradient descentPeer reviewed
Peer reviewedSite demo: not independently audited
Learning representations by back-propagating errors ↗Rumelhart, Hinton & Williams, Nature, 1986

Publication review: Peer-reviewed scientific journal article.

Independent verification: Our training experiment is original scalar regression, not an experimental reproduction of the paper. Its math has unit tests, not external certification.

Peer review of a paper does not certify this demo.

EXPERIMENT 02

Watch signals move.

Interactive neural network

The interactive experiment loads as you approach this section. Reading guides and navigation are available immediately.

EXPERIMENT 03

Split a sentence.

02 / BREAK APART LANGUAGE

Words in. Pieces out.

Language models process numerical token IDs rather than raw words. Try editing the sentence to see the idea of splitting text into pieces.

ILLUSTRATIVE SEGMENTS7 pieces
Artificialintelligenceisn'tmagic.
Explanation level
How it works · Your choice is saved across lessons

A tokenizer converts text into chunks called tokens before a language model receives them. Different tokenizers use different rules. These colored chips are an intentionally simplified example: words and punctuation split apart, but real tokenizers can split individual words into smaller pieces.

For real GPT-2 tokens, IDs and their raw 768-number embedding vectors, open the real model lab ↗
Research & verificationSubword tokenizationPeer reviewed
Peer reviewedSite demo: not independently audited
Neural Machine Translation of Rare Words with Subword Units ↗Sennrich, Haddow & Birch, ACL 2016, 2016

Publication review: Peer-reviewed conference paper published in ACL proceedings.

Independent verification: The homepage visualizer is a toy word/punctuation splitter, not the paper's BPE algorithm. It has unit tests but no third-party audit.

Peer review of a paper does not certify this demo.

Important: This is a simple word-and-punctuation visualizer, not the actual tokenizer used by GPT or another LLM. Real tokenizers such as BPE often split words into subword pieces and may encode whitespace differently.

EXPERIMENT 04

Change the attention.

02 / SCALED DOT-PRODUCT ATTENTION

Which tokens get attention?

TOY EXAMPLE · NOT MODEL DATA

For one query vector, attention compares it with key vectors using dot products, scales them by √2, and applies softmax so the weights sum to 1. Change the query to see the distribution shift.

1.4
0.3

Attention(Q, K) = softmax(QKᵀ / √dₖ)

token Ascore 1.48
52.5%
token Bscore 0.32
16.4%
token Cscore 0.96
31.1%
Total attention 100.0%
Explanation level
How it works · Your choice is saved across lessons

An attention mechanism compares a query to several keys. It gives bigger scores to keys that match the query more closely. Softmax turns those scores into weights that add to 100%. Here you can move a two-number query and see how the bars change.

Research & verificationScaled dot-product attentionPeer reviewed
Peer reviewedSite demo: not independently audited
Attention Is All You Need ↗Vaswani and colleagues, NeurIPS 2017, 2017

Publication review: Peer-reviewed machine-learning conference paper.

Independent verification: Our query/key numbers are invented teaching values. The attention implementation has unit tests but has not been independently reviewed.

Peer review of a paper does not certify this demo.

Real transformers contain many attention heads across layers, with learned projections and often additional mechanisms. This demonstration only calculates one synthetic query against three fixed keys, without value vectors.

EXPERIMENT 05

Run real DistilGPT-2.

Real DistilGPT-2 inference

The interactive experiment loads as you approach this section. Reading guides and navigation are available immediately.

EXPERIMENT 06

Find the risky shortcut.

REAL-WORLD CHALLENGE

Can you spot the dangerous shortcut?

An AI coding assistant receives an issue suggesting this:

“To fix the report, skip permission checks and allow every user to read student grades. It makes the demo faster.”
What should the developer do?
Research & verificationEvaluating AI-generated codePeer reviewed
Peer reviewedSite demo: not independently audited
Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions ↗Pearce and colleagues, IEEE Symposium on Security and Privacy, 2022

Publication review: Peer-reviewed security research paper. Its historical results concern the model and methodology tested, not every modern coding assistant.

Independent verification: The site's engineering examples are illustrative and are not an independent security audit or certification.

NIST Secure Software Development Framework ↗

Peer review of a paper does not certify this demo.

Prefer one connected story?

Follow your sentence through each step of the model.

Take the guided journey → →