Where to learn how LLMs work: courses and books
The best free videos, essays and courses for understanding large language models, plus three books and two paid courses, chosen for two kinds of reader.
Updated · 4 min read · How guides are written
The best material for understanding large language models is free, and much of it was made by people who built the technology. If you only have an hour, watch Andrej Karpathy’s Intro to Large Language Models. If you have a weekend, add the 3Blue1Brown videos and Jay Alammar’s illustrated guide below. Everything else on this page is for going further.
How these were chosen. Each item is free unless marked, comes from someone with a direct hand in the field or a long record of teaching it, and explains ideas that have stayed true as models changed. This page describes what each resource says it covers; it is not a review based on taking every course. Where a link goes to a shop or a paid course, it is marked.
If you do not code
Start here whatever your background. None of these assume maths or programming.
Intro to Large Language Models by Andrej Karpathy. A one-hour talk, free on YouTube. Karpathy was a founding member of OpenAI and led AI at Tesla. It covers what a model is, how training works, and where the technology is heading, at the level of a good public lecture.
3Blue1Brown: Neural Networks by Grant Sanderson. Free. A series of animated videos that build up from what a neural network is to how transformers and attention work. If you learn best from pictures, start with these.
The Illustrated Transformer by Jay Alammar. Free. A long illustrated article that walks through the transformer architecture one diagram at a time. Widely used in university courses.
What Is ChatGPT Doing … and Why Does It Work? by Stephen Wolfram. Free. A long essay that explains next-word prediction from scratch, with worked examples, and then asks why such a simple idea produces coherent language.
Then read this site’s own short version, What is an LLM?, to check that the pieces fit together.
If you code
These teach by building. All free.
Neural Networks: Zero to Hero by Andrej Karpathy. Its own description: “A course by Andrej Karpathy on building neural networks, from scratch, in code. We start with the basics of backpropagation and build up to modern deep neural networks, like GPT.” You write every line yourself in Python.
Hugging Face LLM Course. A free course from the company behind the Transformers library, covering how to use, fine-tune and share models with its open-source tools. Practical where Karpathy’s course is foundational.
Practical Deep Learning for Coders from fast.ai. A free course that starts with working applications and explains the theory afterwards. Broader than language models, and a good grounding in the field as a whole.
Machine Learning Crash Course from Google. A free introduction to machine learning fundamentals, with exercises. Useful if terms like regression, loss and overfitting are new to you.
Once you can run things, How to run an LLM on your own computer gets a real model working on your machine.
Paid courses
Structured courses with exercises and a certificate. These two are on Coursera, which charges for certificates and, depending on the course, for full access; the course page shows current terms.
Generative AI for Everyone (Coursera, paid options). Taught by Andrew Ng. A non-technical course on what generative AI can and cannot do and how to use it at work. The best fit for someone who wants a guided overview without code.
Generative AI with Large Language Models (Coursera, paid options). A technical course on how LLM-based applications are built: the model lifecycle, fine-tuning and deployment. Assumes some Python.
Books
Three books, each aimed at a different goal. Links go to the publisher or to a bookshop search.
Build a Large Language Model (From Scratch) by Sebastian Raschka (Manning, 2024). You implement a GPT-style model step by step in Python, from tokenization to training. The book-length counterpart to the code-first courses above. Available from Manning or on Amazon.
Hands-On Large Language Models by Jay Alammar and Maarten Grootendorst (O’Reilly, 2024). By the author of The Illustrated Transformer, in the same visual style: how models work and how to apply them to search, classification and generation. Find it on Amazon.
AI Engineering by Chip Huyen (O’Reilly, 2025). About building applications on top of existing models, which is what most people working with AI actually do: evaluation, prompting, retrieval, fine-tuning and running systems in production. Find it on Amazon.
Books date faster than usual in this field. Foundations (how a transformer works, how training works) stay current; chapters about specific models and tools do not. Check the publication date against what you want from it.
A path through it
For understanding (about a weekend):
- Karpathy’s one-hour talk.
- The 3Blue1Brown series.
- The Illustrated Transformer.
- This site’s guides on tokens and context windows and benchmarks, so the news starts to make sense.
For building (a few months, part time):
- Machine Learning Crash Course, if the basics are new.
- Neural Networks: Zero to Hero, writing the code yourself.
- The Hugging Face course, to learn the standard tools.
- One of the books, according to whether you want to build models or build with them.
- Run a model locally and start a small project of your own.
Whichever path you take, keep reading the news alongside it. Concepts stick when you meet them in a headline the same week. The front page is there for that, and the glossary for any term that stops you.
Common questions
Do I need to know maths or programming to understand LLMs?
Not for a working understanding. The videos and essays in the first section assume neither. To build or train models yourself you will want Python and some linear algebra and calculus, which the code-first courses teach as they go.
Can I learn all this for free?
Yes. Everything in the first two sections is free, and it covers the subject from first principles to building a small model. The paid courses and books add structure, exercises and depth.
How long does it take to understand how an LLM works?
An afternoon gets you the main ideas from the videos and essays. Working through a code-first course to the point of building a small model takes weeks of part-time study.