Stanford · Probability for AI / PAI00

Stanford's Probability for AI: an Introduction to the Course

The next course I am taking is Probability for AI (PAI, pronounced "pie"), a free online course from Stanford that teaches the probability modern AI is built on. This page introduces the course before my weekly notes begin: who runs it, how it is taught, what the student site looks like, and how the six weeks are planned.

  • section
  • key term
  • reading note

What PAI is

PAI is based on material from CS109, Stanford's probability course for computer scientists, rebuilt for the general public. The course says comfort with algebra is all you need: if you can make sense of y = 2x + 1, you have the background.

CostFree: no fees, no ads, no premium tier
LengthSix weeks, a few focused hours each week
PrerequisitesAlgebra; no programming or calculus needed
Grades and creditNone; you keep a public portfolio of your work, hosted by Stanford
Fixed timeOne live section a week; everything else on your own schedule
The PAI home page:
The PAI home page: "A free Stanford course, taught with hundreds of teachers", with Apply to learn and Volunteer to teach

Watch this part

The people behind it

The course is led by two Stanford computer science professors, Chris Piech and Mehran Sahami, with Kelly Cochran as the course director. Chris's research uses machine learning to understand how people learn. Mehran also worked as a research scientist at Google.

They have done this before. In 2020 they helped start Code in Place, a free introduction to coding that welcomed more than ten thousand students in its first offering. PAI is taught the same way.

The Probability for AI team page: instructors, founding team and head teaching assistants
The Probability for AI team page: instructors, founding team and head teaching assistants

Watch this part

The Code in Place way

The model is simple: one volunteer teacher for every ten students. The teaching team's bet is that the number of people who want to teach is large, perhaps close to the number who want to learn, and that teaching is the best way to learn. Many section leaders took a course like this once and came back to pass it on.

"About the Class" on the public page: who it is for, the workload, and the one-teacher-per-ten-students model

Watch this part

Inside the class

Once you are in, the student site has a few parts, each with a clear job:

  • Home: the week's plan as a path: lessons to watch, something to build, and your section.
  • Lessons: the lecture videos, plus a toolbox with every definition and rule in one place, and the course book.
  • Puzzles: a new probability puzzle for everyone each day, and a trainer with every puzzle released so far.
  • Portfolio: everything you build. My first projects are a Word Detective and an Inference Time Calculator.
  • Events: a half-hour session with Chris every Monday, and it is recorded.
  • Forums: where the whole class, and each section, talks.
The student home page: week 2 as a path from lessons to a project to the section
The student home page: week 2 as a path from lessons to a project to the section
Puzzles: today's puzzle for the whole course, the puzzle trainer and the week's streak
Puzzles: today's puzzle for the whole course, the puzzle trainer and the week's streak
My portfolio after week 1: Word Detective and Inference Time Calculator
My portfolio after week 1: Word Detective and Inference Time Calculator

Watch this part

The weekly section

For me the most interesting part of the design is the section. Each week I meet live for 50 minutes with a volunteer section leader and about ten other students. Our leader goes over that week's ideas, and we work through problems together. Sections run at all hours from Wednesday to Friday, so there is a time for every time zone.

Our first topic was "Same prompt, different answers?". This week it is the Palpatine poll: how do you find out how many people secretly support someone, when nobody wants to say so out loud?

My section page with the schedule (names and faces blurred for privacy)
My section page with the schedule (names and faces blurred for privacy)

Section is also how the course knows you are doing your own work: the certificate depends on taking part each week, not on online answers that an AI could produce.

Watch this part

How the six weeks are built

Each week pairs one idea from probability with something you build:

WeekYou learnYou build
1Core probabilityAn inference-time resource decision maker for large AI models
2Random variablesProbabilistic artwork
3Maximum likelihood estimationFind hidden chambers in the pyramids, a cell-phone tracker, and more
4Logistic regressionA test suite to see where it works and where it fails
5Neural networksVisualize how large models work under the hood
6Probabilistic evaluationCritique how AI models perform, including fairness and calibration

The course ends with a final project of your own design, which becomes the centrepiece of the public portfolio.

The course structure on the student About page
The course structure on the student About page

Watch this part

How to join

There are two ways in: apply to learn, or volunteer to teach a small group of learners. Applications open once a year. For 2026 they closed at the end of September, and class started on 9 October, so the next chance is next year's round on pai.stanford.edu.

Watch this part

My first thought

I have just finished week one, and my notes from it come next. One line from the course FAQ has stayed with me: "not a math person" usually means "had one bad math class a while ago". It made me wonder whether I would have loved math and computer science even more if I had met teachers like these earlier.

The FAQ answer to
The FAQ answer to "I'm not a math person. Is this for me?"

Watch this part

Links

原图 / Original ↗