15 LESSONS · VISUAL GUIDES · HANDS-ON PYTHON
Understand the model.
Build with confidence.
The Illustrated LLM Tutorial takes you from next-token prediction to a tested document assistant. Explore the mechanics, work through the numbers, and put each idea into practice.

A small example. A clear explanation. A task to try.
Study each visual guide, predict the code output, run the example, and complete the practice tasks before opening the checkpoint. The examples use only the Python 3 standard library and run independently. No API key, model download, GPU, or paid service is needed.
The numerical examples use deliberately small, invented probabilities, vectors, and matrices. They demonstrate individual concepts; they do not implement or train a complete LLM.
Adapted from LLM Illustrated Tutorial — 15 Lessons, with restored code formatting and new lesson illustrations.
Language to vectors
Foundations, tokens, embeddings
Inside the transformer
Architecture, attention, position
Learn and generate
Training and inference
Build and evaluate
Applications through capstone
Your 15-lesson learning path

LLM Fundamentals
Explain what an LLM learns and distinguish training from inference.
Explore lesson →
Tokenization in LLMs
Convert text to token IDs and explain why token counts depend on the tokenizer.
Explore lesson →
Embeddings in LLMs
Use vectors to compare similarity and distinguish token embeddings from document embeddings.
Explore lesson →
Transformer Architecture
Trace a decoder-only transformer and identify the role of each major component.
Explore lesson →
Self-Attention Deep Dive
Calculate a small attention example and explain causal masking.
Explore lesson →
Multi-Head Attention
Explain how separate attention heads are combined and check their dimensions.
Explore lesson →
Positional Encoding and Context
Explain how token order is represented and plan a context budget.
Explore lesson →
LLM Training Pipeline
Describe pretraining and calculate next-token cross-entropy loss.
Explore lesson →
Inference and Text Generation
Compare decoding strategies and explain the generation loop.
Explore lesson →
Real-World Applications and Examples
Design an evidence-grounded application and distinguish retrieval from live tool access.
Explore lesson →
Evaluation of LLMs
Build a task-specific evaluation rubric and compute simple outcome metrics.
Explore lesson →
Prompt Engineering for LLMs
Write a clear, testable prompt with evidence boundaries and a defined output format.
Explore lesson →
Fine-Tuning and Alignment
Distinguish model adaptation methods and explain LoRA with a small matrix example.
Explore lesson →
LLM Ecosystem, Tools and Future Trends
Map application components and evaluate tool categories without relying on brand rankings.
Explore lesson →
Key Takeaways and Next Steps
Combine the lessons into a small, testable document-assistant project.
Explore lesson →Finish with a policy assistant
Combine five fictional policies with source tracking, missing-evidence handling, and a test set. Measure correctness, unsupported answers, formatting failures, and latency, then use failures to guide the next improvement.
Explore the capstone →