Loading

from first concept to confident practice

Large Language Models (LLMs)

Understand how language models learn, generate, and get evaluated.

Start learning 16 lessons · first lesson about 22 min · free · no account needed
About this track

Look inside the models behind today’s AI assistants: how text becomes tokens, how attention and Transformers predict the next one, how models are trained and fine-tuned, how much memory they need, and how decoding settings shape their answers.

Go deeper into how modern models work: rotary positions and long context, mixture-of-experts and vision-language models, chat templates, preference tuning with RLHF and DPO, reasoning models that think before answering, and the serving tricks - batching, quantization, speculative decoding - that make them fast and affordable.

Then put them to work - prompts, context windows, tool use and agents - and learn to evaluate them and keep them safe. You’ll sample tokens with temperature and top-p, compute attention with numpy, fit conversations into a context window, run a bounded agent loop, and finish by building and evaluating a tiny language model of your own.

Before you start
  • No prior machine learning experience needed.
  • Basic Python helps; numpy is introduced where it’s used.
  • A modern browser with JavaScript enabled.
  1. Unit 1 · 0/3 lessons

    LLM foundations

    Tokens and next-token prediction, attention and Transformers, model size and memory. Badge: Context reader

    1. 0x001Understand tokens and next-token predictionSee how text becomes tokens, how a model scores the next token, and how loss and perplexity measure it. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
    2. 0x102Explore Transformers and attentionCompute self-attention by hand, see why LLMs mask the future, and follow a Transformer block. 25 min 0/2 exercises solved 25 min 0/2 exercises solved
    3. 0x203Model size, memory and the KV cacheEstimate how much memory a model needs, why quantization helps, and what the KV cache costs. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
  2. Unit 2 · 0/4 lessons

    Training and using LLMs

    Pretraining and fine-tuning, prompts and context, decoding, tools and agents. Badge: Model guide

    1. 0x304Trace pretraining and model adaptationFollow a model from pretraining on trillions of tokens to instruction tuning, preference tuning and cheap adapters like LoRA. 24 min 0/2 exercises solved 24 min 0/2 exercises solved
    2. 0x405Shape prompts and manage contextWrite clear prompts with roles, examples and output formats, and keep what matters inside the context window. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
    3. 0x506Understand inference and generation controlsTurn logits into choices with temperature, top-k and top-p, and understand latency, cost and streaming. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
    4. 0x607Tool use and agentsLet a model call functions, loop over tool results like an agent, and keep that loop safe. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
  3. Unit 3 · 0/3 lessons

    Inside modern LLMs

    Positions and long context, mixture of experts, multimodal inputs, and chat templates. Badge: Model mechanic

    1. 0x708Positions and long contextFind out how a Transformer knows word order, why RoPE took over, and why a million-token window doesn’t mean a million tokens of attention. 25 min 0/2 exercises solved 25 min 0/2 exercises solved
    2. 0x809Mixture of experts and multimodal modelsSee how a router lets a 47B-parameter model compute like a 13B one, and how a photo turns into a few hundred “words” the model can read. 25 min 0/2 exercises solved 25 min 0/2 exercises solved
    3. 0x9010Chat templates and special tokensLook behind the chat bubbles: a conversation is one long string with secret markers, and getting those markers wrong breaks models - or lets attackers in. 20 min 0/2 exercises solved 20 min 0/2 exercises solved
  4. Unit 4 · 0/3 lessons

    Alignment, reasoning and serving

    Preference tuning, reasoning models and test-time compute, and serving models fast and cheap. Badge: Inference engineer

    1. 0xA011Preference tuning: RLHF, DPO and friendsTeach a model what “better” means from pairs of answers - and watch out for the clever ways it learns to game the score. 25 min 0/2 exercises solved 25 min 0/2 exercises solved
    2. 0xB012Reasoning models and test-time computeTrade tokens for brains: why models that “think” first get harder problems right, and when the extra thinking is a waste of money. 25 min 0/2 exercises solved 25 min 0/2 exercises solved
    3. 0xC013Serving LLMs fast and cheapWhy generating text is a memory-bandwidth problem, and the tricks - batching, caching, quantization, speculative decoding - that make chatbots affordable. 25 min 0/2 exercises solved 25 min 0/2 exercises solved
  5. Unit 5 · 0/2 lessons

    Evaluation and responsible use

    Measure quality, catch hallucinations, and add guardrails. Badge: Careful evaluator

    1. 0xD014Evaluate LLMs and use them responsiblyBuild evals for your task, use metrics like exact match and pass@k, and know the limits of benchmarks and LLM judges. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
    2. 0xE015Hallucinations, safety and guardrailsSpot fabricated details, reduce them with grounding and abstention, and keep humans in control of risky actions. 22 min 0/2 exercises solved 22 min 0/2 exercises solved
  6. Unit 6 · 0/1 lessons

    Capstone

    Build, evaluate and sample from a tiny language model. Badge: LLM engineer

    1. 0xF016Capstone: build a tiny language modelTrain a word-level bigram model, measure its perplexity, and generate text with temperature. 30 min 0/2 exercises solved 30 min 0/2 exercises solved