Generative AI from First Principles

Work in progress: this page and the course materials are still being written and will change as the course runs.
Instructor: Madhusudhan Reddy Pittu
Format: Eight weekly lectures of approximately two hours, with an optional ninth session. Wednesdays, 3–5 pm.
Course plan: each week pairs a lecture with a hands-on part. The weeks are listed below; each week's description, notes, slides, code, and references are posted here as the week runs.
Supplementary material: Background Notes on Machine Learning and AI

About

This course introduces generative AI through the study of large language models, combining mathematical foundations with hands-on implementation. Over the eight weeks we build a small language model from scratch, small enough to train on a laptop in minutes to an hour: we implement its components, train and fine-tune it, probe its behavior, and evaluate its outputs. The aim is a complete working understanding of the model: how it works, how to build it, and how to investigate what it has learned.

We trace the path from statistical models of language to Transformers, pretraining, post-training, and inference. Throughout, we ask the same questions: what can these models learn and compute, from what data, with what resources, and with what guarantees? The implementation gives a concrete setting in which to explore these questions, connecting theory with experiment.

How these materials are made. The course materials are put together with the help of AI. I do the high-level planning, and I read and refine all of the material thoroughly myself. For this reason the materials are constantly updated and refined. This is the first version of the course, so please bear with me :)


Lectures


Supplementary material

Background Notes on Machine Learning and AI


Updated 14 October 2026.