
This course includes our updated coding exercises so you can practice your skills as you learn.
See a demo
Watch the model you will build write Shakespeare live, and see the roadmap from an empty folder to a working AI app.
How transformers replaced RNNs, the 2017 breakthrough behind ChatGPT, and where transformers are used today.
The one-picture overview of how GPT turns text into probabilities and writes one token at a time.
Turn text into numbers with a character tokenizer and a from-scratch Byte-Pair Encoding (BPE) tokenizer.
How embeddings give tokens meaning and positional encoding gives them order, explained and coded.
Query, Key, Value, scaling and the causal mask: self-attention explained visually and built by hand.
Multi-head attention, residual connections, layer norm and the full GPT architecture, with an exact parameter count.
Set up the project and code Linear, LayerNorm, GELU, softmax and cross-entropy from scratch.
Type the attention function live, then build efficient multi-head attention by following the tensor shapes.
Assemble the full MiniGPT model, write the text-generation loop and prove it works with 12 tests.
Code the training loop with a from-scratch AdamW optimiser, learning-rate schedule and gradient clipping.
Train the model on a laptop CPU, read the loss curve, understand perplexity and plan your own experiments.
Control generation with temperature, top-k and top-p sampling and see how each one changes the output.
Build an interactive Gradio playground with live generation, a next-token lab and an attention viewer.
Train on your own data and learn how pre-training, fine-tuning and RLHF turn a GPT into ChatGPT.
Test yourself with 12 common transformer interview questions, each answered with a visual explanation.
This course contains the use of artificial intelligence.
Ever wondered what really happens inside ChatGPT? In this course, you'll find out by building one yourself.
Build Your Own ChatGPT takes you from zero to a working GPT-style language model, written in Python. No black boxes and no shortcuts. You'll write every line and understand why it works.
What you'll build, step by step:
A tokenizer: use byte-pair encoding to turn raw text into tokens and numbers
Embeddings: represent tokens as vectors the model can learn from
Self-attention: queries, keys, values, causal masking and multi-head attention
The transformer: feed-forward layers, residual connections and layer normalization
Training: train your model on real text and watch the loss fall
Text generation: sample from your model and chat with your own GPT
Every concept is explained visually first and then coded from scratch, so the math becomes clear and the code makes sense.
Who this course is for:
Developers who use LLMs and want to understand how they really work
Students and data scientists moving into AI and NLP
Anyone curious about the technology behind ChatGPT
Requirements: basic Python. Familiarity with high school math helps, and everything else is taught along the way.
By the end, you won't just use AI. You'll know how to build it.
Enroll now and start building your own ChatGPT today.