Özer Cem KELAHMETKELAHMET
AI Simulations

AI Simulations

Sixty-five interactive simulations of how modern AI works, each with a step-by-step code lab: a nine-step track on training a model from scratch, classical machine learning, neural network basics, real training runs, transformer internals, every major RAG design, vector search, evaluation, agents, guardrails and a large tabular foundation model lab. Most compute every number live in your browser, and many take your own input.

65 simulations65 code labs41 take your own input60 compute every number live
TrainingIntermediateReal computationCode labA real training run, live: loss curves, checkpoints and a confusion matrixTrain a real neural network on 1,797 handwritten digits in your browser and watch it like a production run: loss, learning rate, checkpoints, errors.Open simulation

Training from scratch 9

Training from scratchIntermediateReal computationYour inputCode labPre-training data: deduplicate, filter by quality and mix the sourcesClean a 3,000-document corpus live: remove exact and near duplicates, filter by quality and language, then weight the sources into a training mixture.Open simulation Training from scratchIntermediateReal computationYour inputCode labTrain a tokenizer: byte-pair merges and the vocabulary-size trade-offLearn byte-pair merges live, tokenize your own text with them and see how vocabulary size trades sequence length against embedding parameters.Open simulation Training from scratchIntermediateReal computationYour inputCode labSize the model: parameters, FLOPs, KV cache and training memorySet layers, width, heads and vocabulary and get the parameter count, training FLOPs per token, KV cache and memory per GPU, from the standard formulas.Open simulation Training from scratchAdvancedReal computationYour inputCode labScaling laws: how to split a compute budget between parameters and tokensSpend one compute budget on a bigger model or on more tokens, with the Chinchilla loss law, and see why serving costs push models to train past it.Open simulation Training from scratchAdvancedReal computationYour inputCode labNumeric precision: fp32, bf16, fp16 and fp8 in training, bit by bitType a number and see it stored in fp32, bf16, fp16 and fp8, then watch small gradients vanish in fp16 and come back with loss scaling.Open simulation Training from scratchAdvancedReal computationYour inputCode labParallelism planner: fit a run on GPUs with data, tensor and pipeline parallelismSplit a 1B to 405B model across up to 4,096 GPUs with data, tensor and pipeline parallelism and ZeRO, and see memory per GPU and the pipeline bubble.Open simulation Training from scratchIntermediateReal computationYour inputCode labA training run, live: warmup, gradient clipping, loss spikes and checkpointsTrain a real network in your browser with AdamW and warmup, inject a bad batch, watch clipping absorb it and roll back to a checkpoint.Open simulation Training from scratchAdvancedReal computationYour inputCode labPost-training: supervised fine-tuning, then preference optimisation with DPOFine-tune a toy policy on demonstrations, then align it with DPO on preference pairs, and see how mislabelled preferences teach the wrong lesson.Open simulation Training from scratchIntermediateReal computationYour inputCode labEvaluation: confidence intervals, leaked test data and pass@kSee how much a benchmark score moves between runs, when a two-point gap is real, how leaked test items inflate a score and how pass@k works.Open simulation

Classical ML 4

Neural network basics 6

Neural network basicsBeginnerReal computationCode labOne neuron: w·x + b and an activationMove the weights and bias of a single neuron and watch its decision line turn and shift, with every number of w·x + b computed live.Open simulation Neural network basicsBeginnerReal computationCode labActivation functions: ReLU, GELU, sigmoid, tanh and moreTwelve activation functions side by side with their slopes: step, sigmoid, tanh, ReLU, Leaky ReLU, ELU, SELU, GELU, Swish, softplus and Mish.Open simulation Neural network basicsBeginnerReal computationCode labLoss functions: MSE, cross-entropy, Huber, focal and hingeEight loss functions and their gradients: MSE, MAE, Huber, log-cosh, binary and categorical cross-entropy, focal loss and hinge, all interactive.Open simulation Neural network basicsIntermediateReal computationCode labBackpropagation, one number at a timeStep through the forward pass, loss, backward pass and weight update of a tiny network, with every value and gradient shown on the graph.Open simulation Neural network basicsIntermediateReal computationCode labGradient descent and its variants: SGD, momentum, Nesterov, RMSProp, AdamSix optimisers race on the same loss surface: SGD, momentum, Nesterov, AdaGrad, RMSProp and Adam, with paths, contours and loss per step.Open simulation Neural network basicsBeginnerReal computationCode labConvolution: how a CNN sees edgesSlide a 3×3 kernel over a handwritten digit and build the feature map pixel by pixel: edge, blur and sharpen filters, editable weights.Open simulation

Training 4

Language models 9

Language modelsBeginnerReal computationYour inputCode labTokenisation with byte-pair encoding, merge by mergeSee how a tokeniser is trained: byte-pair encoding counts adjacent pairs and merges the most frequent one, building a vocabulary step by step.Open simulation Language modelsIntermediateReal computationYour inputCode labAttention: how a transformer decides what to look atSee self-attention weights for a sentence: queries, keys, softmax and temperature, three heads and a causal mask, all interactive.Open simulation Language modelsBeginnerReal computationYour inputCode labSampling: temperature, top-k and top-pSee how a language model picks the next word: temperature, top-k and top-p reshape the probabilities, and 200 samples show what comes out.Open simulation Language modelsAdvancedReal computationCode labPositional encoding: sinusoids and rotary embeddings (RoPE)See how transformers know word order: the sinusoidal encoding matrix, its similarity by distance, and RoPE rotating queries and keys so scores depend on m − n.Open simulation Language modelsIntermediateReal computationCode labThe KV cache: why generation needs it and what it costsSize the KV cache of 1B, 8B and 70B-class models across context length and batch, compare MHA, GQA and MQA, and watch decoding reuse cached keys and values.Open simulation Language modelsIntermediateReal computationCode labGreedy decoding vs beam search, with length penaltyWatch greedy decoding and beam search expand a small language model step by step, find a more probable sentence, and change with the length penalty.Open simulation Language modelsAdvancedReal computationCode labLoRA: fine-tuning with a low-rank updateTrain LoRA's A and B matrices to fit an update of known rank, compare with the SVD optimum, and count trainable parameters for real model sizes.Open simulation Language modelsAdvancedReal computationCode labQuantisation: 8, 4 and 2 bits, scales, groups and outliersQuantise a real weight matrix to 8, 6, 4, 3 or 2 bits with per-tensor, per-channel or group scales and see the error, the effect of outliers and the memory.Open simulation Language modelsAdvancedReal computationYour inputCode labMixture of experts: routing tokens with top-k gatesType a sentence and watch a router send each token to its top-k experts, with capacity limits, dropped tokens and the load-balancing loss.Open simulation

Retrieval (RAG) 15

Retrieval (RAG)IntermediateReal computationYour inputCode labRAG types compared: naive, hybrid, rerank, HyDE, corrective, agenticRun seven retrieval strategies on the same corpus and compare what each one finds: naive, hybrid, rerank, HyDE, query rewriting, corrective, agentic.Open simulation Retrieval (RAG)BeginnerReal computationYour inputCode labNaive RAG: embed, search, take the top threeThe baseline of retrieval-augmented generation, step by step: embed the question, score every chunk by cosine similarity and pass the top three to the model.Open simulation Retrieval (RAG)IntermediateReal computationYour inputCode labHybrid search: BM25 keywords plus vectors, fused by rankSee hybrid retrieval at work: a vector ranking, a BM25 keyword ranking and reciprocal rank fusion that merges them without tuning score scales.Open simulation Retrieval (RAG)IntermediateReal computationYour inputCode labRetrieve and rerank with a cross-encoderRetrieve eight candidates fast, then rerank them with a cross-encoder that reads question and passage together, and watch the relevant chunks climb.Open simulation Retrieval (RAG)IntermediateReal computationYour inputCode labMulti-query rewriting: ask the same question several waysAn LLM rewrites the question into several versions in the documents' vocabulary; each searches on its own and the results are merged by rank fusion.Open simulation Retrieval (RAG)IntermediateReal computationYour inputCode labHyDE: search with a hypothetical answerHypothetical Document Embeddings: an LLM drafts an answer without retrieval, and the draft, which looks like the documents, is used as the search query.Open simulation Retrieval (RAG)IntermediateReal computationYour inputCode labContextual chunks and parent–child retrievalChunks lose meaning when cut out of their document. Add a short context header before indexing and compare rankings with and without it.Open simulation Retrieval (RAG)IntermediateReal computationYour inputCode labCorrective RAG: grade the retrieval, search again if it is weakCorrective RAG grades every retrieved chunk as correct, ambiguous or incorrect, rewrites and searches again when the evidence is weak, then strips noise.Open simulation Retrieval (RAG)AdvancedReal computationYour inputCode labSelf-RAG: the model decides when to retrieve and critiques itselfSelf-RAG emits reflection tokens: whether to retrieve, whether each passage is relevant, whether the answer is supported, how useful it is.Open simulation Retrieval (RAG)AdvancedReal computationYour inputCode labAgentic RAG: plan, search in hops, stop when the evidence is enoughAn agent splits a question into sub-questions, searches hop by hop using what each hop found, and stops when the evidence covers the question.Open simulation Retrieval (RAG)AdvancedReal computationYour inputCode labGraphRAG: entities, communities and global questionsBuild a knowledge graph from the chunks, group entities into communities with summaries, and answer questions about the whole corpus or across documents.Open simulation Retrieval (RAG)BeginnerReal computationYour inputCode labChunking strategies: size, overlap and boundariesSplit a document with fixed-size, sentence or recursive chunking, change size and overlap, and see whether the answer survives in one chunk and ranks first.Open simulation Retrieval (RAG)BeginnerReal computationYour inputCode labEmbedding space: where your query lands among the documentsEvery chunk becomes a point in a vector space. Type a query, see where it lands on a 2D map and which chunks are its nearest neighbours by cosine.Open simulation Retrieval (RAG)IntermediateReal computationYour inputCode labHNSW: how a vector database finds neighbours fastWatch a Hierarchical Navigable Small World index answer a nearest-neighbour query in a few hops instead of comparing against every point.Open simulation Retrieval (RAG)IntermediateReal computationCode labEvaluating RAG: faithfulness, context precision and recallScore RAG answers the RAGAS way: break the answer into claims, check each against the contexts, and measure context precision, recall and answer relevancy.Open simulation

Agents 6

AgentsIntermediateScripted runCode labAn agent run: LangGraph loop, Langfuse trace, DeepEval and RAGAS scoresFollow an AI agent step by step: the LangGraph loop between model and tools, the trace as spans with time and tokens, and evaluation scores.Open simulation AgentsBeginnerScripted runCode labAgentic patterns: ReAct, plan and execute, reflection, multi-agent, routingSix ways to wire models, tools and people: ReAct, plan and execute, reflection, orchestrator and workers, routing and human approval.Open simulation AgentsIntermediateScripted runCode labLangGraph state, checkpoints, interrupts and time travelStep through a LangGraph run: the state after every node, saved checkpoints, an interrupt for human approval, and time travel from an earlier checkpoint.Open simulation AgentsIntermediateReal tools, rule-based plannerYour inputCode labReAct agent: thought, tool call, observation, with your own questionAsk your own question and watch an agent plan, call a calculator, unit converter, date tool or knowledge-base search, read the result and answer.Open simulation AgentsAdvancedReal tools, rule-based plannerYour inputCode labMulti-agent supervisor: researcher, analyst, writer and reviewerGive a team of agents your own task: a supervisor routes it to a researcher, an analyst and a writer, and a reviewer sends unsupported drafts back.Open simulation AgentsIntermediateReal computationYour inputCode labGuardrails: prompt injection, PII masking and grounding checksType any message and watch input and output guardrails detect prompt injection, mask cards and emails, stop off-topic requests and remove unsupported sentences.Open simulation

Large tabular foundation model 11

Large tabular foundation modelIntermediateReal computationYour inputCode labIn-context classification: a tabular foundation model reads labelled rowsWatch a tabular foundation model classify rows with no training: query rows attend to labelled rows, with attention, feature relevance and a learning curve.Open simulation Large tabular foundation modelIntermediateReal computationYour inputCode labIn-context regression: predicting numbers from the rows of the tablePredict house prices with in-context learning: the query attends to similar rows and reads off a value and an interval, compared with ridge regression and kNN.Open simulation Large tabular foundation modelAdvancedReal computationYour inputCode labProbabilistic regression: the whole predictive distribution, scored properlySee a tabular foundation model predict a full distribution: growing noise, two outcomes, calibrated intervals, NLL and CRPS against a Gaussian baseline.Open simulation Large tabular foundation modelIntermediateReal computationYour inputCode labImputation: filling missing cells with a tabular foundation model, MICE, kNN and MIDASHide cells under MCAR, MAR or MNAR and compare five imputers live: mean, kNN, MICE, a MIDAS autoencoder and a tabular foundation model.Open simulation Large tabular foundation modelIntermediateReal computationYour inputCode labMasked-value prediction: the pre-training task of a tabular foundation modelMask any cell and see its predicted distribution, the rows the model read and whether the truth falls inside: the skill behind prediction and imputation.Open simulation Large tabular foundation modelAdvancedReal computationYour inputCode labMIDAS: multiple imputation with a denoising autoencoderTrain a denoising autoencoder on a table with gaps in your browser, draw m imputations with dropout, and see the uncertainty that a single imputation hides.Open simulation Large tabular foundation modelAdvancedReal computationCode labMissingness shift: robustness when test data go missing differently (MIRRAMS)Train at one missing rate and test as missingness grows or changes mechanism, as in MIRRAMS: mean imputation, indicators, mask augmentation, in-context.Open simulation Large tabular foundation modelAdvancedReal computationCode labLarge tables: choosing the context when a table outgrows itGive a tabular foundation model a 3,000-row table and a small context: compare random, class-balanced, ensembled and retrieved context rows at six budgets.Open simulation Large tabular foundation modelIntermediateReal computationYour inputCode labAny table, any schema: column order, names and units do not matterOne predictor reads three unrelated tables with no retraining, and its predictions survive shuffled column order, renamed columns and changed units unchanged.Open simulation Large tabular foundation modelIntermediateReal computationCode labCalibration: do a tabular model's probabilities mean what they say?Draw a reliability diagram for in-context and logistic predictions, measure ECE, Brier score and log loss, and fix overconfidence with temperature scaling.Open simulation Large tabular foundation modelAdvancedReal computationYour inputCode labAnomaly detection with masked-cell surprisePlant anomalies in a table and find them without labels: every cell is predicted from the rest of its row, and improbable combinations rise to the top.Open simulation

About these simulations

Every simulation runs in your browser; nothing is sent to a server. Those marked Real computation calculate every number with the equations described on their page, on real or freshly generated data. Two agent simulations replay scripted runs with typical values; the agent and guardrail simulations marked Real tools, rule-based planner run real tools and decide with rules that stand in for a language model, so you can try your own questions without an API key. Every simulation has a code lab: the same idea in runnable Python, step by step. Open any card to read it in the simulation reader; use the arrows to move between simulations and the Code lab tab to switch to the code.

Last updated Nov 17, 2026
Type to search.
    ↑↓ navigate↵ open