
Build an LLM from Scratch: Code a GPT in PyTorch
Published 10/2026
Created by Thanh Vũ
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz, 2 Ch
Level: Intermediate | Genre: eLearning | Language: English + subtitle | Duration: 82 Lectures ( 4h 12m ) | Size: 2 GB
Tokenizer, attention, pretraining and fine-tuning: build your own ChatGPT-style model step by step, no GPU needed
What you'll learn
⚡ Build a complete GPT model from scratch in PyTorch and understand every line of it
⚡ Turn text into tokens and embeddings, and code self-attention and multi-head attention yourself
⚡ Pretrain a language model, evaluate it, control text generation, and load the real GPT-2 weights
⚡ Fine-tune an LLM as a spam classifier and as an instruction-following assistant, and add LoRA
Requirements
❗ Python programming; some PyTorch helps, and the included PyTorch primer covers the basics. No GPU needed.
Description
ChatGPT, Claude, Llama, Gemini: we use large language models every day, but what actually happens inside? In this course you do not just use an LLM. You build one, line by line, in plain PyTorch, and you understand every piece of it.
Our running example is a Sherlock Holmes story, "A Scandal in Bohemia". By the end of the course, your own code will
✅ pretrain a small GPT on the story and generate text in the style of Conan Doyle,
✅ turn a pretrained GPT-2 into a spam filter for text messages,
✅ fine-tune it to follow instructions, like a small personal assistant.
The course follows three stages. Stage 1 builds the foundation: what LLMs are, turning text into tokens and embeddings, coding self-attention and multi-head attention, and assembling a complete GPT model. Stage 2 is pretraining: the training loop, evaluation, temperature and top-k sampling, and loading the real GPT-2 weights. Stage 3 is fine-tuning: a text classifier, and instruction fine-tuning with automatic evaluation.
Every chapter comes with an animated video that explains the ideas with real numbers from real code, a practice notebook where you write the key functions yourself while check cells tell you immediately whether your code is right, a quiz, and an open challenge.
Two appendices cover a PyTorch primer and parameter-efficient fine-tuning with LoRA. More than forty optional extra videos go deeper: byte pair encoding from scratch, the KV cache, grouped-query attention, mixture of experts, Llama, Qwen and Gemma architectures, DPO, and more.
You do not need a GPU: every notebook runs on a normal laptop. There is no heavy math either; every formula is shown with concrete numbers.
The code is adapted from Sebastian Raschka's open source repository LLMs-from-scratch (Apache License 2.0). His book "Build a Large Language Model (From Scratch)" goes into even more depth and is highly recommended. The examples, animations, exercises and quizzes are made for this course.
Who this course is for
⭐ Python developers and students who want to understand how ChatGPT-style models really work inside
⭐ Data scientists and ML engineers who use LLMs and want to train and fine-tune their own
Homepage
Код:
https://nitroflare.com/view/0A98AE1F06172B1/Build_an_LLM_from_Scratch_Code_a_GPT_in_PyTorch.part1.rar
https://nitroflare.com/view/C0D2849E1F17224/Build_an_LLM_from_Scratch_Code_a_GPT_in_PyTorch.part2.rar
https://nitroflare.com/view/909F4F67D3B5C69/Build_an_LLM_from_Scratch_Code_a_GPT_in_PyTorch.part3.rar
https://rapidgator.net/file/192bc7a8c0be46af7f033d6fc8f7570f/Build_an_LLM_from_Scratch_Code_a_GPT_in_PyTorch.part1.rar.html
https://rapidgator.net/file/fab2e2a8c81f3320a7ca5c61d7beca19/Build_an_LLM_from_Scratch_Code_a_GPT_in_PyTorch.part2.rar.html
https://rapidgator.net/file/55ba82e6ae0cf867f4aaf69defedd014/Build_an_LLM_from_Scratch_Code_a_GPT_in_PyTorch.part3.rar.html