Skip to content
Series
21 posts

Reading Stanford CS221

A lecture-by-lecture reading of Stanford CS221: search, Markov decision processes, machine learning, constraint satisfaction, and probabilistic models.

Stanford CS221: The AI Intro Course Whose Prerequisites Field Reads CS103, CS106B, CS109, CS161

CS221 lays AI out along one axis, and reflex models — deep learning — sit in the lowest slot, with states, variables and logic above them. When Percy Liang took over in Autumn 2025 he replaced the slides with runnable Python and wrote 'Cut constraint satisfaction problems :(' into the source of the first lecture — yet ExploreCourses and Stanford Online both still advertise constraint satisfaction as a course topic. The project has gone from 20% of the grade in 2019 to extra credit only.

CS221 Lecture 1: Overview: Defining Intelligence Under Resource Constraints

Lecture 1 of Stanford CS221 Autumn 2025 develops operational representations and algorithmic intuition through Overview: Defining Intelligence Under Resource Constraints.

CS221 Lecture 2: Learning I: From Computation Graphs to Linear Regression

Lecture 2 of Stanford CS221 Autumn 2025 develops operational representations and algorithmic intuition through Learning I: From Computation Graphs to Linear Regression.

CS221 Lecture 3: Learning II: Linear Classification, Features, and Cross-Entropy

Lecture 3 of Stanford CS221 Autumn 2025 develops operational representations and algorithmic intuition through Learning II: Linear Classification, Features, and Cross-Entropy.

CS221 Lecture 4: Learning III: Deep Networks as Composable Computation Graphs

Lecture 4 of Stanford CS221 Autumn 2025 develops operational representations and algorithmic intuition through Learning III: Deep Networks as Composable Computation Graphs.

CS221 Lecture 5: Search I: Define the State Before Choosing the Algorithm

Lecture 5 models search with states, actions, successors, and costs, then uses acyclic dynamic programming to show that an efficient algorithm still solves the wrong problem when state omits information needed by the future.

CS221 Lecture 6: Search II: Priorities in UCS and A*

Lecture 6 of Stanford CS221 Autumn 2025 follows the official material on Search II: Priorities in UCS and A* and makes its assumptions and limits explicit.

CS221 Lecture 7: MDPs I: Putting Uncertainty into State Transitions

Lecture 7 of Stanford CS221 Autumn 2025 follows the official material on MDPs I: Putting Uncertainty into State Transitions and makes its assumptions and limits explicit.

CS221 Lecture 8: MDPs II: Learning Q-Values Without a Transition Model

Lecture 8 of Stanford CS221 Autumn 2025 follows the official material on MDPs II: Learning Q-Values Without a Transition Model and makes its assumptions and limits explicit.

CS221 Lecture 9: MDPs III: Differentiating Expected Return Directly

Lecture 9 moves from tabular RL to function approximation, derives REINFORCE with the log-derivative identity, and connects the derivation to the executable PyTorch implementation.

CS221 Lecture 10: Games I: From Expectimax to Minimax

Lecture 10 extends single-agent search into adversarial game trees: expectimax averages chance outcomes, minimax takes the opponent's worst case, and alpha-beta removes irrelevant branches without changing the answer.

CS221 Lecture 11: Games II: TD Learning, Simultaneous Games, and Nash Equilibria

Lecture 11 first learns game values from experience with temporal-difference updates, then moves from sequential play to simultaneous games described by mixed strategies, minimax guarantees, and Nash equilibria.

CS221 Lecture 12: Bayesian Networks I: From Joint Distributions to Factorization

Lecture 12 builds a joint distribution from random variables and factors, then uses Bayesian-network factorization to express conditional independence and make conditioning and marginalization executable.

CS221 Lecture 13: Bayesian Networks II: Gibbs Sampling and the Markov Blanket

Lecture 13 replaces costly exact inference with Gibbs sampling: resample one variable at a time from a conditional determined by its Markov blanket, then approximate query probabilities with sample frequencies.

CS221 Lecture 14: Bayesian Networks III: From Counts and Smoothing to EM

Lecture 14 moves from maximum-likelihood counts and Laplace smoothing with complete data to EM, which alternates posterior responsibilities for latent variables with parameter updates.

CS221 Lecture 15: Logic I: Models, Entailment, and SAT

Lecture 15 separates propositional syntax from semantics: model checking defines entailment through satisfying assignments, SAT finds witnesses, and inference rules must be judged for both soundness and completeness.

CS221 Lecture 16: Logic II: Quantifiers Beyond Individual Propositions

Lecture 16 compresses knowledge across objects with predicates, quantifiers, and functions, then derives conclusions through substitution, unification, and definite-clause forward inference while exposing termination and completeness limits.

CS221 Lecture 17: Language Models: From Next-Token Prediction to Generation

Lecture 17 defines a language model as a chain-rule factorization of sequence probability, compares n-gram and neural conditional models, and shows how sampling, temperature, and evaluation shape generation.

CS221 Lecture 18: AI & Society: Benefits, Misuse, Accidents, and Institutions

Lecture 18 classifies AI's social effects as benefits, misuse, accidents, and structural harms, then connects fairness audits, research ethics, copyright, and platform terms to accountable institutional choices.

CS221 Lecture 19: AI Supply Chains: Resources, Labor, and Markets Behind Models

Lecture 19 uses the Economics of AI deck to connect compute, data, distribution, and organizational complements to GDP, labor, and ideas-driven growth.

CS221 Lecture 20: Fireside Chat, Conclusion: Turning Twenty Lectures into Modeling Choices

Lecture 20 is Percy Liang's fireside chat on career and research, CS221 and Stanford, and AI's future, with every attribution tied to the official video and editorial synthesis kept separate from auto-caption uncertainty.