CS221: Artificial Intelligence: Principles and Techniques
Teaching Staff
Moses
Moses Charikar
Instructor
Zach
Zachary Robertson
Instructor
Samantha Liu
Samantha Liu
Head CA
Amelie Byun
Amelie Byun
Course Manager
John Cho
John Cho
Course Manager
Swati Dube Batra
Swati Dube Batra
Course Advisor
Jacob Frausto
Jacob Frausto
Homework CA
Andrew Lee
Andrew Lee
Homework CA
Kevin Li
Kevin Li
General CA
Shiny Weng
Shiny Weng
General CA
Yu He
Yu He
Homework CA
Nevin George
Nevin George
Student Liaison
Advit Deepak
Advit Deepak
General CA
Yibo Zhang
Yibo Zhang
Homework CA
Shreyas Agarwal
Shreyas Agarwal
Homework CA
Activities Homework parties and most office hours are in person in Huang Basement, but we will have some remote office hours (for CGOE students) on Zoom. See class calendar for the exact times and locations of all activities.
Policies
AIWG Statement: This course is participating in the proctoring pilot overseen by the Academic Integrity Working Group (AIWG). The purpose of this pilot is to determine the efficacy of proctoring and develop effective practices for proctoring in-person exams at Stanford.

Please review this document as it contains the main questions students might have about the pilot.

To find more details on the pilot or the working group, please visit the AIWG’s webpage.

Communication: We will use Ed for all communications, which you can access via Canvas. CGOE students: please email scpd-gradstudents@stanford.edu if you need general assistance. Make a public Ed post whenever possible. For extra sensitive matters, you can email cs221-staff-spr2425@cs.stanford.edu, which is visible by only the instructors, head CA, course manager, and student liaison.
Video access disclaimer: Lectures and sections will be recorded and available on Canvas. These recordings might be reused in other Stanford courses, viewed by other Stanford students, faculty, or staff, or used for other education and research purposes. If you have questions or concerns, please contact us.
Academic accommodations: If you need an academic accommodation, contact the Office of Accessible Education (OAE). The OAE will then prepare an OAE letter with the recommended accommodations. Send this letter to cs221-staff-spr2425@cs.stanford.edu by Friday, Apr 18 (week 3).

IMPORTANT: If you plan to use your OAE-approved exam accommodations for a specific assessment, students must provide their letter to cs221-staff-spr2425@cs.stanford.edu by:

  1. April 27, 2025 at 5:00pm for accommodations on the midterm exam
  2. May 27, 2025 at 5:00pm for accommodations on the final exam
You need only submit your letter once per quarter. For urgent OAE-related accommodations needs that arise after the deadline, please consult your OAE advisor. If you are not yet registered with OAE, contact the office directly at oae-contactus@stanford.edu.

Collaboration policy and honor code: Please read Stanford's honor code policy. In the context of CS221, you are free to form study groups and discuss homeworks and projects. However, you must write up homeworks and code from scratch independently, and you must acknowledge in your submission all the students you discussed with. The following are considered to be honor code violations: When debugging code together, you are only allowed to look at the input-output behavior of each other's programs (so you should write good test cases!). We periodically run similarity-detection software over all submitted student programs, including programs from past quarters and any solutions found online on public websites.

Generative AI Policy: Each student is expected to submit their own solutions to the CS221 homeworks. You may use generative AI tools such as Co-Pilot and ChatGPT as you would use a human collaborator. This means that you may not directly ask generative AI tools for answers or copy solutions, and you must acknowledge generative AI tools as collaborators. The use of generative AI tools to substantially complete an assignment or exam (e.g. by directly copying) is prohibited and will result in honor code violations. We will be checking students' homework to enforce this policy.

Anyone violating the honor code policy will be referred to the Office of Community Standards. If you think you violated the policy (it can happen, especially under time pressure!), please reach out to us; the consequences will be much less severe than if we approach you.

Inclusion: The CS221 teaching staff is committed to creating an inclusive and supportive learning environment for all students. Please be respectful to your fellow students, course CAs, and instructors. If you see any problems, please reach out to us early.

Stanford as an institution is committed to the highest quality education, and as your teaching team, our first priority is to uphold your educational experience. To that end we are committed to following the syllabus as written here, including through short- or long-term disruptions, such as public health emergencies, natural disasters, or protests and demonstrations. However, there may be extenuating circumstances that necessitate some changes. Should adjustments be necessary, we will communicate clearly and promptly to ensure you understand the expectations and are positioned for successful learning.
Content
What is this course about? The goal of artificial intelligence (AI) is to tackle complex real-world problems with rigorous mathematical tools. In this course, you will learn the foundational principles and practice implementing various AI systems. Specific topics include machine learning, search, Markov decision processes, game playing, constraint satisfaction, graphical models, and logic.
Prerequisites: This course is fast-paced and covers a lot of ground, so it is important that you have a solid foundation in a number of areas. Here are the basic skills that you need and the classes that teach those skills: It is less important that you know particular things (e.g., we don't use eigenvectors in this course even though that's a pillar of any linear algebra course), and more important that you've done enough related things that you feel at ease with it. While it is possible to fill in the gaps, this course does move quickly, and ideally you want to be focusing your energy on learning AI rather than catching up on prerequisites. We have made a few prerequisite modules that you can review to refresh your memory, and the first homework (foundations) will allow you to also get some practice on these basics.
Further reading: There are no required textbooks for this class, and you should be able to learn everything from the lecture notes and homeworks. However, if you would like to pursue more advanced topics or get another perspective on the same material, here are some great resources: Note that some of these books use different notation and terminology from this course, so it may may take some effort to make the appropriate connections.
Coursework
Schedule
Monday Tuesday Wednesday Thursday Friday Saturday Sunday
Week 1 Mar 31 Apr 1
Apr 2
Apr 3 Apr 4 Apr 5 Apr 6
Modules
Introduction
Prerequisites
Machine Learning I

Homework [Foundations]
Lecture:
Introduction (Moses)
10:30am - 12pm
Lecture:
Machine Learning I (Moses)
10:30am - 12pm
Problem Session:
10:30am - 12pm

Week 2 Apr 7 Apr 8
Apr 9
Apr 10 Apr 11 Apr 12 Apr 13
Modules
Machine Learning II

Homework
[Sentiment]
Lecture:
Machine Learning II (Moses)
10:30am - 12pm
Foundations HW due

Prerequisites Quiz due
Lecture:
Machine Learning III (Moses)
10:30am - 12pm
Problem Session:
10:30am - 12pm

Week 3 Apr 14 Apr 15
Apr 16
Apr 17 Apr 18 Apr 19 Apr 20
Modules
Search

Homework
[Route]
Lecture:
Search (Zach)
10:30am - 12pm

Project Interest Form due
Sentiment HW due Lecture:
Search & Heuristics (Zach)
10:30am - 12pm
Final Study List Deadline

Problem Session:
10:30am - 12pm

Week 4 Apr 21 Apr 22
Apr 23
Apr 24 Apr 25 Apr 26 Apr 27
Modules
MDPs I
MDPs II

Homework
[Mountaincar]
Lecture:
MDPs I (Zach)
10:30am - 12pm
Route HW due Lecture:
MDPs II (Zach)
10:30am - 12pm

Problem Session:
10:30am - 12pm

Week 5 Apr 28 Apr 29 Apr 30 May 1 May 2 May 3 May 4
Modules
Games

Homework
[Pacman]
Lecture:
Games I (Moses)
10:30am - 12pm

Project Proposal due
Mountaincar HW due Lecture:
Games II (Moses)
10:30am - 12pm


Midterm Review Session:
10:30am - 12pm

Week 6 May 5 May 6 May 7 May 8 May 9 May 10 May 11
Modules
Factor Graphs
Lecture:
Factor Graphs (Zach)
10:30am - 12pm
Lecture:
Beam Search (Zach)
10:30am - 12pm

Midterm Exam
6-8pm
Problem Session:
10:30am - 12pm

Week 7 May 12 May 13 May 14 May 15 May 16 May 17 May 18
Modules
Markov Nets
Bayesian Nets

Homework
[Scheduling]
Lecture:
Bayesian Nets I (TBD)
10:30am - 12pm

Pacman HW Due Lecture:
Bayesian Nets II (TBD)
10:30am - 12pm
Problem Session:
10:30am - 12pm

Week 8 May 19 May 20 May 21 May 22 May 23 May 24 May 25
Modules
Bayesian Nets
Logic

Homework
[Car]
Lecture:
Bayesian Nets III (Moses)
10:30am - 12pm
Scheduling HW due Lecture:
Logic I (Moses)
10:30am - 12pm
Project Progress Report due Withdrawal deadline

Problem Session:
10:30am - 12pm

Week 9 May 26 May 27 May 28 May 29 May 30 May 31 Jun 1
Modules
Logic

Homework
[Logic]
Lecture:
Memorial Day: No class
Car HW due
Lecture:
Logic II (Moses)
10:30am - 12pm
Problem Session:
10:30am - 12pm

Week 10 Jun 2 Jun 3 Jun 4 Jun 5 Jun 6 Jun 7 Jun 8
Modules
Conclusion
Lecture:
Conclusion (Moses)
10:30am - 12pm
Logic HW due

Project Final Report and Video Due
Summary and Future of AI (TBD)
10:30am - 12pm
Final Exam 3:30-5:30pm
Finals Week Jun 9 Jun 10 Jun 11 Jun 12 Jun 13 Jun 14 Jun 15
Finals Week