Learn AI, five minutes at a time.
Free, sourced lessons. Start with the basics and build your way up.
Start lesson 1Free · No sign-up · Every fact sourced
Fundamentals
What AI is, how models learn from data, the math underneath, and classic machine learning.
What AI is10 lessons · 45 min0 lessons · 0 min
You can explain what AI, machine learning, deep learning and generative AI are, and how the idea grew.
- Artificial intelligence5 minAn AI system infers from received inputs how to generate predictions, content, recommendations or decisions for explicit or implicit objectives.
- Machine learning5 minMachine learning trains software on data so it can find patterns and make useful predictions or generate content for new inputs.
- Deep learning4 minDeep learning is machine learning with neural networks that stack many layers, so each layer can build a more abstract picture of the data than the one before.
- Generative AI5 minGenerative AI learns patterns from existing data, then uses those patterns to create new text, images, audio, video, code or other content.
- AI model4 minAn AI model is the part of an AI system that has learned from data. It is a structure plus a set of learned numbers that turns an input into a prediction or new content.
- Algorithm4 minAn algorithm is a precise, step-by-step procedure for getting a result. In AI, learning algorithms are the procedures that turn data into a trained model.
- AGI4 minAGI is a proposed category for AI at least as capable as a person across most thinking tasks. Definitions differ; a 2023 Google DeepMind framework marked the level matching many definitions as not yet achieved.
- Symbolic AI4 minSymbolic AI writes knowledge down as readable symbols and if-then rules, then reaches answers by applying logic and search to them.
- Expert systems5 minAn expert system stores a specialist's know-how as if-then rules and uses a separate inference engine to apply those rules to a new case and explain its advice.
- Turing test5 minThe Turing test asks whether a judge, chatting by text with a hidden person and a hidden machine, can reliably tell which one is the machine.
How a model learns9 lessons · 39 min0 lessons · 0 min
You can describe how training data turns into a model, and what happens when it answers.
- Training5 minTraining is the repeated loop that nudges a model's internal numbers so its predictions get closer to the right answers in its examples.
- Training data5 minTraining data is the set of examples a machine learning model studies to learn its patterns, kept apart from the examples used to test it.
- Inference5 minInference is using a trained AI model on new input to get an answer, such as a label, a number or a written reply, without changing what the model learned.
- Parameters3 minParameters are the model values that training can change to improve how inputs map to outputs.
- Weights3 minTrainable weights are model parameters that can be learned from data.
- Features5 minFeatures are the input facts a machine learning model reads about each example, such as a car's mileage or colour, turned into a list of numbers.
- Labels5 minA label is the answer attached to a training example, such as a category, a number or a ranking, that a supervised model learns to predict.
- Ground truth5 minGround truth is the best available account of what really happened, the reality that a model's predictions are checked against.
- Data labeling3 minData labeling attaches the answer a supervised model should learn to raw examples such as images, text, audio or table rows.
Preparing data4 lessons · 16 min5 lessons · 21 min
You can clean, encode and balance data without leaking the answers.
- Feature engineering4 minFeature engineering turns raw data, like prices and colour names, into the lists of numbers a model can learn from.
- One-hot encoding4 minOne-hot encoding turns a category, such as a colour or a type of transport, into a list of 0s with a single 1 marking which category it is.
- Outliers4 minAn outlier is a data point that sits an unusually long way from the rest. It may be a mistake to fix or a rare real event worth keeping.
- Data augmentation4 minData augmentation makes extra training examples by changing existing ones in small ways that keep the answer the same, such as flipping or cropping a photo.
- Missing data5 minMissing data are empty cells in a dataset. You can drop them, fill them with reasoned guesses or use a model that accepts gaps, and why they are missing decides which is safe.
- Imbalanced data4 minImbalanced data is a dataset where one class is far rarer than another, such as a few fraud cases among many ordinary card payments.
- Synthetic data4 minSynthetic data is artificial data built from seed data so some patterns of that seed can be reused.
- Data leakage4 minData leakage is when a model learns from information it will not have when making real predictions, so its test score looks better than it really is.
- Feature importance4 minFeature importance gives each input column a score for how much a trained model relies on it, so you can see what drives its predictions.
The math models run on11 lessons · 40 min2 lessons · 8 min
You can work with vectors and probabilities, and explain how a loss and gradients improve a model.
- Vectors4 minA vector is an ordered list of numbers that you can also picture as an arrow in space. Machine learning stores examples, words and images this way.
- Matrices4 minA matrix is a rectangular grid of numbers with a fixed number of rows and columns. Machine learning keeps data and layer weights in matrices and multiplies them.
- Dot product4 minThe dot product multiplies two equal-length lists of numbers position by position and adds the results into one number set by the angle between them and their lengths.
- Cosine similarity4 minCosine similarity scores how closely two vectors point the same way, ignoring how long they are. The score runs from −1 to 1.
- Embeddings3 minAn embedding maps a discrete item such as a token ID to a dense vector of numbers.
- Linear algebra for ML4 minThe small part of linear algebra that models use every day, vectors, matrices, their products and their sizes, to hold data, run layers and learn.
- Probability4 minA probability is a number from 0 to 1 that says how likely something is. Many machine learning problems need one as the answer.
- Statistics for ML4 minStatistics describes data and measures how far to trust a model's score, since every test set is only a sample of the cases the model will meet.
- Softmax3 minSoftmax determines a probability for each possible class, and those probabilities add up to exactly 1.
- Loss function3 minA loss function turns the difference between a model's prediction and its target into a number that training tries to reduce.
- Stochastic gradient descent3 minStochastic gradient descent steps the weights using a slope estimated from one randomly picked example.
- Bayesian inference5 minBayesian inference treats an unknown number as uncertain, starts from a belief about it, and uses Bayes' theorem to update that belief as data arrives.
- Gradient descent3 minGradient descent repeatedly measures how loss changes with each parameter and moves the parameters a small step toward lower loss.
Ways machines learn5 lessons · 22 min5 lessons · 18 min
You can tell supervised, unsupervised, self-supervised and reinforcement learning apart.
- Supervised learning4 minSupervised learning trains a model on examples that already carry the right answer, called a label, so it can predict that answer for new examples that do not.
- Unsupervised learning5 minUnsupervised learning trains a model on examples that have no answers attached, so it finds structure on its own, such as groups of similar items or points that do not fit.
- Reinforcement learning5 minReinforcement learning trains a program, called an agent, to choose actions by trial and error, guided by a number called a reward that says how well it is doing.
- Self-supervised learning5 minSelf-supervised learning trains a model on raw data by hiding part of each example and asking the model to predict it, so the data supplies its own labels.
- Few-shot learning3 minFew-shot learning is the ability to perform a task from only a small number of labelled examples.
- Semi-supervised learning5 minSemi-supervised learning trains a model on a few labelled examples plus many unlabelled ones, so the unlabelled data can help when answers are scarce.
- Transfer learning3 minTransfer learning reuses representations learned on a source task to improve learning on a different target task.
- Continual learning4 minContinual learning trains a model on a stream of changing data while measuring whether later learning damages or helps earlier tasks.
- Q-learning3 minQ-learning improves an estimate of each state-action value from sampled rewards and the best estimated value at the next state.
- Multi-armed bandits3 minA multi-armed bandit applies an action, observes its reward, then continues the process with another action.
Classic models6 lessons · 24 min5 lessons · 21 min
You can pick a classic model, such as a regression, a tree ensemble or an SVM, for a table of data.
- Regression3 minRegression predicts a number, such as a house price, a tree's life span or a rainfall total, from an example's features.
- Linear regression5 minLinear regression predicts a number by multiplying each feature by a learned weight, adding the results and adding a bias.
- Logistic regression4 minLogistic regression weighs and adds up an example's features, squeezes the total into a probability between 0 and 1, and uses a threshold to pick a class.
- K-nearest neighbors4 mink-nearest neighbours labels a new example by finding the k most similar stored examples and taking their majority vote, or their average for numbers.
- Naive Bayes4 minNaive Bayes sorts things into classes by multiplying how common each class is by how likely each feature is in that class, then picking the top score.
- Ensemble learning4 minEnsemble learning combines the predictions of several models, usually by a vote or an average, so that their separate mistakes partly cancel out.
- Support vector machines5 minA support vector machine separates two classes with the boundary that leaves the widest possible gap to the nearest training points of each class.
- Gradient boosting4 minGradient boosting builds one strong model from many small decision trees, added one at a time, each trained to fix the errors the trees before it still make.
- Genetic algorithms4 minA genetic algorithm searches for good answers the way breeding does. It keeps a population of candidates, mixes the fitter ones and repeats over many generations.
- Hidden Markov models4 minA hidden Markov model infers a sequence of states you cannot see from a sequence of observations you can, using the odds of each state following another and of each state producing each observation.
- Monte Carlo methods4 minMonte Carlo methods estimate a number by running many random simulations and averaging what comes out, instead of working the answer out exactly.
Finding patterns without labels3 lessons · 12 min4 lessons · 17 min
You can group, compress, recommend and forecast with data that has no labels.
- Clustering4 minClustering sorts data that has no labels into groups of items that resemble each other.
- K-means clustering4 minK-means splits unlabelled data into k groups by putting each point with its nearest centre, then moving each centre to the average of its group, over and over.
- Recommender systems4 minA recommender system picks the few items, out of a catalogue too big to browse, that each person sees first, by predicting what that person is likely to want.
- Anomaly detection4 minAnomaly detection finds the few items or events that do not fit the usual pattern in data, such as a fraudulent card payment or an odd burst of network traffic.
- Principal component analysis4 minPCA finds the directions in which data spreads out most, then keeps only the first few, so many features become a few new ones.
- Collaborative filtering4 minCollaborative filtering recommends items by learning from what many people rated, clicked or watched, then predicting the gaps in your own history.
- Time series forecasting5 minTime series forecasting predicts future values of something measured over time, such as sales or electricity demand, from the patterns in its past.
Train, tune and score a model12 lessons · 48 min3 lessons · 12 min
You can split data, choose training settings, spot overfitting and read a classifier's scores.
- Overfitting3 minOverfitting happens when a model learns its training examples so specifically that it performs poorly on new examples.
- Validation set3 minA validation set is held-out data used during development to compare model choices without training on the same examples.
- Test set3 minA test set is a reserved group of labeled examples used for a final check of a model on data it did not train on.
- Epoch4 minAn epoch is one complete pass through every example used to train a model.
- Batch size3 minBatch size is how many training examples are grouped before the weights change once.
- Learning rate3 minThe learning rate multiplies a gradient, and that product is how far the weight moves.
- Hyperparameters5 minHyperparameters are the settings people choose to control training, such as the learning rate, rather than values the model learns itself.
- Underfitting5 minUnderfitting is when a model is too simple, or trained too little, to learn the real pattern, so it does badly even on its own training data.
- Regularization5 minRegularization is any change to training that limits how closely a model can fit its training examples, so it does better on new data.
- Accuracy4 minAccuracy is the share of a model's predictions that were right, the correct answers divided by all answers.
- Precision and recall5 minPrecision asks how many of the things a model flagged were right. Recall asks how many of the real cases it managed to find.
- Confusion matrix5 minA confusion matrix is a table that counts a classifier's predictions by what it predicted and what was really true, so you see which mistakes it makes.
- Bias–variance tradeoff4 minBias is average error across training sets, while variance indicates sensitivity to varying training sets.
- F1 score4 minThe F1 score rolls a classifier's precision and recall into one number from 0 to 1, and it stays low if either of them is low.
- ROC curve4 minAn ROC curve shows, for every threshold a classifier could use, how many real positives it catches against how many false alarms it raises.
What you'll be able to do
- Explain what AI, machine learning, deep learning and generative AI are, and how the idea grew.
- Describe how training data turns into a model, and what happens when it answers.
- Clean, encode and balance data without leaking the answers.
- Work with vectors and probabilities, and explain how a loss and gradients improve a model.
- Tell supervised, unsupervised, self-supervised and reinforcement learning apart.
- Pick a classic model, such as a regression, a tree ensemble or an SVM, for a table of data.
- Group, compress, recommend and forecast with data that has no labels.
- Split data, choose training settings, spot overfitting and read a classifier's scores.
Deep learning
Neural networks, the main network designs, and models that generate images, sound and video.
Neural networks5 lessons · 17 min4 lessons · 14 min
You can explain neurons, layers, activations and backpropagation in plain words.
- Neural networks4 minA neural network is a model built from layers of simple units that each weigh their inputs, add them up and bend the result, so that together they can learn curved, complex patterns.
- Perceptron3 minA perceptron is a linear classifier.
- Multilayer perceptron3 minA multilayer perceptron can fit a nonlinear model to training data.
- Activation function4 minAn activation function is the non-linear step a neuron applies to its weighted sum, so a network of layers can learn curved patterns, not only straight lines.
- ReLU3 minReLU is an activation function that replaces every negative input with zero and leaves every positive input unchanged.
- Backpropagation4 minBackpropagation computes each parameter's gradient by applying the chain rule from the last layer back to the first.
- Dropout3 minDuring training, dropout randomly replaces some input tensor elements with zero.
- Residual connections4 minA residual connection combines a residual mapping F(x) with the block input x as F(x) + x.
- Layer normalization3 minLayer normalization normalizes selected activations independently for each example in a batch.
Network designs2 lessons · 6 min7 lessons · 22 min
You can say what CNNs, RNNs, autoencoders and graph networks are each built for.
- Convolutional neural networks3 minA convolutional neural network uses sparse convolutions that reuse the same weights at multiple locations in an ordered grid.
- Vision transformers3 minA vision transformer represents an image as a sequence of patches and processes that sequence with a transformer.
- Recurrent neural networks3 minAt each time step, a recurrent neural network updates its hidden state from the previous hidden state and the current input.
- LSTM3 minAn LSTM is a recurrent unit whose multiplicative gates regulate access to its memory path.
- GRU3 minA GRU is a recurrent unit with reset and update gates.
- Residual networks3 minA residual block adds a learned residual function F(x) to a shortcut carrying the block input x.
- U-Net4 minU-Net combines upsampled decoder features with matching high-resolution features from a contracting path.
- Autoencoders3 minAn autoencoder learns an encoder that maps an input to a code and a decoder that reconstructs the input from that code.
- Graph neural networks3 minA graph neural network updates each node's hidden state based on messages.
Generating images, sound and video3 lessons · 9 min7 lessons · 23 min
You can explain how diffusion and other generative models turn a prompt into media.
- Text-to-image models3 minA text-to-image model can use text as a conditioning input to an image generator.
- Text-to-speech models3 minA text-to-speech model synthesizes speech directly from text.
- Speech-to-text models3 minA speech-to-text model can transcribe a speech utterance into written characters.
- Diffusion models3 minA diffusion model learns to reverse a process that gradually adds noise to data.
- GANs3 minA GAN trains a generator to make samples and a discriminator to distinguish generated samples from training data.
- Image editing models4 minAn image editing model changes a picture you already have.
- Text-to-video models3 minGiven a text prompt, a text-to-video model generates a video.
- Music generation models3 minA music generation model can generate music in the raw-audio domain.
- Variational autoencoders4 minA variational autoencoder pairs a deep latent-variable model with a corresponding approximate inference model.
- Neural radiance fields3 minA neural radiance field maps a 3D position and viewing direction to density and view-dependent color.
What you'll be able to do
- Explain neurons, layers, activations and backpropagation in plain words.
- Say what CNNs, RNNs, autoencoders and graph networks are each built for.
- Explain how diffusion and other generative models turn a prompt into media.
Large language models
How language models read, write and get trained, and the kinds of model you will meet.
Tokens and context6 lessons · 18 min3 lessons · 12 min
You can predict what fits in a model's context and why long inputs cost more.
- Tokens3 minTokens are chunks of text processed by text-generation and embedding models.
- Tokenization3 minTokenization turns text into a sequence of vocabulary IDs that a model can process, then reverses generated IDs back into readable text.
- Vocabulary3 minA model vocabulary supplies the mapping used to convert text into an ID sequence and back.
- Context window3 minA context window is all the text a language model can reference while generating a response, including the response itself.
- Max tokens3 minMax tokens sets an upper bound on how many tokens a model may generate for one response.
- Knowledge cutoff3 minA knowledge cutoff is the latest period a model can reliably know from its training alone.
- Byte-pair encoding3 minByte-pair encoding builds a subword vocabulary by repeatedly merging the most frequent adjacent symbol pair.
- Long context4 minTransformer-XL reuses hidden states from previous segments instead of computing them from scratch for each new segment.
- Lost in the middle5 minLanguage models often use facts near the opening or closing of a long input better than facts buried in the middle.
How an LLM writes7 lessons · 21 min6 lessons · 18 min
You can explain next-token prediction and how temperature and sampling change the output.
- LLM3 minAn LLM predicts a token or sequence of tokens, sometimes many paragraphs long.
- Next-token prediction3 minNext-token prediction estimates which token should follow the tokens already present in a sequence.
- Logits3 minLogits are a model's raw, unnormalized prediction scores.
- Greedy decoding3 minGreedy decoding generates a sequence by choosing the most likely next token at every step.
- Top-k sampling3 minTop-k sampling keeps the k highest-probability next-token candidates, rescales their probabilities and samples one of them.
- Stop sequences3 minA stop sequence is a configured character string that stops output generation.
- Summarization3 minSummarization is when a model turns a long text into a shorter version that keeps the important information.
- Autoregressive models3 minAn autoregressive model factorizes a sequence probability into conditional probabilities.
- Temperature3 minTemperature enters softmax by dividing each logit by T.
- Top-p sampling3 minTop-p keeps the smallest set of most probable tokens whose probabilities add up to at least p.
- Beam search3 minBeam search keeps a fixed number of high-scoring partial sequences, expands them, and retains the best candidates at each step.
- Test-time compute3 minTest-time compute lets a language model improve its output by using more computation at test time.
- Emergent abilities3 minEmergent abilities are task capabilities that appear absent in smaller models but present at a larger scale.
Inside a transformer7 lessons · 21 min3 lessons · 9 min
You can sketch the parts of a transformer and say what each one contributes.
- Transformers3 minA transformer is a neural network that uses attention to decide which parts of a sequence matter to one another.
- Attention3 minAttention lets a model build an output by assigning weights to available pieces of information and mixing their values.
- Self-attention3 minSelf-attention updates each position by comparing it with positions in the same sequence and mixing their information.
- Embedding layer3 minAn embedding layer turns integer indexes into dense vectors of fixed size.
- Decoder-only models3 minA decoder-only model predicts each next token from the tokens that came before it.
- Encoder-only models3 minAn encoder-only model uses bidirectional self-attention to represent a supplied sequence.
- Encoder-decoder3 minAn encoder-decoder model combines an encoder with an autoregressive decoder for sequence generation.
- Multi-head attention3 minMulti-head attention consists of several attention layers running in parallel.
- Positional encoding3 minPositional encoding adds token-order information to representations before attention reads them.
- Rotary position embeddings3 minRoPE encodes absolute position with a rotation matrix and adds explicit relative-position dependence to self-attention.
Efficient model designs1 lessons · 3 min7 lessons · 24 min
You can explain how mixture of experts, sparse attention and state space models save compute.
- Mixture of experts3 minA mixture-of-experts layer uses a learned gate to select a sparse combination of expert subnetworks for each input.
- Grouped-query attention3 minGrouped-query attention lets each group of query heads share one key head and one value head.
- Sparse attention3 minSparse attention computes selected query-key connections instead of filling the entire attention matrix.
- Sparsity4 minSparsity means that many possible model values or computation paths are zero, absent, or inactive for a given input.
- FlashAttention3 minFlashAttention computes exact attention with tiling that reduces reads and writes between GPU memory levels.
- Linear attention3 minLinear attention rewrites attention with feature maps so key-value summaries are formed before they are combined with queries.
- State space models4 minA continuous-time linear state space model uses x-dot = Ax + Bu for state evolution and y = Cx + Du for readout.
- Mamba4 minMamba is a sequence architecture whose state space parameters depend on the input, letting each token control what information is kept or forgotten.
Kinds of language model8 lessons · 24 min3 lessons · 10 min
You can tell base, instruct, reasoning, open-weight and frontier models apart.
- Foundation models3 minA foundation model is trained on broad data and can be adapted for many downstream tasks.
- Base models3 minA base language model is a pretrained model before further instruction or conversational fine-tuning.
- Instruct models3 minAn instruct model is a pretrained base version further fine-tuned on instructions and conversational data.
- Open-weight models3 minAn open-weight model makes its trained weights publicly available for download.
- Closed models3 minA fully closed model keeps its weights and code proprietary for internal use.
- Small language models3 minSmall-model research includes sub-billion-parameter language models for mobile deployment.
- Code models3 minCode Llama is a family of language models for code with infilling and instruction-following capabilities.
- Agentic models3 minAn agent plans, acts, observes the result, adjusts its approach, and repeats until the task is complete.
- Frontier models3 minFrontier models are highly capable general-purpose AI models at or beyond the capabilities of the most advanced current models.
- Reasoning models4 minReasoning models use intermediate reasoning tokens before producing a final response.
- Chat templates3 minA chat template converts a structured list of messages into a formatted sequence.
Multimodal and embodied models1 lessons · 4 min5 lessons · 20 min
You can explain how one model reads images, audio and text, and how models learn to act in the world.
- Multimodal models4 minA multimodal model can process more than one type of input, such as text, images, audio or video.
- Vision-language models4 minA vision-language model can take visual data and text as input and produce text as output.
- Omni models4 minAn omni model processes several input and output modalities within one multimodal model rather than routing everything through a text-only core.
- World models4 minA world model predicts how an environment may change after an action, so an agent can evaluate possible futures before acting.
- Robotics foundation models4 minA robotics foundation model is pretrained across many tasks, environments or robot bodies so it can serve as a starting point for new robot policies.
- Vision-language-action models4 minA vision-language-action model maps visual observations and a language instruction to robot actions.
Training, alignment and fine-tuning3 lessons · 10 min10 lessons · 42 min
You can explain how a model becomes an assistant, and how fine-tuning adapts it to your data.
- Pretraining3 minIn one transfer-learning setup, a model is pretrained on a data-rich task before fine-tuning on a downstream task.
- Fine-tuning4 minFine-tuning takes a model that is already trained and keeps training it on a smaller set of examples for one task.
- Instruction following3 minInstruction following is how well a model does what a written request asks, meeting each rule it sets, such as rules on content, style, format or numbers.
- Instruction tuning3 minInstruction tuning fine-tunes a pretrained model on many tasks written as instructions paired with desired responses.
- Supervised fine-tuning4 minSupervised fine-tuning keeps training an already-trained model on example questions paired with good answers, so it learns to answer that way.
- Constitutional AI4 minConstitutional AI trains and evaluates model behavior against an explicit written set of principles.
- Parameter-efficient fine-tuning4 minPEFT adapts a pretrained model by training a small set of added or selected parameters while keeping most base weights frozen.
- LoRA5 minLoRA adapts a large model to a new task by freezing its weights and training two thin matrices whose product is added to them.
- QLoRA5 minQLoRA fine-tunes a large language model by storing its frozen weights in 4 bits and training only a small add-on that sits beside them.
- Distillation5 minDistillation trains a small student model to copy the full answer probabilities of a large teacher model, so you can run something smaller and cheaper.
- RLHF4 minRLHF uses human comparisons to learn a reward signal, then optimizes a model to produce responses that score better under that signal.
- RLAIF4 minRLAIF runs the usual RLHF training loop, but another AI model supplies some of the preference labels that people would normally give.
- DPO4 minDPO teaches a language model to prefer the better of two answers by learning from the comparison itself, with no separate reward model trained first.
What you'll be able to do
- Predict what fits in a model's context and why long inputs cost more.
- Explain next-token prediction and how temperature and sampling change the output.
- Sketch the parts of a transformer and say what each one contributes.
- Explain how mixture of experts, sparse attention and state space models save compute.
- Tell base, instruct, reasoning, open-weight and frontier models apart.
- Explain how one model reads images, audio and text, and how models learn to act in the world.
- Explain how a model becomes an assistant, and how fine-tuning adapts it to your data.
Building apps and agents
Prompts, tools, search, retrieval and agents: the parts of a working AI feature.
Prompts, structured outputs and tools4 lessons · 15 min6 lessons · 24 min
You can write reliable prompts, get data your code can parse, and let a model call your functions.
- Prompt engineering4 minPrompt engineering is writing and testing the instructions and examples you give a model so its answer meets a goal you can check.
- System prompt3 minA system prompt is high-priority context that sets an AI assistant's role, boundaries, style, and response rules before the user's request is handled.
- Few-shot prompting3 minFew-shot prompting places a small set of example inputs and outputs in the prompt so the model can imitate the task on a new input.
- Prompt chaining5 minIn prompt chaining, you give a model one small job at a time in a set order, and each answer becomes the starting material for the next job.
- Chain of thought4 minChain-of-thought prompting asks for or demonstrates intermediate reasoning text before a final answer, but that text is not a guaranteed view of hidden model internals.
- Structured outputs3 minStructured outputs constrain a model response to a declared schema so software receives expected fields and types instead of free-form prose.
- JSON mode4 minJSON mode is an API setting that asks a language model to reply in JSON, text a program can parse (read into data), and on some providers, such as OpenAI, enforces valid syntax, without fixing which keys or types appear.
- Function calling4 minFunction calling lets a model request a named function by returning structured arguments that an application, or the provider, then runs.
- Tool use5 minTool use is a loop where a model proposes a call, a program outside the model runs it, and the result is written back.
- Code interpreters4 minA code interpreter lets an AI model write a small program, run it in a sealed-off sandbox, and use the result in its answer.
Searching your data3 lessons · 9 min6 lessons · 24 min
You can turn documents into embeddings and find the most relevant passages fast.
- Semantic search3 minSemantic search finds text by meaning, so a passage can match a question even when the two share no words.
- Embedding models3 minAn embedding model maps an input to a numeric vector whose distance from another vector can measure relatedness.
- Reranker models3 minA reranker sorts existing text candidates by semantic relevance to a specified query.
- Vector databases4 minA vector database stores vectors and returns the saved records closest to a query vector, often with a score and any extra fields you ask for.
- Hybrid search4 minHybrid search runs a keyword ranker and a vector ranker on one query, then merges the two lists into a single order.
- Reranking4 minReranking takes the short list a first search returned and scores each item again with a slower, more careful model.
- Approximate nearest neighbor search4 minApproximate nearest neighbor search finds stored vectors that are very close to a query quickly, by checking only a promising part of the collection and accepting a few misses.
- HNSW4 minHNSW finds the stored vectors closest to a query quickly by searching a stack of linked graphs, from a sparse top layer down to a dense bottom one.
- Metadata filtering4 minMetadata filtering limits a vector search to records whose labels, such as category or year, match rules you set.
Retrieval-augmented generation (RAG)3 lessons · 10 min4 lessons · 17 min
You can ground a model's answers in your own documents, with sources.
- RAG4 minRAG lets an AI model look up relevant documents first, then answer from what it found.
- Chunking3 minChunking splits a long document into smaller pieces that can be embedded, searched, or fitted into a model prompt.
- Grounding3 minGrounding gives a model relevant source material and asks it to base its response on that evidence.
- Knowledge graphs4 minA knowledge graph stores facts as labelled links between real-world things, so software can follow the links to answer questions.
- HyDE4 minHyDE has a language model write a made-up answer to your question, then searches for real documents that look like that answer.
- Contextual retrieval5 minContextual retrieval has a model write a short note that places each chunk in its document, then indexes the note with the chunk so search can find it.
- GraphRAG4 minGraphRAG turns your documents into a map of people, places and links, groups and summarises it, then answers questions from that map.
Agents, context and memory3 lessons · 12 min9 lessons · 40 min
You can build an agent loop and decide what goes into its context and memory.
- AI agents4 minAn AI agent is a language model that chooses its own next steps and tools while it works through a task.
- Self-reflection3 minSelf-reflection is when an AI model checks its own first answer, writes feedback on it, and then tries again using that feedback.
- Voice agents5 minA voice agent is an AI app you talk to out loud; it listens, works out what you want, can use tools, and answers in speech.
- ReAct5 minReAct is a prompting method in which a language model alternates written thoughts with tool actions, reading each result before it picks the next step.
- Agentic workflows4 minAn agentic workflow runs a task as several language model and tool steps, joined by a path that your code fixes in advance.
- Human in the loop5 minWith this setup, a person checks an AI system's work at chosen points and can approve it, change it, reject it or step in.
- Computer-use models4 minA computer-use model reads a screen and emits mouse or keyboard actions that an application can execute.
- Context engineering4 minContext engineering is choosing, trimming and updating the tokens a model sees at each step, so an AI agent works from a small, useful context.
- Agent memory5 minAgent memory is how an AI agent saves useful information outside the model and loads the right pieces back into its prompt later.
- Agent state5 minAgent state is the running record an AI agent keeps while it works, so a task can pause, resume, or recover from a crash.
- Context compaction4 minContext compaction swaps the older part of a long AI conversation for a short summary, so the chat can keep going inside the model's memory limit.
- Agent planning4 minAgent planning is how an AI agent splits a big task into smaller steps first, then carries out those steps one by one.
Multi-agent systems and protocols1 lessons · 5 min5 lessons · 19 min
You can split work across agents and connect them to tools with MCP and A2A, safely.
- Multi-agent systems5 minA multi-agent system is a group of AI agents, each a language model using tools in its own loop, that work together on one job.
- Sub-agents3 minA sub-agent is a helper AI that a main agent sends off to do one side task in its own workspace, then report back a short result.
- Agent orchestration4 minAgent orchestration is how an app with several AI agents decides which agent works, in what order, and who picks what happens next.
- MCP4 minMCP standardizes how AI applications connect to external context and tools.
- A2A protocol4 minA2A is an open protocol for AI agents: one agent can find another, hand it a task and track the result, even when different companies built them.
- Sandboxing agents4 minSandboxing an agent means running its commands inside a fence, set up by the operating system, that limits which files and websites they can reach.
What you'll be able to do
- Write reliable prompts, get data your code can parse, and let a model call your functions.
- Turn documents into embeddings and find the most relevant passages fast.
- Ground a model's answers in your own documents, with sources.
- Build an agent loop and decide what goes into its context and memory.
- Split work across agents and connect them to tools with MCP and A2A, safely.
Production, evals and safety
Measuring quality, serving models fast and cheaply, and keeping them reliable and secure.
Evals and benchmarks2 lessons · 8 min10 lessons · 35 min
You can test whether your AI system got better, and read a leaderboard critically.
- Evals5 minAn eval checks an AI system's work. You feed it an input and use a set of rules to score what comes back.
- Benchmarks3 minA benchmark is a fixed set of test tasks with a scoring rule, so different AI models can be compared on the same exam.
- LLM evaluation5 minLLM evaluation means testing an AI feature with structured tests, so you can check how accurate and reliable it is even though its answers vary.
- LLM-as-a-judge3 minLLM-as-a-judge means asking a strong language model to grade answers to open-ended questions.
- Agent evaluation4 minAgent evaluation tests an AI agent on set tasks, checking both its final result and the steps it took, over several tries.
- Perplexity (metric)4 minPerplexity is the exponentiated average negative log-likelihood that a language model assigns to a token sequence.
- MMLU3 minMMLU is a 57-task test of a text model's multitask accuracy.
- GPQA3 minGPQA is a 448-question multiple-choice benchmark written by experts in biology, physics and chemistry.
- HumanEval3 minHumanEval measures functional correctness for programs synthesized from docstrings.
- SWE-bench3 minSWE-bench asks a system to generate a repository patch for a real GitHub issue.
- ARC-AGI3 minARC-AGI presents demonstration grid pairs to a system, then asks it to construct outputs for new test grids.
- Benchmark contamination4 minBenchmark contamination happens when test questions, or close copies of them, end up in a model's training data, so its score can look better than its real skill.
Serving models3 lessons · 12 min5 lessons · 18 min
You can run a model behind an API or on a device, and explain what makes inference fast.
- Model serving5 minModel serving means running a trained model on a server so apps can send it requests over the network and get answers back.
- On-device AI4 minOn-device AI runs the model on your own phone, laptop or browser, so your data does not have to go to a server.
- Batch inference3 minBatch inference sends many AI requests as one job that runs in the background, trading an instant reply for a lower price.
- Self-hosting LLMs4 minSelf-hosting means running a language model on a computer you control, so your prompts go to your own machine instead of a company's service.
- Inference optimization3 minInference optimization is a set of methods, like caching, quantization and speculative decoding, that let a trained language model answer with less work or less memory.
- KV cache3 minA KV cache lets a language model save work from earlier tokens, so each new token does not redo the same maths.
- Quantization4 minQuantization stores a model's numbers with fewer bits, such as 8-bit integers instead of 32-bit decimals, so it needs less memory.
- Speculative decoding4 minSpeculative decoding uses a target model to evaluate guesses in parallel.
Speed and cost4 lessons · 14 min4 lessons · 16 min
You can measure latency and cost, and know which levers make a model faster and cheaper.
- Latency3 minRequest latency is the elapsed time between sending an inference request and receiving its final response.
- Throughput3 minThroughput is the amount of completed inference work divided by the time spent measuring it.
- Token costs4 minAI model APIs charge by the token, with separate prices for the text you send in and the text the model writes back.
- Rate limits4 minA rate limit caps how much you can use an AI service in a set stretch of time, such as how many requests you send each minute.
- Tokens per second3 minTokens per second reports how many tokens a server returns in a set amount of time.
- Prompt caching4 minPrompt caching saves the work a model did on the unchanged start of a prompt, so the next request with the same start is faster and cheaper.
- Model routing4 minModel routing sends each prompt to the model that suits it, so simple requests go to cheaper models and hard ones to stronger models.
- LLM gateways5 minAn LLM gateway is one server that sits between your apps and AI model providers, adding limits, caching, fallbacks and logs to model calls.
Hardware and training at scale6 lessons · 30 min4 lessons · 15 min
You can tell the main AI chips apart and explain how compute sets the size of a model.
- GPUs5 minA GPU is a chip built to run many similar calculations at the same time, which suits the matrix maths inside neural networks.
- CPUs5 minA CPU is the chip that runs a computer's software, carrying out instructions with just a few cores backed by lots of cache memory.
- TPUs5 minTPUs are chips Google designed to speed up the maths of machine learning, rented out through Google Cloud.
- NPUs5 minAn NPU is a part of a chip built to speed up AI models at low power.
- AI accelerators5 minAI accelerators are chips built to speed up the maths inside AI models, which is largely multiply-add sums.
- FLOPs5 minFLOPs count the small arithmetic steps, like one multiply or one add on decimal numbers, that a computer does to train an AI model.
- Chinchilla scaling3 minChinchilla scaling allocates a fixed training-compute budget by growing model parameters and training tokens in roughly equal proportions.
- Data parallelism4 minData parallelism runs replicas of one model on different slices of a batch, then combines their gradients before a synchronized update.
- Mixed precision4 minMixed precision trains with both 16-bit and 32-bit numbers so the run is faster and uses less memory.
- Gradient checkpointing4 minGradient checkpointing stores fewer activations by recomputing them when needed, exchanging extra computation for lower memory use.
Reliability and monitoring2 lessons · 6 min3 lessons · 14 min
You can catch unreliable answers and monitor a live AI system.
- Hallucination3 minA hallucination is generated content that sounds plausible but is false, unsupported by evidence, or inconsistent with the given input.
- Sycophancy3 minSycophancy is when an assistant favors matching a user's beliefs over a truthful response.
- MLOps5 minMLOps is a way of working that makes building and releasing machine learning models simpler and more automatic.
- LLMOps5 minThe day-to-day work of running an app built on a language model, from managing prompts and testing answers to watching speed and cost.
- LLM observability4 minLLM observability means recording what an AI app does on each request, such as the prompt, each step, the time taken and the tokens used.
Security5 lessons · 23 min1 lessons · 4 min
You can defend an AI system against prompt injection and jailbreaks, and protect user data.
- Prompt injection5 minPrompt injection is text that sneaks new instructions into what an AI model reads, so the model behaves in unintended ways.
- Jailbreaks4 minA jailbreak is a prompt written to trick an AI model into ignoring its safety training and producing something it would normally refuse.
- Guardrails5 minGuardrails are checks placed around an AI model that inspect what goes in and what comes out, and can block, change or check inputs and replies that are unsafe, off-topic or break the app's rules.
- Data privacy5 minData privacy is about what an AI company may do with your chats, such as training models, and the settings that let you limit it.
- Indirect prompt injection4 minIndirect prompt injection is when an attacker hides instructions in content an AI app reads later, such as an email or web page, instead of typing them in.
- Red teaming4 minRed teaming means deliberately testing an AI system the way an attacker would, to find its weak spots.
What you'll be able to do
- Test whether your AI system got better, and read a leaderboard critically.
- Run a model behind an API or on a device, and explain what makes inference fast.
- Measure latency and cost, and know which levers make a model faster and cheaper.
- Tell the main AI chips apart and explain how compute sets the size of a model.
- Catch unreliable answers and monitor a live AI system.
- Defend an AI system against prompt injection and jailbreaks, and protect user data.
Tools and products
Look them up when you need them; they are not steps on the path.
Coding tools3
App frameworks11
LangChainLlamaIndexHaystackVercel AI SDKSemantic KernelMastraPydantic AIDSPyOpen WebUIComfyUIPyTorch
Agent frameworks11
LangGraphOpenAI Agents SDKClaude Agent SDKGoogle ADKCrewAIAutoGenSmolagentsStrands AgentsAgnoAmazon Bedrock AgentCoreAgent Substrate
Model hubs and runtimes8
Hugging FaceHugging Face TransformersPEFTUnslothOllamallama.cppvLLMSGLang
Cloud platforms and chips7
Amazon BedrockAzure OpenAIVertex AIMicrosoft FoundryAmazon SageMaker AIAWS InferentiaAWS Trainium