CS2680 Modern AI Systems: Agents and Systems Optimizations
Lecture Notes

Notes for each lecture, posted alongside the slides. They are meant to be read, not skimmed — they carry the derivations and the arithmetic that the slides only show the result of.

Read them either way round. Before class they tell you what the readings are for and what question the lecture is answering; after class they are where the numbers live, worked out step by step so you can check them. Every quantitative claim is either derived in the text or taken from a stated source, so if you do not believe a number you can find out where it came from — and tell me if it is wrong.

Each note ends with self-check questions and a reading guide. The self-check questions are the fastest way to find out whether you actually followed the lecture; the reading guide tells you what to look for in each assigned paper and what you can safely skip.

Tentative: these notes are drafted before the term and will be corrected as the course runs. If a number looks wrong, it may well be — say so in class or by email, and you may earn bonus credit for it.

Part I — Introduction to LLMs and Agents

Lecture 1 · Thu Sep 3
Course overview and logistics

What this course is and is not, the stack we spend the term walking down, and the back-of-the-envelope calculation showing that for any model with real usage the lifetime bill is dominated by serving rather than training.

Lecture 2 · Tue Sep 8
Modern ML basics: transformers, training, and where inference cost comes from

A transformer block as a small pile of matrix multiplies: parameter counting, where the FLOPs go, and the four consumers of training memory. Then the other half of the picture — prefill and decode as two different machines, the roofline and its ridge point, why batching is the only lever and why the KV cache takes it away, and what a token actually costs.

Lecture 3 · Thu Sep 10
Agents from a user’s perspective

What an agent is, minimally. Where the tokens actually go across a multi-turn session, why context is the scarce resource, and how to tell a model failure from a harness, tool, or specification failure. Assignment 1 goes out.

Lecture 4 · Tue Sep 15
Agents from a designer’s perspective I: the loop, tools, and context

Writing the loop yourself rather than importing one: tool interfaces as API design, retries and error recovery, stopping conditions, and context management as a cache policy. Assignment 2 goes out.

Lecture 5 · Thu Sep 17
Agents from a designer’s perspective II: what agent workloads do to the serving system

What an agent workload looks like from underneath — bursty, heavy-tailed, and full of prefixes that repeat. Why that shape is hard on a serving system built for chat, which is the motivation for Part II.

Parts II and III

Notes for the rest of the term go up as we reach them. The schedule is the authoritative list of topics, dates, and readings; sessions marked Students are paper discussions rather than lectures, and the paper discussion page explains how those run.