CS221: Artificial Intelligence: Principles and Techniques
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.
Teaching Staff
Moses
Moses Charikar
Instructor
Zachary
Zachary Robertson
Instructor
Adi
Adi Badlani
Head CA
Amelie Byun
Amelie Byun
Course Manager
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 stanfordonline-gradprograms@stanford.edu if you need general assistance. Make a public Ed post whenever possible. For extra sensitive matters, you can email cs221-staff-spr2526@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-spr2526@cs.stanford.edu by Friday, Apr 18 (Week 3).

General OAE Guidelines: IMPORTANT: If you plan to use your OAE-approved exam accommodations for a specific assessment, students must provide their letter to cs221-staff-spr2526@cs.stanford.edu by: 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. Additionally, you may not use generative AI tools to "check" your work, even if you wrote it yourself, as this is equivalent to having another student look at your answers. 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.

If you use generative AI tools, you must provide a transcript of the interaction (for example, a shared ChatGPT link or screenshots). For example, it is acceptable to use ChatGPT to help with unfamiliar syntax or to debug a specific error, provided that you include the transcript. You may not use generative AI tools that do not support attribution or transcript sharing. For example, using an agentic coding tool such as Codex or Claude Code to build a repository from a project proposal is not allowed. For the final project, we may also review commit history for evidence of overreliance on AI tools.

Honor Code Violations: 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

See also course calendar for office hours and other events.

Pre-requisite review materials: see Canvas for pre-recorded videos from previous iterations.

Monday Tuesday Wednesday Thursday Friday Saturday Sunday
Week 1 Mar 30 Mar 31 Apr 1 Apr 2 Apr 3 Apr 4 Apr 5
Modules
Week 1

HW1 Released
[Foundations]
Lecture 1:
Overview
10:30am - 12:20pm
Lecture 2:
Learning I
10:30am - 12:20pm
Problem Session 1
10:30am - 11:20am
Week 2 Apr 6 Apr 7 Apr 8 Apr 9 Apr 10 Apr 11 Apr 12
Modules
Week 2

HW2 Released
[Sentiment]
Lecture 3:
Learning II
10:30am - 12:20pm
HW1 due
11:59pm
Prerequisites quiz due
11:59pm
Lecture 4:
Learning III
10:30am - 12:20pm
Problem Session 2
10:30am - 11:20am
Week 3 Apr 13 Apr 14 Apr 15 Apr 16 Apr 17 Apr 18 Apr 19
Modules
Week 3

HW3 Released
[Route]
Lecture 5:
Search I
10:30am - 12:20pm

Project interest form due
11:59pm
HW2 due
11:59pm
Lecture 6:
Search II
10:30am - 12:20pm
Problem Session 3
10:30am - 11:20am
Week 4 Apr 20 Apr 21 Apr 22 Apr 23 Apr 24 Apr 25 Apr 26
Modules
Week 4

HW4 Released
[MountainCar]
Lecture 7:
MDPs I
10:30am - 12:20pm
HW3 due
11:59pm
Lecture 8:
MDPs II
10:30am - 12:20pm
Problem Session 4
10:30am - 11:20am
Week 5 Apr 27 Apr 28 Apr 29 Apr 30 May 1 May 2 May 3
Modules
Week 5

HW5 Released
[Pacman]
Lecture 9:
Games I
10:30am - 12:20pm

Project proposal due
11:59pm
HW4 due
11:59pm
Lecture 10:
Games II
10:30am - 12:20pm
Problem Session 5
10:30am - 11:20am
Week 6 May 4 May 5 May 6 May 7 May 8 May 9 May 10
Modules
Week 6
Lecture 11:
Factor Graphs
10:30am - 12:20pm
Lecture 12:
Beam Search
10:30am - 12:20pm

Exam 1
6-8pm
Problem Session 6
10:30am - 11:20am
Week 7 May 11 May 12 May 13 May 14 May 15 May 16 May 17
Modules
Week 7

HW6 Released
[Scheduling]
Lecture 13:
Bayesian Networks I
10:30am - 12:20pm
HW5 due
11:59pm
Lecture 14:
Bayesian Networks II
10:30am - 12:20pm
Problem Session 7
10:30am - 11:20am
Week 8 May 18 May 19 May 20 May 21 May 22 May 23 May 24
Modules
Week 8

HW7 Released
[Car]
Lecture 15:
Bayesian Networks III
10:30am - 12:20pm
HW6 due
11:59pm
Lecture 16:
Logic I
10:30am - 12:20pm
Project progress report due
11:59pm
Problem Session 8
10:30am - 11:20am
Week 9 May 25 May 26 May 27 May 28 May 29 May 30 May 31
Modules
Week 9

HW8 Released
[Logic]
Memorial Day
No lecture
HW7 due
11:59pm
Lecture 17:
Logic II
10:30am - 12:20pm
Problem Session 9
10:30am - 11:20am
Week 10 Jun 1 Jun 2 Jun 3 Jun 4 Jun 5 Jun 6 Jun 7
Modules
Week 10
Lecture 18:
Conclusion/Summary/Future of AI
10:30am - 12:20pm
HW8 due
11:59pm

Project final report and video due
11:59pm

AI Product Deep Dive due
11:59pm

(Please note: only ONE of Project and AI Product Deep Dive are due — NOT both.)

Final Exam Review
Skilling Auditorium
3:00 - 4:20pm
Exam 2
3:30-5:30pm