Labs
Every interactive demo, on its own. Each one links to the lesson that explains what you are seeing.
- AI from zeroA tiny neural networkTrain a network with one hidden layer on curved data and watch several straight lines combine into a curved boundary.Novice
- AI from zeroConfident, and wrongA model trained on one region of data is tested somewhere else. Its accuracy collapses while its confidence stays high.Novice
- AI from zeroFit a lineDrag a line through ice cream sales data, score it by its squared misses, then watch gradient descent find the best line.Novice
- AI from zeroNext-word predictorA tiny language model trained on Aesop's fables. See its next-word probabilities, pick words yourself, and change the temperature.Novice
- AI from zeroOne neuronSet the weights and bias of a single artificial neuron, watch it draw a straight decision line, then let it learn from examples.Novice
- AI from zeroTeach by exampleAdd labeled points and watch a k-nearest-neighbors model shade the whole plane with its guesses.Novice
- AI from zeroWhich measurements matterPlot sixty fruit using any two of four measurements and see which ones let a model tell apples from oranges.Novice
- How machines learnChoosing a thresholdDrag a spam filter's threshold and watch the confusion matrix, precision, recall, and ROC curve respond.Beginner
- How machines learnFitting a lineDrag points, fit a line by hand, and compare the best lines under squared and absolute error when an outlier appears.Beginner
- How machines learnGradient descentDrop a starting point on a loss surface and watch gradient descent find its way down, or overshoot and diverge.Beginner
- How machines learnk-means, step by stepWatch k-means find groups in unlabeled points by alternating assign and update steps, and see where it goes wrong.Beginner
- How machines learnLogistic regressionTrain a classifier live and watch its decision boundary and probability shading settle between two classes.Beginner
- How machines learnOptimizer raceRace plain gradient descent, momentum, RMSProp, and Adam from the same start on four loss surfaces.Beginner
- How machines learnOverfittingRaise a polynomial's degree until it memorizes the noise, watch test error climb, then rein it in with regularization.Beginner
- How machines learnThe learning loopStep a line through predict, measure, find the direction, and update, and watch training and test loss fall.Beginner
- Neural networksA layer as a matrixSee one layer of neurons two ways at once: as a network diagram and as the matrix product Wx + b.Intermediate
- Neural networksBackpropagation, step by stepRun a single neuron forward, then send gradients backward through its computational graph one chain-rule multiplication at a time.Intermediate
- Neural networksConvolution 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
- Neural networksHandwritten digit recognizerDraw a digit for a network trained on MNIST and watch its hidden layers and output probabilities respond as you draw.Intermediate
- Neural networksNeural 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
- Neural networksWatch 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
- Language as vectorsByte-pair encoding, step by stepTrain a tiny tokenizer from single characters and watch merges build a vocabulary while the token count drops.Intermediate
- Language as vectorsDistances in many dimensionsWatch the distances between random points bunch together as the number of dimensions grows, the curse of dimensionality in one slider.Intermediate
- Language as vectorsDot product, cosine, and distanceDrag two vectors and watch the dot product, cosine similarity, angle, and distance update, with the arithmetic shown.Intermediate
- Language as vectorsEmbedding projectorTurn a 3D projection of real word vectors and check what you see against each word's true neighbors in 100 dimensions.Intermediate
- Language as vectorsRetrieval-augmented generation pipelineChunk a document, embed it with a real model in your browser, retrieve the best passages for a question, and see the prompt a RAG system would send.IntermediateDownloads a 24 MB model
- Language as vectorsSemantic searchRace keyword search (BM25) against a real sentence embedding model running in your browser, on sentences you can edit.IntermediateDownloads a 24 MB model
- Language as vectorsTokenizer 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
- Language as vectorsWord embeddings explorerExplore 10,000 real GloVe word vectors. Find neighbors, solve analogies with vector arithmetic, and map word pairs in 2D.Intermediate
- Transformers and LLMsA 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 275 MB
- Transformers and LLMsAttention calculatorDrag queries, keys, and values on a plane and watch scaled dot-product attention compute scores, weights, and outputs for every token.Advanced
- Transformers and LLMsAttention 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
- Transformers and LLMsCompute 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
- Transformers and LLMsPosition 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
- Transformers and LLMsSampling the next tokenReshape a next-token distribution with temperature, top-k, and top-p, then draw from it and compare the counts.Advanced
- Transformers and LLMsThe KV cacheStep through generation with and without a key-value cache, then size the cache for real models, context lengths, and batches.Advanced
- Transformers and LLMsTransformer 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
- FrontiersContrastive learning, CLIP styleTrain an image encoder and a text encoder together until each picture lands next to its caption in one shared space.Advanced
- FrontiersDiffusion from noise to dataWatch noise turn into a 2D dataset using the exact reverse diffusion process, with the score field drawn as arrows.Advanced
- FrontiersMixture of expertsSee a router send each token to its top experts, then compare total and active parameter counts for a Mixtral-shaped model.Advanced
- FrontiersThe tool-use loopStep through how an application and a model trade messages to use tools, and switch on failures to see how the loop copes.Advanced
- FrontiersVoting over sampled answersCompute exactly how majority voting over n sampled answers changes accuracy, and see when it helps and when it hurts.Advanced