Lecture 01. Agent anatomy, reliability and the token cost model
Part 1 · The Model as a Measured Component · Scheduled 8 Nov 2026 · 1-hour lecture
Part 1 is currently in progress. This page records the supplied class plan; personal notes and results have not been added.
Learning objectives
- Agent anatomy: model, tools, loop, memory; workflow vs agent; a ReAct trace line by line; the course map: one repo, two agents.
- Quality attributes of an agent: cost, latency, reliability, security; one quality-attribute scenario built from p^n.
- The reliability gap: n steps at success p give p^n; task success is not safety compliance.
- The LM as next-token probabilities; log-probabilities; why the same prompt gives different answers.
- BPE merges and byte fallback; tokens per word (fertility) for Bangla vs English; a cost model per request.
- Recap, 10 min maximum: tokens and context slides only.
Why this class matters
- Industry: Students estimate API cost and latency before a feature is built, and explain why multi-step agents fail.
- Academic: Fertility for Bangla is a publishable measurement (research pathway 1); the p^n argument is the base of every later eval.
- Elsewhere: Students read agent logs and papers without guesswork about tokens, probabilities and sampling.
Preparation requirements
- Stanford CS329Z L1 and L2 slides (cs329z.stanford.edu).
- A recap deck of 10 min or less.
- The paper (Zaharia et al. 2024) as pre-reading.
These are preparation requirements in the draft; staff materials are not bundled with this site.
Preparation and readings
- Stanford CS329Z L1: Introduction: what are agentic systems? (slides)
- Stanford CS329Z L2: LLMs for builders (slides)
- Zaharia et al., Compound AI Systems (BAIR 2024)
The linked reference library contains the source URLs extracted from the course PDF. Availability notes above reflect the draft of 4 November 2026.
Paired lab
Continue with Lab 01: Agent anatomy, reliability and the token cost model. Every lab contributes an artifact to the same repository and a measurement to the results ledger.
Personal notes
[Lecture notes and observations]