Labs
Every interactive demo, on its own, 104 in all. They are listed in the order the lessons use them, and each one links to the lesson that explains what you are seeing.
AI from zero12 labs
- Teach by exampleAdd labeled points and watch a k-nearest-neighbors model shade the whole plane with its guesses.Novice
- Which measurements matterPlot sixty fruit using any two of four measurements and see which ones let a model tell apples from oranges.Novice
- Fit a lineDrag a line through ice cream sales data, score it by its squared misses, then watch gradient descent find the best line.Novice
- One neuronSet the weights and bias of a single artificial neuron, watch it draw a straight decision line, then let it learn from examples.Novice
- A tiny neural networkTrain a network with one hidden layer on curved data and watch several straight lines combine into a curved boundary.Novice
- Next-word predictorA tiny language model trained on Aesop's fables. See its next-word probabilities, pick words yourself, and change the temperature.Novice
- Confident, and wrongA model trained on one region of data is tested somewhere else. Its accuracy collapses while its confidence stays high.Novice
- Approve or denyPlay the program around an AI assistant booking dinner. It proposes actions; you decide which run, and see what a payment request hidden on a web page does.Novice
- Will it fit?Turn a parameter count and bits per number into a download, the memory needed, and a speed ceiling, and see which models fit a phone, a laptop, or need a data center.Novice
- Find the watermarkA word model writes with a hidden statistical watermark. Count green words with the key, see how length and strength matter, swap words to wash it out, and test your own writing.Novice
- Read the licenseChoose what you want to do with a model and see what MIT, Apache 2.0, OpenRAIL-M, Llama 4, Gemma, CC BY-NC, and a closed API's terms allow, each answer quoted from the text.Novice
- Drawing a digit from noiseAsk a small trained network for a handwritten digit and watch it turn random noise into one, step by step, in your browser.Novice
How machines learn15 labs
- The learning loopStep a line through predict, measure, find the direction, and update, and watch training and test loss fall.Beginner
- Fitting a lineDrag points, fit a line by hand, and compare the best lines under squared and absolute error when an outlier appears.Beginner
- Gradient descentDrop a starting point on a loss surface and watch gradient descent find its way down, or overshoot and diverge.Beginner
- Optimizer raceRace plain gradient descent, momentum, RMSProp, and Adam from the same start on four loss surfaces.Beginner
- Base ratesA thousand people take a medical test. See why a positive result from a good test can still mean a small chance of being sick.Beginner
- Naive Bayes spam filterType a message and see how each word's evidence adds up to a spam probability, then break the filter by repeating words or turning off smoothing.Beginner
- Logistic regressionTrain a classifier live and watch its decision boundary and probability shading settle between two classes.Beginner
- OverfittingRaise a polynomial's degree until it memorizes the noise, watch test error climb, then rein it in with regularization.Beginner
- Build a tree by handGrow a decision tree on Quinlan's classic weather data one question at a time, with the information gain of every choice in front of you.Beginner
- Grow a decision treeWatch a tree split the plane one question at a time, and find the depth where it stops learning and starts memorizing.Beginner
- Random forestGrow a hundred trees on bootstrap samples, compare one tree with the whole forest's vote, and estimate accuracy from the points each tree never saw.Beginner
- AdaBoost with stumpsAdd one-question trees round by round and watch the weights of hard points grow until the weighted vote fits the data.Beginner
- Gradient boostingFit a curve by adding small trees, each one trained on what the previous ones still get wrong, and see how the learning rate trades speed for accuracy.Beginner
- Choosing a thresholdDrag a spam filter's threshold and watch the confusion matrix, precision, recall, and ROC curve respond.Beginner
- k-means, step by stepWatch k-means find groups in unlabeled points by alternating assign and update steps, and see where it goes wrong.Beginner
Neural networks7 labs
- A layer as a matrixSee one layer of neurons two ways at once: as a network diagram and as the matrix product Wx + b.Intermediate
- Watch a network reshape spacePush a grid and a dataset through a tiny network, layer by layer, and see linear maps stretch the plane while activations bend it.Intermediate
- Backpropagation, step by stepRun a single neuron forward, then send gradients backward through its computational graph one chain-rule multiplication at a time.Intermediate
- Neural network playgroundTrain real neural networks in your browser. Change depth, width, activation, and learning rate, and watch every neuron and the loss curves respond.Intermediate
- Convolution explorerSlide a 3 × 3 kernel across an image and see the arithmetic behind each output pixel. Try edge detectors, blur, and your own kernels.Intermediate
- Handwritten digit recognizerDraw a digit for a network trained on MNIST and watch its hidden layers and output probabilities respond as you draw.Intermediate
- Latent space explorerWalk the two-number map a variational autoencoder learned from handwritten digits: decode any point, morph between digits, place your own drawing, and try latent arithmetic.Intermediate
Language as vectors10 labs
- Byte-pair encoding, step by stepTrain a tiny tokenizer from single characters and watch merges build a vocabulary while the token count drops.Intermediate
- Tokenizer playgroundSee any text split into tokens by GPT-4o's tokenizer or GPT-2's, with ids, counts, and the surprises in numbers, code, and other languages.Intermediate
- Dot product, cosine, and distanceDrag two vectors and watch the dot product, cosine similarity, angle, and distance update, with the arithmetic shown.Intermediate
- Word embeddings explorerExplore 10,000 real GloVe word vectors. Find neighbors, solve analogies with vector arithmetic, and map word pairs in 2D.Intermediate
- Embedding projectorTurn a 3D projection of real word vectors and check what you see against each word's true neighbors in 100 dimensions.Intermediate
- Distances in many dimensionsWatch the distances between random points bunch together as the number of dimensions grows, the curse of dimensionality in one slider.Intermediate
- Semantic searchRace keyword search (BM25) against a real sentence embedding model running in your browser, on sentences you can edit.IntermediateDownloads a 24 MB model
- Retrieval-augmented generation pipelineChunk a document, embed it with a real model in your browser, retrieve the best passages for a question, and have a small chat model answer from them.IntermediateDownloads a 24 MB model, and 272 MB for the answer step
- Embedding workbenchEncode any text into 384 numbers with a real sentence embedding model, then probe it with nearest concepts, vector arithmetic, differences, and a map.IntermediateDownloads a 24 MB model, plus an optional 272 MB language model
- Train a recommenderRate a few shows and watch matrix factorization learn a map of shows and of your taste. Then run a feed that only learns from what it chooses to show.Intermediate
Transformers and LLMs14 labs
- Sampling the next tokenReshape a next-token distribution with temperature, top-k, and top-p, then draw from it and compare the counts.Advanced
- A hidden state through timeWatch a one-number recurrent network carry the subject of a sentence word by word, and see its gradient vanish or explode through time.Advanced
- Attention calculatorDrag queries, keys, and values on a plane and watch scaled dot-product attention compute scores, weights, and outputs for every token.Advanced
- Attention heads and the causal maskCompare hand-built versions of five attention patterns seen in trained transformers, switch the causal mask on and off, and see how heads split the model width.Advanced
- Position encodingsExplore the sine and cosine waves of the original transformer's position encodings, then rotate queries and keys with RoPE and watch their dot product depend on position only through the offset.Advanced
- Transformer anatomySelect any part of a decoder-only transformer to see its job, its tensor shapes, and its parameter count, for models from GPT-2 to Llama 3.Advanced
- A live language modelRun SmolLM2-135M in your browser, see how it tokenizes your text, read its real next-token probabilities, and generate one token at a time.AdvancedDownloads about 272 MB
- Compute and scaling lawsChoose a model size and a number of training tokens, see the compute it costs, and compare it with the compute-optimal split under two fitted scaling laws.Advanced
- Clean a web crawlRun a miniature pretraining-data pipeline on a sample crawl. Switch on quality rules, a word blocklist, and exact and near-duplicate removal, and see what survives.Advanced
- How low can the rank go?Choose a LoRA rank and see how much of a target weight change B times A can capture, from the singular values or by training from B = 0.Advanced
- The KV cacheStep through generation with and without a key-value cache, then size the cache for real models, context lengths, and batches.Advanced
- Squeeze the weightsQuantize 128 weights to 8, 4, or 3 bits with absmax or zero-point scales, add an outlier, and see what rounding costs.Advanced
- Same text, two modelsGive SmolLM2-135M and SmolLM2-135M-Instruct exactly the same tokens, as plain text or in the chat template, and compare what each writes.AdvancedDownloads about 272 MB per model
- A chat, as the model reads itChat with SmolLM2-135M-Instruct in your browser and see the one long text it reads each turn, the system prompt, and a context window filling up.AdvancedDownloads about 272 MB
Learning by trial and error6 labs
- Five slot machinesRace epsilon-greedy, UCB, and Thompson sampling on the same slot machines with the same luck, and watch regret pile up.Intermediate
- Plan with valuesRun value iteration on two gridworlds and watch how the cost of moving, the discount, and slippery moves change the best route.Intermediate
- Learn a gridworld by trial and errorWatch Q-learning and SARSA learn a maze and a cliff walk from rewards alone, one move at a time, with no map of the world.Intermediate
- Train a policy directlyTrain REINFORCE live on a corridor where the best policy is random, and watch learning rate and baseline shape the climb.Intermediate
- Why a baseline helpsSee a thousand REINFORCE gradient estimates at once, and slide a baseline to watch their spread change while their average stays put.Intermediate
- Overoptimizing a reward modelPush a model toward a flawed reward model's favorite answers with best-of-n or a KL penalty, and watch true quality rise, peak, and fall.Intermediate
Inside the model6 labs
- Model microscopeLook inside a real language model in your browser. Read its guess at every layer, see all 270 attention heads, and switch parts off.AdvancedDownloads about 272 MB
- Watch an induction circuit formTrain a two-layer transformer in your browser and watch copying appear suddenly, then switch heads off to find what the circuit depends on.Advanced
- Five features, two dimensionsTrain a toy ReLU model in your browser and watch sparse features share directions, as antipodal pairs and then a pentagon.Advanced
- Steering a modelBuild a direction from two sets of prompts, add it to a real model's residual stream while it writes, and compare the text with and without it.AdvancedDownloads about 272 MB
- Coin or door?Train an agent whose coin almost always sits on the door, then move the coin and watch it keep its skills but head for the wrong goal.Advanced
- Teach a reward modelLabel pairs of replies, fit a Bradley-Terry reward model to your choices, and watch a policy that maximizes it flatter users who are wrong.Advanced
Models that see9 labs
- From pixels to patchesSee your photo as a vision model does, as numbers, as a convolution's small window, and as the grid of patches a vision transformer reads as tokens.Intermediate
- Recognizing objectsRun a real image classifier and a real object detector on sample photos, your own pictures, or your camera, and see what their labels and scores mean.IntermediateDownloads a 24 MB classifier and a 27 MB detector, each on request
- Labels you writeScore your own photos against labels you type, with OpenAI's CLIP running in your browser, and see how the wording and the choice of labels change the answer.AdvancedDownloads a 306 MB model
- Depth from one pictureTurn a single photo, your own picture, or a camera snapshot into a depth map and a 3D relief with Depth Anything V2 running in your browser.IntermediateDownloads a 50 MB model
- Where the classifier looksCover one square of a photo at a time and rerun a real image classifier to map which regions its answer depends on, and which it can do without.IntermediateDownloads a 24 MB classifier, on request (the same one the object recognition lab uses)
- Find anything you can nameType any words and an open-vocabulary detector running in your browser boxes what matches each one, on sample photos, your own pictures, or the live camera.IntermediateDownloads a 311 MB detector, on request
- Cut objects outClick anything in a photo and SAM outlines it with three guesses, or let a background remover find the main subject by itself. Both run in your browser.IntermediateDownloads a 78 MB segmentation model and a 99 MB background remover, each on request
- How a model reads a pictureAsk Janus-Pro-1B about photos and text cards, see the 576 image tokens your picture becomes, and check how sure the model was of every word, right or wrong.AdvancedDownloads about 1.6 GB of model files and a 27 MB runtime (715 MB if you have used the text-to-image lab), on a GPU with WebGPU
- Find a body's keypointsA person detector boxes each person, then ViTPose+ finds 17 keypoints in each box, from the nose to the ankles. See the heatmap behind every keypoint, and where pose estimation fails.IntermediateDownloads a 27 MB person detector and a 67 MB pose model, each on request
Models that hear and speak5 labs
- SpectrogramSee sound as a picture. Change the window length to trade time detail for frequency detail, switch to mel bands, and watch your own voice live.Intermediate
- What sound is this?Label bells, rain, a train, a cat, or your own recording with an Audio Spectrogram Transformer, mix two sounds, and see why its 527 scores add up to more than 100%.AdvancedDownloads a 91 MB model
- Speech to textRun Whisper in your browser on clean speech, five speakers, added noise, silence, or your own voice, and see the spectrogram it reads and when it heard each word.AdvancedDownloads an 80 MB model
- Text to speechTurn your own text into speech with Supertonic 2 in your browser, see it as a spectrogram with its pitch, and check what Whisper hears in it.AdvancedDownloads a 263 MB model, plus an optional 80 MB model to check the speech
- A voice assistant taken apartAsk a spoken question and follow it through three models in a row, Whisper hearing it, SmolLM2 answering, Supertonic speaking, with each stage's output, time, and mistakes.AdvancedDownloads three models, 615 MB in all (80 MB, 272 MB, and 263 MB), each asked for separately
Frontiers14 labs
- Diffusion from noise to dataWatch noise turn into a 2D dataset using the exact reverse diffusion process, with the score field drawn as arrows.Advanced
- Noising a digitMix a real handwritten digit with noise using DDPM's schedule, and see what a trained denoising network guesses at every step: the noise, and the clean digit.Advanced
- Generating a digitA small class-conditional diffusion model, trained on MNIST and running in your browser: watch a digit emerge from noise, compare DDPM with DDIM, and turn up classifier-free guidance.Advanced
- Text to image, one token at a timeMake pictures from your own prompts with Janus-Pro-1B on your GPU, and watch it write each picture as 576 codes in reading order before a decoder turns them into pixels.AdvancedDownloads about 1.1 GB of model files and a 27 MB runtime, on a GPU with WebGPU
- Contrastive learning, CLIP styleTrain an image encoder and a text encoder together until each picture lands next to its caption in one shared space.Advanced
- Mixture of expertsSee a router send each token to its top experts, explore real routing recorded from OLMoE-1B-7B, then compare total and active parameter counts for a Mixtral-shaped model.Advanced
- Voting over sampled answersCompute exactly how majority voting over n sampled answers changes accuracy, then explore real reasoning traces from a small open reasoning model at thinking budgets from 0 to 4,096 tokens.Advanced
- The tool-use loopStep through how an application and a model trade messages to use tools, switch on failures to see how the loop copes, then replay real runs recorded from three sizes of an open model.Advanced
- Which model is better?Two models with known accuracy take the same benchmark. See how often the weaker one wins, and how many questions it takes to tell them apart.Advanced
- Estimating pass@kEstimate the chance that one of k attempts passes, from n samples per problem. Compare the unbiased estimator with the biased plug-in shortcut.Advanced
- A pairwise arenaSimulated voters compare models two at a time. Turn votes into online Elo or Bradley-Terry ratings and watch the ratings and their intervals settle.Advanced
- Inside a coding agent's harnessA scripted coding agent fixes a real bug in a tiny project in your browser. Change permissions, the sandbox, and the context window, and watch what the harness does.Advanced
- Training and serving energyTurn a model's size, its training tokens, and the hardware into operations, GPU hours, days, and electricity, then add a year of answering prompts. Anchored on published runs.Advanced
- Long context, cost and positionFill a context window with the pieces a real product sends and see the tokens, memory, and compute. Then see where in a long input real models find answers, from recorded results.Advanced
Securing AI6 labs
- Where attacks enter an AI appPick a part of an AI application and see which OWASP, MITRE ATLAS, and NIST entries apply there, or follow a documented attack from part to part.Advanced
- Instructions hidden in an emailAttack a toy email assistant running SmolLM2-135M-Instruct with lines hidden in emails, and test what prompt wording, allowlists, confirmation, and privilege separation catch.AdvancedDownloads about 272 MB
- Poison a knowledge baseAdd one crafted post to a help bot's knowledge base, see which questions it reaches and what it puts in the prompt, and test what each defense catches.AdvancedDownloads a 24 MB model
- Agents with too much powerFour scripted agents are steered toward a harmful call. Change their tools, credentials, sandbox, and approvals, and see what stops each one and what it costs.Advanced
- Poison the training dataHide a trigger in a few training digits, train a small network in your browser, and see which checks notice the backdoor.Advanced
- Fool the handwriting networkAttack the handwriting network with its own gradients, compare random noise of the same size, and test an adversarially trained copy.Advanced















































































































































































































