Learn AI, five minutes at a time.

Free, sourced lessons. Start with the basics and build your way up.

Start lesson 1

Free · No sign-up · Every fact sourced

Your first lessonArtificial intelligence5 minExample · Translator “How should this sentence read in another language?” It works with source text and learned language patterns.Start lesson 1
Part 1

Fundamentals

What AI is, how models learn from data, the math underneath, and classic machine learning.

8 chaptersabout 4.1 h6 chaptersabout 1.6 h
  1. 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.

    1. Artificial intelligence5 minAn AI system infers from received inputs how to generate predictions, content, recommendations or decisions for explicit or implicit objectives.
    2. Machine learning5 minMachine learning trains software on data so it can find patterns and make useful predictions or generate content for new inputs.
    3. 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.
    4. Generative AI5 minGenerative AI learns patterns from existing data, then uses those patterns to create new text, images, audio, video, code or other content.
    5. 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.
    6. 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.
    7. 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.
    8. Symbolic AI4 minSymbolic AI writes knowledge down as readable symbols and if-then rules, then reaches answers by applying logic and search to them.
    9. 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.
    10. 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.
  2. How a model learns9 lessons · 39 min0 lessons · 0 min
  3. Preparing data4 lessons · 16 min5 lessons · 21 min
  4. 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.

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. Embeddings3 minAn embedding maps a discrete item such as a token ID to a dense vector of numbers.
    6. 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.
    7. 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.
    8. 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.
    9. Softmax3 minSoftmax determines a probability for each possible class, and those probabilities add up to exactly 1.
    10. Loss function3 minA loss function turns the difference between a model's prediction and its target into a number that training tries to reduce.
    11. Stochastic gradient descent3 minStochastic gradient descent steps the weights using a slope estimated from one randomly picked example.
    12. 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.
    13. Gradient descent3 minGradient descent repeatedly measures how loss changes with each parameter and moves the parameters a small step toward lower loss.
  5. Ways machines learn5 lessons · 22 min5 lessons · 18 min

    You can tell supervised, unsupervised, self-supervised and reinforcement learning apart.

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. Few-shot learning3 minFew-shot learning is the ability to perform a task from only a small number of labelled examples.
    6. 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.
    7. Transfer learning3 minTransfer learning reuses representations learned on a source task to improve learning on a different target task.
    8. Continual learning4 minContinual learning trains a model on a stream of changing data while measuring whether later learning damages or helps earlier tasks.
    9. Q-learning3 minQ-learning improves an estimate of each state-action value from sampled rewards and the best estimated value at the next state.
    10. Multi-armed bandits3 minA multi-armed bandit applies an action, observes its reward, then continues the process with another action.
  6. 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.

    1. Regression3 minRegression predicts a number, such as a house price, a tree's life span or a rainfall total, from an example's features.
    2. Linear regression5 minLinear regression predicts a number by multiplying each feature by a learned weight, adding the results and adding a bias.
    3. 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.
    4. 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.
    5. 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.
    6. 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.
    7. 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.
    8. 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.
    9. 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.
    10. 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.
    11. 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.
  7. Finding patterns without labels3 lessons · 12 min4 lessons · 17 min
  8. 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.

    1. Overfitting3 minOverfitting happens when a model learns its training examples so specifically that it performs poorly on new examples.
    2. Validation set3 minA validation set is held-out data used during development to compare model choices without training on the same examples.
    3. 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.
    4. Epoch4 minAn epoch is one complete pass through every example used to train a model.
    5. Batch size3 minBatch size is how many training examples are grouped before the weights change once.
    6. Learning rate3 minThe learning rate multiplies a gradient, and that product is how far the weight moves.
    7. Hyperparameters5 minHyperparameters are the settings people choose to control training, such as the learning rate, rather than values the model learns itself.
    8. 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.
    9. 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.
    10. Accuracy4 minAccuracy is the share of a model's predictions that were right, the correct answers divided by all answers.
    11. 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.
    12. 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.
    13. Bias–variance tradeoff4 minBias is average error across training sets, while variance indicates sensitivity to varying training sets.
    14. 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.
    15. 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.
Keep goingPart 2: Deep learningNeural networks, the main network designs, and models that generate images, sound and video.
Part 2

Deep learning

Neural networks, the main network designs, and models that generate images, sound and video.

3 chapters32 min3 chapters59 min
  1. Neural networks5 lessons · 17 min4 lessons · 14 min
  2. Network designs2 lessons · 6 min7 lessons · 22 min
  3. Generating images, sound and video3 lessons · 9 min7 lessons · 23 min

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.
Keep goingPart 3: Large language modelsHow language models read, write and get trained, and the kinds of model you will meet.
Part 3

Large language models

How language models read, write and get trained, and the kinds of model you will meet.

7 chaptersabout 1.7 h7 chaptersabout 2.3 h
  1. Tokens and context6 lessons · 18 min3 lessons · 12 min
  2. How an LLM writes7 lessons · 21 min6 lessons · 18 min

    You can explain next-token prediction and how temperature and sampling change the output.

    1. LLM3 minAn LLM predicts a token or sequence of tokens, sometimes many paragraphs long.
    2. Next-token prediction3 minNext-token prediction estimates which token should follow the tokens already present in a sequence.
    3. Logits3 minLogits are a model's raw, unnormalized prediction scores.
    4. Greedy decoding3 minGreedy decoding generates a sequence by choosing the most likely next token at every step.
    5. Top-k sampling3 minTop-k sampling keeps the k highest-probability next-token candidates, rescales their probabilities and samples one of them.
    6. Stop sequences3 minA stop sequence is a configured character string that stops output generation.
    7. Summarization3 minSummarization is when a model turns a long text into a shorter version that keeps the important information.
    8. Autoregressive models3 minAn autoregressive model factorizes a sequence probability into conditional probabilities.
    9. Temperature3 minTemperature enters softmax by dividing each logit by T.
    10. Top-p sampling3 minTop-p keeps the smallest set of most probable tokens whose probabilities add up to at least p.
    11. Beam search3 minBeam search keeps a fixed number of high-scoring partial sequences, expands them, and retains the best candidates at each step.
    12. Test-time compute3 minTest-time compute lets a language model improve its output by using more computation at test time.
    13. Emergent abilities3 minEmergent abilities are task capabilities that appear absent in smaller models but present at a larger scale.
  3. Inside a transformer7 lessons · 21 min3 lessons · 9 min
  4. Efficient model designs1 lessons · 3 min7 lessons · 24 min
  5. Kinds of language model8 lessons · 24 min3 lessons · 10 min
  6. Multimodal and embodied models1 lessons · 4 min5 lessons · 20 min
  7. 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.

    1. Pretraining3 minIn one transfer-learning setup, a model is pretrained on a data-rich task before fine-tuning on a downstream task.
    2. Fine-tuning4 minFine-tuning takes a model that is already trained and keeps training it on a smaller set of examples for one task.
    3. 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.
    4. Instruction tuning3 minInstruction tuning fine-tunes a pretrained model on many tasks written as instructions paired with desired responses.
    5. 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.
    6. Constitutional AI4 minConstitutional AI trains and evaluates model behavior against an explicit written set of principles.
    7. 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.
    8. 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.
    9. 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.
    10. 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.
    11. RLHF4 minRLHF uses human comparisons to learn a reward signal, then optimizes a model to produce responses that score better under that signal.
    12. RLAIF4 minRLAIF runs the usual RLHF training loop, but another AI model supplies some of the preference labels that people would normally give.
    13. 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.
Keep goingPart 4: Building apps and agentsPrompts, tools, search, retrieval and agents: the parts of a working AI feature.
Part 4

Building apps and agents

Prompts, tools, search, retrieval and agents: the parts of a working AI feature.

5 chapters51 min5 chaptersabout 2.1 h
  1. 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.

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. 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.
    6. Structured outputs3 minStructured outputs constrain a model response to a declared schema so software receives expected fields and types instead of free-form prose.
    7. 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.
    8. Function calling4 minFunction calling lets a model request a named function by returning structured arguments that an application, or the provider, then runs.
    9. 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.
    10. 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.
  2. Retrieval-augmented generation (RAG)3 lessons · 10 min4 lessons · 17 min
  3. 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.

    1. AI agents4 minAn AI agent is a language model that chooses its own next steps and tools while it works through a task.
    2. 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.
    3. 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.
    4. 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.
    5. 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.
    6. 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.
    7. Computer-use models4 minA computer-use model reads a screen and emits mouse or keyboard actions that an application can execute.
    8. 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.
    9. 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.
    10. 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.
    11. 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.
    12. 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.
  4. Multi-agent systems and protocols1 lessons · 5 min5 lessons · 19 min

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.
Keep goingPart 5: Production, evals and safetyMeasuring quality, serving models fast and cheaply, and keeping them reliable and secure.
Part 5

Production, evals and safety

Measuring quality, serving models fast and cheaply, and keeping them reliable and secure.

6 chaptersabout 1.6 h6 chaptersabout 1.7 h
  1. Evals and benchmarks2 lessons · 8 min10 lessons · 35 min

    You can test whether your AI system got better, and read a leaderboard critically.

    1. 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.
    2. 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.
    3. 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.
    4. LLM-as-a-judge3 minLLM-as-a-judge means asking a strong language model to grade answers to open-ended questions.
    5. Agent evaluation4 minAgent evaluation tests an AI agent on set tasks, checking both its final result and the steps it took, over several tries.
    6. Perplexity (metric)4 minPerplexity is the exponentiated average negative log-likelihood that a language model assigns to a token sequence.
    7. MMLU3 minMMLU is a 57-task test of a text model's multitask accuracy.
    8. GPQA3 minGPQA is a 448-question multiple-choice benchmark written by experts in biology, physics and chemistry.
    9. HumanEval3 minHumanEval measures functional correctness for programs synthesized from docstrings.
    10. SWE-bench3 minSWE-bench asks a system to generate a repository patch for a real GitHub issue.
    11. ARC-AGI3 minARC-AGI presents demonstration grid pairs to a system, then asks it to construct outputs for new test grids.
    12. 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.
  2. Serving models3 lessons · 12 min5 lessons · 18 min
  3. Speed and cost4 lessons · 14 min4 lessons · 16 min
  4. Hardware and training at scale6 lessons · 30 min4 lessons · 15 min
  5. Reliability and monitoring2 lessons · 6 min3 lessons · 14 min
  6. Security5 lessons · 23 min1 lessons · 4 min

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.
End of the pathLook up tools and productsAssistants, frameworks, runtimes and platforms, for when you need them.
Reference

Tools and products

Look them up when you need them; they are not steps on the path.