About This Course
<p>This course contains the use of artificial intelligence. Understand how large language models really work, from the first recurrent networks to the open models people use today, and learn to explain every part of them clearly in an interview or an exam.</p><p>This is a theory course with pictures. Each idea is drawn as a calm animated scene first, then written as a formula with real numbers. You follow one story, in order: how text becomes numbers, why RNNs and LSTMs forgot, how attention fixed it, the full Transformer, BERT, GPT and T5, the jump in scale with GPT-3, how ChatGPT-style assistants are trained, and then every part of a modern LLM, block by block.</p><p><span>Learn from the real thing</span></p><ul><li>Real papers. Attention Is All You Need, BERT, GPT-2, GPT-3, the scaling law papers, InstructGPT, DPO, DeepSeek-R1 and more are shown on their real pages, with the sentence or number that matters highlighted as it is explained. Figures are redrawn and simplified so they read at a glance.</li><li>Real models. GPT-2 is the model for the foundations, and Qwen3-8B takes over when the course turns to assistants and modern LLMs. You see what a base model really writes before any tuning, and why an assistant answers differently.</li><li>Real configs. Parameter counts, memory sizes and KV cache sizes are worked out from each model's own config.json, not from a press release.</li><li>Real measurements. Three short notebooks tokenize real text, count and measure a model, and compare a 16-bit model with its 4-bit version, so the numbers on screen come from a real run.</li></ul><p><span>Interview ready</span></p><p>Throughout the course, right after the idea it tests, you meet the questions companies and exams really ask, each answered in a few plain sentences you can say out loud. The last section shows how to answer an LLM theory question well, with two full practice tests with explained answers.</p><p><span>What you will cover</span></p><ul><li>Words as numbers: tokens, byte pair encoding, GPT-2's byte-level BPE, embeddings, word2vec and why one vector per word is not enough.</li><li>Sequence models: the RNN step by step, vanishing gradients, LSTM gates, GRU, and seq2seq encoders and decoders.</li><li>Attention: alignment attention, self-attention, query, key and value, scaled scores, softmax and the cost of the attention matrix.</li><li>The Transformer in full: multi-head attention, positional encoding, the feed-forward block, residual connections and LayerNorm, the causal mask, cross-attention, and how vectors become the next token.</li><li>Three families: ELMo, BERT, GPT and T5, encoder-only versus decoder-only, and how a model writes with greedy decoding, beam search, temperature, top-k and top-p sampling.</li><li>Scale: GPT-2, GPT-3 and in-context learning, scaling laws, Chinchilla, and what scale gives and what it does not.</li><li>From model to assistant: supervised fine-tuning, reward models, RLHF in InstructGPT and ChatGPT, DPO, and full fine-tuning versus LoRA.</li><li>The modern transformer block: pre-norm and RMSNorm, SwiGLU, RoPE, the KV cache, MQA and GQA, multi-head latent attention (MLA), sliding windows, sparse and compressed attention, linear attention and hybrid stacks, and long context.</li><li>Mixture of Experts: the router, total versus active parameters, load balancing, and fine-grained and shared experts.</li><li>Size and memory: reading a config.json, counting parameters, memory for weights and the KV cache, prefill and decode, FlashAttention, and memory for training.</li><li>Quantization: number formats from FP32 to 4 bit, scale and zero point, per tensor, per channel and per group, GPTQ, AWQ, GGUF and NF4, and the names on model pages.</li><li>Reasoning models: chain of thought, test-time compute, verifiable rewards, GRPO, DeepSeek-R1 step by step, and distillation.</li><li>Benchmarks and evaluation: what a score really is, MMLU, GPQA, AIME, HumanEval, LiveCodeBench and SWE-bench, arena rankings and model judges, contamination and saturation, and how to read a model card.</li><li>Model teardowns: Qwen2.5-0.5B, SmolLM3, gpt-oss, Gemma, DeepSeek, Qwen and Kimi, each taken apart from its real config, so you can tear down the next model yourself.</li></ul><p>By the end, you will be able to open any new open model's page and config, name each part of its architecture, estimate its size and memory, judge its benchmark claims, and explain all of it in plain words.</p><p>This course does not build a model from scratch, does not cover serving LLMs at scale, and has no fine-tuning code. It is the theory underneath all three.</p>
What you'll learn:
- Explain how an LLM turns text into tokens and vectors: BPE, byte-level BPE, embeddings and word2vec
- Trace sequence models from the RNN to LSTM, GRU and seq2seq, and say why vanishing gradients made them forget
- Explain attention step by step: query, key and value, scaled scores, softmax and the attention matrix
- Draw the full Transformer from Attention Is All You Need: multi-head attention, positions, residuals and masks
- Compare BERT, GPT and T5, and explain greedy decoding, beam search, temperature, top-k and top-p sampling
- Explain scaling laws, Chinchilla and in-context learning, and how SFT, RLHF, DPO and LoRA make an assistant
- Read a modern block: RMSNorm, SwiGLU, RoPE, KV cache, GQA, MLA, sliding windows, linear attention, long context
- Explain Mixture of Experts, count parameters from a config.json, and size the weights and the KV cache in memory
- Explain quantization and reasoning models: GPTQ, AWQ, GGUF, NF4, chain of thought, GRPO and DeepSeek-R1
- Read benchmark scores and model cards critically, tear down open models, and answer LLM interview questions