English • 中文 (earlier version) • 日本語 (earlier version) • 한국어 (earlier version)
An open textbook series on how machine learning systems are built and why they are built that way, with companion tools for building, measuring, and teaching them.
📘 Textbook Series •
📗 Vol I •
📘 Vol II (Preview) •
🟣 Vol III (Draft) •
🌲 Vol IV (Draft)
🔥 TinyTorch •
🔬 Labs •
🧰 Kits •
🔮 MLSys·im •
🎓 Instructors •
💼 StaffML
📚 Volume I is forthcoming in print from MIT Press.
The world is rushing to build AI systems. It is not yet engineering them.
A model that scores well on a benchmark still has to fit in memory, meet a latency budget, stay within a power limit, and fail safely in front of real people. Those constraints decide the architecture, and they follow laws that outlast any framework or chip. Memory bandwidth, network latency, energy, and failure rates govern a microcontroller with 256 KB of memory and an accelerator in a datacenter alike, even though the two differ in scale by many orders of magnitude. I learned this while working on TinyML at Google, and it became the idea that runs through every volume: constraints drive architecture.
AI engineering is the discipline of building efficient, reliable, and safe intelligent systems that operate in the real world, not just models in isolation. My aim is to help establish it alongside software engineering and computer engineering, and to teach it the way computer architecture has long been taught, from first principles and with numbers a student can recompute.
Everything lives in one repository because each part teaches something the others cannot. Students who only read do not internalize, and students who only code do not generalize. The textbook builds the mental model, TinyTorch makes it concrete by having students build the machinery themselves, and the hardware kits and the MLSys·im simulator show where the model breaks, on devices students can hold and at scales they cannot rent.
The repository is the curriculum.
The work began in a classroom. In 2023, the students in CS249r at Harvard wrote the first class notes together, one topic per group, and we published them on GitHub. Those notes have been rewritten every semester since, and the HarvardX TinyML course that preceded them reached more than 100,000 learners. The goal now is one million learners by 2030.
There is also a personal reason, which the FAQ tells in full. As an undergraduate, I wrote to a professor I had never met and received a VHS tape in the mail that changed what I studied. This curriculum is my way of sending that package back out.
Each chapter connects an idea a reader may already know from machine learning to the systems that make it work in practice.
| You know... | You will learn... | |
|---|---|---|
| How to train a model | → | How training scales across accelerator clusters |
| That quantization shrinks models | → | How low-precision arithmetic maps to silicon |
| What a transformer is | → | Why the KV cache dominates memory at inference |
| Models run on GPUs | → | How schedulers balance latency against throughput |
| Models need good data | → | How data pipelines, selection, and drift decide what a model can learn |
| Models get deployed | → | How to benchmark, monitor, and roll back models in production |
| Hardware fails sometimes | → | How to checkpoint and recover training jobs that span thousands of accelerators |
| Edge devices have limits | → | How to co-design models and hardware |
| AI uses a lot of energy | → | How to measure and reduce the energy and carbon cost of a system over its full lifecycle |
| How to prompt an LLM | → | How to architect agent loops, tool sandboxes, and context memory (Vol III, draft) |
| How vision and robotics models infer | → | How to close real-time sensor-actuator loops under physical constraints (Vol IV, draft) |
Each volume widens the boundary of the system and raises the cost of failure. The distinction between volumes is scope, not depth; every volume is equally quantitative.
| Volume | Unit of work | Core systems question | Status | |
|---|---|---|---|---|
| 📗 | I. Introduction to Machine Learning Systems | The model | How does intelligence execute efficiently on a single machine? | Released; forthcoming in print from MIT Press |
| 📘 | II. Scaling Machine Learning Systems | The fleet | How does intelligence scale across distributed clusters and datacenters? | Preview; in active revision |
| 🟣 | III. Agentic Machine Learning Systems | The trajectory | How is intelligence governed when it acts autonomously over long horizons? | Draft; changes often |
| 🌲 | IV. Physical AI: Machine Learning Systems That Sense and Act | The physical action | How can intelligence act safely on matter and physical systems? | Draft; changes often |
Each volume answers a question the previous one leaves open:
⚠️ Volumes III and IV are open drafts. Chapters are added, reorganized, and rewritten as I iterate, so please do not cite or teach from them yet. Feedback is welcome through the book feedback issue forms.
The pieces are designed to work together, but none of them requires the others.
| If you are... | Start here | Then go deeper |
|---|---|---|
| A student or self-learner | Read Volume I | Build TinyTorch, model systems with MLSys·im, try the labs (early release), and practice with StaffML |
| An instructor | Open the Instructor Hub | Pick a course and use its syllabus, slides, kits, and labs |
| A contributor | Pick the component you use most | See Contributing |
| 日期 | 榜单 | 排名 | 周期新增 | 总 STAR |
|---|