LLM Engineering from Scratch
LLM Engineering from Scratch is a hands-on technical course designed to help learners understand what happens inside Large Language Models—from text tokenization and next-token prediction to the architecture of modern Transformer-based LLMs. Instead of treating LLMs as black boxes, the course breaks down the core concepts behind GPT-style models and explains how language models process and generate text.
You will move from fundamentals to implementation by building key LLM components using Python and PyTorch. The course covers BPE tokenization, embeddings, positional encoding, self-attention, Q/K/V, multi-head attention, feed-forward networks, encoder-decoder architecture, masked attention, cross-attention, and the process of building a mini GPT from scratch.
One membership.
All your AI learning.
This course is included in the AI University subscription. You do not pay separately for each course.
What you’ll learn
01 How LLMs Actually Work — From Language to Next-Token Prediction
See published chapters for lesson details.
02 Build a Mini GPT from Scratch with PyTorch
See published chapters for lesson details.
03 LLM Tokenization — BPE & SentencePiece Concepts
See published chapters for lesson details.
04 Transformer Architecture — The Foundation of Modern LLMs
See published chapters for lesson details.
05 Positional Encoding — How Transformers Understand Word Order
See published chapters for lesson details.
06 Transformer Encoder — Self-Attention and Q/K/V
See published chapters for lesson details.
07 Self-Attention — Calculating Attention Scores Step-by-Step
See published chapters for lesson details.
08 Multi-Head Attention, FFN & Complete Transformer Architecture
See published chapters for lesson details.
09 Transformer Decoder — Masked Attention & Cross-Attention
See published chapters for lesson details.
10 Build Your Own LLM Tokenizer — Hands-On Implementation
See published chapters for lesson details.
What you’ll take away
- Understand how Large Language Models process and generate text
- Understand the complete Transformer architecture
- Build and implement a tokenizer for LLM applications
- Understand BPE and subword tokenization concepts
- Understand embeddings and positional encoding
- Understand Query, Key and Value in self-attention
- Calculate and implement self-attention mechanisms
- Understand and implement multi-head attention
- Understand Feed-Forward Networks inside Transformers
- Understand encoder, decoder, masked attention and cross-attention
- Build a mini GPT-style language model using PyTorch
- Develop a strong technical foundation for working with LLMs
Before you start
Basic Python programming knowledge
Basic understanding of machine learning concepts
Basic knowledge of PyTorch is helpful but not mandatory
Basic understanding of mathematics such as vectors, matrices and probability
No prior experience building an LLM is required
Course assessments
Assessment details will appear when published.