CS221: Artificial Intelligence: Principles and Techniques
Teaching Staff
Percy
Percy Liang
Instructor
Ken
Ken Liu
Head CA
Activities Most office hours are in person in Huang Basement or CoDa 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
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-aut25@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-aut25@cs.stanford.edu by Friday, Oct 10 (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-aut25@cs.stanford.edu by Nov 5 Wed, 2025 (Week 7) 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 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.

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, 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

New! In this new iteration of CS221 (autumn 2025), we re-designed the course structure (e.g., machine learning and search moved earlier) with some updated content (e.g., lectures on language models and society).

See also course calendar for office hours and other events.

Monday Tuesday Wednesday Thursday Friday Saturday Sunday
Week 1 Sept 22 Sept 23 Sept 24 Sept 25 Sept 26 Sept 27 Sept 28
Modules
Week 1

HW1 Released
[Foundations]
Lecture 1:
Overview
1:30pm - 2:50pm
Lecture 2:
Learning I
1:30pm - 2:50pm
Week 2 Sept 29 Sept 30 Oct 1 Oct 2 Oct 3 Oct 4 Oct 5
Modules
Week 2

HW2 Released
[Sentiment]
Lecture 3:
Learning II
1:30pm - 2:50pm
HW1 due
11:59pm
Lecture 4:
Learning III
1:30pm - 2:50pm
Week 3 Oct 6 Oct 7 Oct 8 Oct 9 Oct 10 Oct 11 Oct 12
Modules
Week 3

HW3 Released
[Route]
Lecture 5:
Search I
1:30pm - 2:50pm
HW2 due
11:59pm
Lecture 6:
Search II
1:30pm - 2:50pm
Week 4 Oct 13 Oct 14 Oct 15 Oct 16 Oct 17 Oct 18 Oct 19
Modules
Week 4

HW4 Released
[Mountaincar]
Lecture 7:
MDPs I
1:30pm - 2:50pm
HW3 due
11:59pm
Lecture 8:
MDPs II
1:30pm - 2:50pm
Week 5 Oct 20 Oct 21 Oct 22 Oct 23 Oct 24 Oct 25 Oct 26
Modules
Week 5

HW5 Released
[Pacman]
Lecture 9:
MDPs III
1:30pm - 2:50pm
HW4 due
11:59pm
Lecture 10:
Games I
1:30pm - 2:50pm
Week 6 Oct 27 Oct 28 Oct 29 Oct 30 Oct 31 Nov 1 Nov 2
Modules
Week 6

HW6 Released
[Bayesian]
Lecture 11:
Games II
1:30pm - 2:50pm
HW5 due
11:59pm
Lecture 12:
Bayesian Networks I
1:30pm - 2:50pm
Week 7 Nov 3 Nov 4 Nov 5 Nov 6 Nov 7 Nov 8 Nov 9
Modules
Week 7

HW7 Released
[Logic]
Lecture 13:
Bayesian Networks II
1:30pm - 2:50pm
HW6 due
11:59pm
Lecture 14:
Bayesian Networks III
1:30pm - 2:50pm
Week 8 Nov 10 Nov 11 Nov 12 Nov 13 Nov 14 Nov 15 Nov 16
Modules
Week 8


Lecture 15:
Logic I
1:30pm - 2:50pm
HW7 due
11:59pm
Lecture 16:
Logic II
1:30pm - 2:50pm
Project progress report due
11:59pm
Week 9 Nov 17 Nov 18 Nov 19 Nov 20 Nov 21 Nov 22 Nov 23
Modules
Week 9

HW8 Released
[Society]
Lecture 17 [New]:
Language Models
1:30pm - 2:50pm
Lecture 18 [New]:
AI & Society
1:30pm - 2:50pm

Exam
6-9pm
Thanksgiving Nov 24 Nov 25 Nov 26 Nov 27 Nov 28 Nov 29 Nov 30
Thanksgiving Break

Week 10 Dec 1 Dec 2 Dec 3 Dec 4 Dec 5 Dec 6 Dec 7
Modules
Week 10
Lecture 19 [New]:
AI Supply Chains
1:30pm - 2:50pm
HW8 due
11:59pm

Project final report and video due
11:59pm
Lecture 20:
Fireside Chat, Conclusion
1:30pm - 2:50pm