# https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224

[CS224N Home](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/index.html)
  * [Coursework](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/index.html#coursework)
  * [Schedule](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/index.html#schedule)
  * [Office Hours](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/office_hours.html)
  * [Final projects](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project.html)
  * [Lecture Videos](https://canvas.stanford.edu/courses/146986/external_tools/3367)
  * [Ed Forum](https://edstem.org/us/courses/16260)


[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/stanford-nlp-logo-new.jpg) ](http://nlp.stanford.edu/) [ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/stanfordlogo.jpg) ](http://stanford.edu/)
# CS224n: Natural Language Processing with Deep Learning
### Stanford / Winter 2022
Natural language processing (NLP) is a crucial part of artificial intelligence (AI), modeling how people share information. In recent years, deep learning approaches have obtained very high performance on many NLP tasks. In this course, students gain a thorough introduction to cutting-edge neural networks for NLP. 
### Instructors
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/Christopher_Manning.jpg) Chris Manning ](https://nlp.stanford.edu/~manning/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/anna_goldie.png) Anna Goldie  
Head TA ](http://www.annagoldie.com/)
#### Course Coordinator
![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/amelie_byun.jpg)
Amelie Byun
### Teaching Assistants
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/kamil_ali.png) Kamil Ali ](https://www.linkedin.com/in/kamilmali/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/Gaurab_Banerjee.jpg) Gaurab Banerjee ](http://bit.ly/Gaurab)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/ethan_chi.jpg) Ethan A. Chi ](http://ethanachi.com/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/fenglu_hong.jpg) Fenglu Hong ](https://www.linkedin.com/in/fenglu-hong-ba42b8156/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/Sarthak_Kanodia.jpg) Sarthak Kanodia ](https://www.linkedin.com/in/sarthakkanodia/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/Kaili_Huang.jpg) Kaili Huang ](https://www.linkedin.com/in/huangkaili/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/grace_lam.png) Grace Lam ](https://www.linkedin.com/in/grace-lam/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/vincent_li.jpg) Vincent Li ](https://www.linkedin.com/in/songlin-li/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/eric_mitchell.jpg) Eric Mitchell ](https://ericmitchell.ai/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/ben_newman.jpeg) Ben Newman ](http://blnewman.com)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/manan_rai.jpeg) Manan Rai ](https://www.linkedin.com/in/mananrai/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/Kendrick_Shen.jpeg) Kendrick Shen ](http://kendrickshen.com/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/elaine_sui.jpg) Elaine Sui ](https://www.linkedin.com/in/elaine-sui-386766213/)
![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/angelica_sun.png)
Angelica Sun
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/christopher_wolff.jpeg) Christopher Wolff ](https://www.linkedin.com/in/christopher-wolff/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/michihiro_yasunaga.jpeg) Michihiro Yasunaga ](https://cs.stanford.edu/~myasu/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/Kathy_Yu.jpg) Kathy Yu ](http://www.linkedin.com/in/feiyang-kathy-yu-9818b7169)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/lucia_zheng.jpg) Lucia Zheng ](http://www.linkedin.com/in/zlucia)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/Yian_Zhang.jpeg) Yian Zhang ](http://yianzhang.github.io/)
[ ![](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/images/allan_zhou.jpg) Allan Zhou ](https://bland.website/)
## Logistics
  * **Lectures:** are on Tuesday/Thursday 3:15pm-4:45pm Pacific Time in [NVIDIA Auditorium](https://goo.gl/maps/hRjQYd6MqxB2). Note: lectures will be remote for the first two weeks of the quarter. The Zoom link is posted on [Canvas](https://canvas.stanford.edu/).
  * **Lecture videos for enrolled students:** are posted on [Canvas](https://canvas.stanford.edu/courses/146986/external_tools/3367) (requires login) shortly after each lecture ends. Unfortunately, it is not possible to make these videos viewable by non-enrolled students. 
  * **Publicly available lecture videos and versions of the course:** Complete videos from the 2021 edition are available (free!) on [the CS224N 2021 YouTube channel](https://www.youtube.com/playlist?list=PLoROMvodv4rOSH4v6133s9LFPRHjEmbmJ). Anyone is welcome to enroll in [XCS224N: Natural Language Processing with Deep Learning](https://online.stanford.edu/courses/xcs224n-natural-language-processing-deep-learning), the Stanford Artificial Intelligence Professional Program version of this course, throughout the year (medium fee, community TAs and certificate). Stanford students enroll normally in CS224N and others can also enroll in [CS224N via Stanford online](https://online.stanford.edu/courses/cs224n-natural-language-processing-deep-learning) in the (northern hemisphere) Autumn to do the course in the Winter (high cost, limited enrollment, gives Stanford credit). The lecture slides and assignments are updated online each year as the course progresses. We are happy for anyone to use these resources, and we are happy to get acknowledgements.
  * **Office hours** : Hybrid format with remote (over Zoom) or in person options. Information [here](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/office_hours.html).
  * **Contact** : Students should ask _all_ course-related questions in the Ed forum, where you will also find announcements. You will find the course Ed on the course Canvas page or in the header link above. For external enquiries, emergencies, or personal matters that you don't wish to put in a private Ed post, you can email us at _cs224n-win2122-staff@lists.stanford.edu_.


## Content
### What is this course about?
Natural language processing (NLP) or computational linguistics is one of the most important technologies of the information age. Applications of NLP are everywhere because people communicate almost everything in language: web search, advertising, emails, customer service, language translation, virtual agents, medical reports, politics, etc. In the last decade, deep learning (or neural network) approaches have obtained very high performance across many different NLP tasks, using single end-to-end neural models that do not require traditional, task-specific feature engineering. In this course, students will gain a thorough introduction to cutting-edge research in Deep Learning for NLP. Through lectures, assignments and a final project, students will learn the necessary skills to design, implement, and understand their own neural network models, using the [Pytorch](https://pytorch.org/) framework. 
> _“Take it. CS221 taught me algorithms. CS229 taught me math. CS224N taught me how to write machine learning models.”_ – A CS224N student on Carta 
### Previous offerings
Below you can find archived websites and student project reports from previous years.   
|  **CS224n Websites** : [Winter 2021](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1214) / [Winter 2020](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1204) / [Winter 2019](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1194) / [Winter 2018](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1184) / [Winter 2017](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1174) / [Autumn 2015](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1162) / [Autumn 2014](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1152) / [Autumn 2013](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1142) / [Autumn 2012](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1132) / [Autumn 2011](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1122) / [Winter 2011](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1114) / [Spring 2010](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1106) / [Spring 2009](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1096) / [Spring 2008](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1086) / [Spring 2007](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1076) / [Spring 2006](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1066) / [Spring 2005](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1056) / [Spring 2004](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1046) / [Spring 2003](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1036) / [Spring 2002](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1026) / [Spring 2000](https://web.stanford.edu/class/archive/cs/cs224n/manning.499)  |  
| --- |  
|  **CS224n Lecture Videos** : [Winter 2021](https://www.youtube.com/playlist?list=PLoROMvodv4rOSH4v6133s9LFPRHjEmbmJ) / [Winter 2019](https://www.youtube.com/playlist?list=PLoROMvodv4rOhcuXMZkNm7j3fVwBBY42z) / [Winter 2017](https://www.youtube.com/playlist?list=PL3FW7Lu3i5Jsnh1rnUwq_TcylNr7EkRe6)  |  
|  **CS224n Reports** : [Winter 2021](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1214/project.html) / [Winter 2020](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1204/project.html) / [Winter 2019](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1194/project.html) / [Winter 2018](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1184/reports.html) / [Winter 2017](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1174/reports.html) / [Autumn 2015 and earlier](http://nlp.stanford.edu/courses/cs224n/)  |  
|  **CS224d Reports** : [Spring 2016](http://cs224d.stanford.edu/reports_2016.html) / [Spring 2015](http://cs224d.stanford.edu/reports_2015.html)  |  
### Prerequisites
  * **Proficiency in Python**
All class assignments will be in Python (using [NumPy](https://numpy.org/) and [PyTorch](https://pytorch.org)). If you need to remind yourself of Python, or you're not very familiar with NumPy, you can come to the Python review session in week 1 (listed in the [schedule](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/#schedule)). If you have a lot of programming experience but in a different language (e.g. C/C++/Matlab/Java/Javascript), you will probably be fine.
  * **College Calculus, Linear Algebra** (e.g. MATH 51, CME 100) 
You should be comfortable taking (multivariable) derivatives and understanding matrix/vector notation and operations.
  * **Basic Probability and Statistics** (e.g. CS 109 or equivalent) 
You should know the basics of probabilities, gaussian distributions, mean, standard deviation, etc.
  * **Foundations of Machine Learning** (e.g. CS221, CS229, CS230, or CS124) 
We will be formulating cost functions, taking derivatives and performing optimization with gradient descent. If you already have basic machine learning and/or deep learning knowledge, the course will be easier; however it is possible to take CS224n without it. There are many introductions to ML, in webpage, book, and video form. One approachable introduction is Hal Daumé’s in-progress [_A Course in Machine Learning_](http://ciml.info). Reading the first 5 chapters of that book would be good background. Knowing the first 7 chapters would be even better!


### Reference Texts
The following texts are useful, but none are required. All of them can be read free online. 
  * Dan Jurafsky and James H. Martin. [Speech and Language Processing (3rd ed. draft)](https://web.stanford.edu/~jurafsky/slp3/)
  * Jacob Eisenstein. [Natural Language Processing](https://github.com/jacobeisenstein/gt-nlp-class/blob/master/notes/eisenstein-nlp-notes.pdf)
  * Yoav Goldberg. [A Primer on Neural Network Models for Natural Language Processing](http://u.cs.biu.ac.il/~yogo/nnlp.pdf)
  * Ian Goodfellow, Yoshua Bengio, and Aaron Courville. [Deep Learning](http://www.deeplearningbook.org/)
  * Delip Rao and Brian McMahan. [Natural Language Processing with PyTorch](http://library.stanford.edu/sfx?genre=book&atitle=&title=Natural%20language%20processing%20with%20PyTorch%20:%20build%20intelligent%20language%20applications%20using%20deep%20learning%20/&isbn=9781491978207&volume=&issue=&date=20190101&aulast=Rao,%20Delip,,%20author.&spage=&pages=&sid=EBSCO:VLeBooks:edsvle.AH35866319) (requires Stanford login). 


If you have no background in neural networks but would like to take the course anyway, you might well find one of these books helpful to give you more background: 
  * Michael A. Nielsen. [Neural Networks and Deep Learning](http://neuralnetworksanddeeplearning.com)
  * Eugene Charniak. [Introduction to Deep Learning](https://mitpress.mit.edu/books/introduction-deep-learning)


  

## Coursework
### Assignments (54%)
There are five weekly assignments, which will improve both your theoretical understanding and your practical skills. All assignments contain both written questions and programming parts. In office hours, TAs may look at students’ code for assignments 1, 2 and 3 but not for assignments 4 and 5. 
  * **Credit** : 
    * Assignment 1 (6%): Introduction to word vectors
    * Assignment 2 (12%): Derivatives and implementation of word2vec algorithm
    * Assignment 3 (12%): Dependency parsing and neural network foundations
    * Assignment 4 (12%): Neural Machine Translation with sequence-to-sequence, attention, and subwords
    * Assignment 5 (12%): Self-supervised learning and fine-tuning with Transformers
  * **Deadlines** : All assignments are due on either a Tuesday or a Thursday _before class_ (i.e. before 3:15pm). All deadlines are listed in the [schedule](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/#schedule).
  * **Submission** : Assignments are submitted via [Gradescope](https://www.gradescope.com/courses/225374). You will be able to access the course Gradescope page on Canvas. If you need to sign up for a Gradescope account, please use your _@stanford.edu_ email address. Further instructions are given in each assignment handout. _Do not email us your assignments_.
  * **Late start** : If the result gives you a higher grade, we will not use your assignment 1 score, and we will give you an assignment grade based on counting each of assignments 2–5 at 13.5%.
  * **Collaboration** : Study groups are allowed, but students must understand and complete their own assignments, and hand in one assignment per student. If you worked in a group, please put the names of the members of your study group at the top of your assignment. Please ask if you have any questions about the collaboration policy. 
  * **Honor Code** : We expect students to not look at solutions or implementations online. Like all other classes at Stanford, we take the student [Honor Code](https://ed.stanford.edu/academics/masters-handbook/honor-code) seriously. We sometimes use automated methods to detect overly similar assignment solutions. 


### Final Project (43%)
The Final Project offers you the chance to apply your newly acquired skills towards an in-depth application. Students have two options: the **Default Final Project** (in which students tackle a predefined task, namely textual Question Answering) or a **Custom Final Project** (in which students choose their own project involving human language and deep learning). Examples of both can be seen on [last year's website](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1204/project.html). 
#### Important information
  * **Credit** : For both default and custom projects, credit for the final project is broken down as follows: 
    * Project proposal (5%) [[instructions](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/project-proposal-instructions-2022.pdf)] 
    * Project milestone (5%) [[instructions](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/project-milestone-instructions-2022.pdf)] 
    * Project poster (3%) 
    * Project report (30%) [[instructions](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/project-report-instructions-2022.pdf)] 
  * **Deadlines** : The project proposal, milestone and report are all due at 3:15pm. All deadlines are listed in the [schedule](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/#schedule).
  * **Default Final Project** [[handout (IID SQuAD track)](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/default-final-project-handout-squad-track.pdf)] [[handout (Robust QA track)](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/default-final-project-handout-robustqa-track.pdf)] [[lecture slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2020-lecture10-QA.pdf)]: In this project, students explore deep learning solutions to the [SQuAD (Stanford Question Asking Dataset) challenge](https://rajpurkar.github.io/SQuAD-explorer/). This year's project is similar to last year's, on SQuAD 2.0 with baseline code in PyTorch. 
  * **Project advice** [[lecture slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture08-final-project.pdf)] [[custom project tips](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/custom-final-project-tips.pdf)]: The _Practical Tips for Final Projects_ lecture provides guidance for choosing and planning your project. To get project advice from staff members, first look at each staff member's areas of expertise on the [office hours page](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/office_hours.html#staff). This should help you find a staff member who is knowledgable about your project area. 


#### Practicalities
  * **Team size** : Students may do final projects solo, or in teams of up to 3 people. We strongly recommend you do the final project in a team. Larger teams are expected to do correspondingly larger projects, and you should only form a 3-person team if you are planning to do an ambitious project where every team member will have a significant contribution.
  * **Contribution** : In the final report we ask for a statement of what each team member contributed to the project. Team members will typically get the same grade, but we may differentiate in extreme cases of unequal contribution. You can contact us in confidence in the event of unequal contribution.
  * **External collaborators** : You can work on a project that has external (non CS224n student) collaborators, but you must make it clear in your final report which parts of the project were your work.
  * **Sharing projects** : You can share a single project between CS224n and another class, but we expect the project to be accordingly bigger, and you must declare that you are sharing the project in your project proposal.
  * **Mentors** : Every custom project team has a mentor, who gives feedback and advice during the project. Default project teams do not have mentors. A project may have an external (i.e., not course staff) mentor; otherwise, we will assign a CS224n staff mentor to custom project teams after project proposals. 
  * **Computing resources** : All teams will receive credits to use the cloud computing service Azure, thanks to a kind donation by Microsoft!
  * **Using external resources** : The following guidelines apply to all projects (though the default project has some more specific rules, details TBA): 
    * You can use any deep learning framework you like (PyTorch, TensorFlow, etc.)
    * More generally, you may use any existing code, libraries, etc. and consult any papers, books, online references, etc. for your project. However, you must cite your sources in your writeup and clearly indicate which parts of the project are your contribution and which parts were implemented by others.
    * Under no circumstances may you look at another CS224n group’s code, or incorporate their code into your project.


### Participation (3%)
We appreciate everyone being actively involved in the class! There are several ways of earning participation credit, which is capped at 3%: 
  * **Attending guest speakers' lectures** :
    * In the second half of the class, we have three invited speakers. Our guest speakers make a significant effort to come lecture for us, so (both to show our appreciation and to continue attracting interesting speakers) we do not want them lecturing to a largely empty room. As such, we encourage students to attend these virutal lectures live, and participate in Q&A.
    * All students get 0.5% per speaker (1.5% total) for either attending the guest lecture in person, or by writing a reaction paragraph if you watched the talk remotely; details will be provided. Students do not need to attend lecture live to write these reaction paragraphs; they may watch asynchronously. 
  * **Completing feedback surveys** : We will send out two feedback surveys (mid-quarter and end-of-quarter) to help us understand how the course is going, and how we can improve. Each of the two surveys are worth 0.5%.
  * **Ed participation** : The top ~20 contributors to Ed will get 3%; others will get credit in proportion to the participation of the ~20th person.
  * **Karma point** : Any other act that improves the class, like helping out another student in office hours, which a CS224n TA or instructor notices and deems worthy: 1%


### Late Days
  * Each student has 6 late days to use. A late day extends the deadline 24 hours. You can use up to 3 late days per assignment (including all five assignments, project proposal, project milestone and project final report).
  * Teams can **share** late days between members. For example, a group of three people must have at least six late days between them to extend the deadline by two days. _If any late days are being shared, this must be clearly marked at the beginning of the report, and fill out the form linked in[this Ed post](https://edstem.org/us/courses/16260/discussion/1112679)_.
  * Once you have used all 6 late days, the penalty is 1% off the final course grade for each additional late day.


### Regrade Requests
If you feel you deserved a better grade on an assignment, you may submit a regrade request on Gradescope within 3 days after the grades are released. Your request should briefly summarize why you feel the original grade was unfair. Your TA will reevaluate your assignment as soon as possible, and then issue a decision. If you are still not happy, you can ask for your assignment to be regraded by an instructor. 
### Credit/No credit enrollment
If you take the class credit/no credit then you are graded in the same way as those registered for a letter grade. The only difference is that, providing you reach a C- standard in your work, it will simply be graded as CR. 
### All students welcome
We are committed to doing what we can to work for equity and to create an inclusive learning environment that actively values the diversity of backgrounds, identities, and experiences of everyone in CS224N. We also know that we will sometimes make missteps. If you notice some way that we could do better, we hope that you will let someone in the course staff know about it. 
### Well-Being and Mental Health
The last two years have been difficult for everyone. We’re here for you to try to help you get through a couple more quarters of the pandemic. If you are experiencing personal, academic, or relationship problems and would like to talk to someone with training and experience, reach out to the [Counseling and Psychological Services (CAPS)](https://vaden.stanford.edu/caps-and-wellness) on campus. CAPS is the university’s counseling center dedicated to student mental health and wellbeing. Phone assessment appointments can be made at CAPS by calling 650-723-3785, or by accessing the VadenPatient portal through the Vaden website. 
### Auditing the course
In general we are happy to have auditors if they are a member of the Stanford community (registered student, official visitor, staff, or faculty). If you want to actually master the material of the class, we very strongly recommend that auditors do all the assignments. However, due to high enrollment, we cannot grade the work of any students who are not officially enrolled in the class. 
### Students with Documented Disabilities
We assume that all of us learn in different ways, and that the organization of the course must accommodate each student differently. We are committed to ensuring the full participation of all enrolled students in this class. If you need an academic accommodation based on a disability, you should initiate the request with the [Office of Accessible Education (OAE)](https://oae.stanford.edu/). The OAE will evaluate the request, recommend accommodations, and prepare a letter for faculty. Students should contact the OAE as soon as possible and at any rate in advance of assignment deadlines, since timely notice is needed to coordinate accommodations. Students should also send your accommodation letter to either the staff mailing list (_cs224n-win2122-staff@lists.stanford.edu_) or make a private post on Ed, as soon as possible. 
### Sexual violence
Academic accommodations are available for students who have experienced or are recovering from sexual violence. If you would like to talk to a confidential resource, you can schedule a meeting with the Confidential Support Team or call their 24/7 hotline at: 650-725-9955. Counseling and Psychological Services also offers confidential counseling services. Non-confidential resources include the Title IX Office, for investigation and accommodations, and the SARA Office, for healing programs. Students can also speak directly with the teaching staff to arrange accommodations. Note that university employees – including professors and TAs – are required to report what they know about incidents of sexual or relationship violence, stalking and sexual harassment to the Title IX Office. Students can learn more at [https://vaden.stanford.edu/sexual-assault](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/are%20recovering%20from). 
  

## Schedule
Updated lecture **slides** will be posted here shortly before each lecture. Other links contain last year's slides, which are mostly similar. 
Lecture **notes** will be uploaded a few days after most lectures. The notes (which cover approximately the first half of the course content) give supplementary detail beyond the lectures.   
| Date  | Description  | Course Materials  | Events  | Deadlines  |  
| --- | --- | --- | --- | --- |  
| Tue Jan 4  | Word Vectors   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture01-wordvecs1.pdf)]  [[notes](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-2019-notes01-wordvecs1.pdf)]   
  
Gensim word vectors example:   
[[code](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/materials/Gensim.zip)] [[preview](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/materials/Gensim%20word%20vector%20visualization.html)]   |  Suggested Readings: 
  1. [Efficient Estimation of Word Representations in Vector Space](http://arxiv.org/pdf/1301.3781.pdf) (original word2vec paper)
  2. [Distributed Representations of Words and Phrases and their Compositionality](http://papers.nips.cc/paper/5021-distributed-representations-of-words-and-phrases-and-their-compositionality.pdf) (negative sampling paper)

 |  Assignment 1 **out**   
[[code](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a1.zip)]   
[[preview](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a1_preview/exploring_word_vectors.html)]   |   |  
| Thu Jan 6  | Word Vectors 2 and Word Window Classification   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture02-wordvecs2.pdf)]  [[notes](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-2019-notes02-wordvecs2.pdf)]   |  Suggested Readings: 
  1. [GloVe: Global Vectors for Word Representation](http://nlp.stanford.edu/pubs/glove.pdf) (original GloVe paper)
  2. [Improving Distributional Similarity with Lessons Learned from Word Embeddings](http://www.aclweb.org/anthology/Q15-1016)
  3. [Evaluation methods for unsupervised word embeddings](http://www.aclweb.org/anthology/D15-1036)

Additional Readings: 
  1. [A Latent Variable Model Approach to PMI-based Word Embeddings](http://aclweb.org/anthology/Q16-1028)
  2. [Linear Algebraic Structure of Word Senses, with Applications to Polysemy](https://transacl.org/ojs/index.php/tacl/article/viewFile/1346/320)
  3. [On the Dimensionality of Word Embedding](https://papers.nips.cc/paper/7368-on-the-dimensionality-of-word-embedding.pdf)

 |   |   |  
| Fri Jan 7  | Python Review Session   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-python-review.pdf)] [[notebook](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/python_tutorial.ipynb)]   |  1:30pm - 2:30pm  
Remote (link on Canvas)   |   |   |  
| Tue Jan 11  | Backprop and Neural Networks   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture03-neuralnets.pdf)] [[notes](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-2019-notes03-neuralnets.pdf)]   |  Suggested Readings: 
  1. [matrix calculus notes](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/gradient-notes.pdf)
  2. [Review of differential calculus](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/review-differential-calculus.pdf)
  3. [CS231n notes on network architectures](http://cs231n.github.io/neural-networks-1/)
  4. [CS231n notes on backprop](http://cs231n.github.io/optimization-2/)
  5. [Derivatives, Backpropagation, and Vectorization](http://cs231n.stanford.edu/handouts/derivatives.pdf)
  6. [Learning Representations by Backpropagating Errors](http://www.iro.umontreal.ca/~vincentp/ift3395/lectures/backprop_old.pdf) (seminal Rumelhart et al. backpropagation paper)

Additional Readings: 
  1. [Yes you should understand backprop](https://medium.com/@karpathy/yes-you-should-understand-backprop-e2f06eab496b)
  2. [Natural Language Processing (Almost) from Scratch](http://www.jmlr.org/papers/volume12/collobert11a/collobert11a.pdf)

 |  Assignment 2 **out**   
[[code](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a2.zip)]  
[[handout](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a2.pdf)]  
[[latex template](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a2_latex_template.zip)]   | Assignment 1 **due**  |  
| Thu Jan 13  | Dependency Parsing   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture04-dep-parsing.pdf)] [[notes](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-2019-notes04-dependencyparsing.pdf)]   
[[slides (annotated)](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2021-lecture04-dep-parsing-annotated.pdf)]   |  Suggested Readings: 
  1. [Incrementality in Deterministic Dependency Parsing](https://www.aclweb.org/anthology/W/W04/W04-0308.pdf)
  2. [A Fast and Accurate Dependency Parser using Neural Networks](https://www.emnlp2014.org/papers/pdf/EMNLP2014082.pdf)
  3. [Dependency Parsing](http://www.morganclaypool.com/doi/abs/10.2200/S00169ED1V01Y200901HLT002)
  4. [Globally Normalized Transition-Based Neural Networks](https://arxiv.org/pdf/1603.06042.pdf)
  5. [Universal Stanford Dependencies: A cross-linguistic typology](http://nlp.stanford.edu/~manning/papers/USD_LREC14_UD_revision.pdf)
[ ](http://nlp.stanford.edu/~manning/papers/USD_LREC14_UD_revision.pdf)
  6. [](http://nlp.stanford.edu/~manning/papers/USD_LREC14_UD_revision.pdf)[Universal Dependencies website](http://universaldependencies.org/)
  7. [Jurafsky & Martin Chapter 14](https://web.stanford.edu/~jurafsky/slp3/14.pdf)

 |   |   |  
| Fri Jan 14  | PyTorch Tutorial Session   
[[colab notebook](https://colab.research.google.com/drive/13HGy3-uIIy1KD_WFhG4nVrxJC-3nUUkP?usp=sharing)]   |  1:30pm - 2:30pm  
Remote (link on Canvas)   |   |   |  
| Tue Jan 18  | Recurrent Neural Networks and Language Models   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture05-rnnlm.pdf)] [[notes (lectures 5 and 6)](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-2019-notes05-LM_RNN.pdf)]   |  Suggested Readings: 
  1. [N-gram Language Models](https://web.stanford.edu/~jurafsky/slp3/3.pdf) (textbook chapter)
  2. [The Unreasonable Effectiveness of Recurrent Neural Networks](http://karpathy.github.io/2015/05/21/rnn-effectiveness/) (blog post overview)
  3. [Sequence Modeling: Recurrent and Recursive Neural Nets](http://www.deeplearningbook.org/contents/rnn.html) (Sections 10.1 and 10.2)
  4. [On Chomsky and the Two Cultures of Statistical Learning](http://norvig.com/chomsky.html)

 | Assignment 3 **out**   
[[code](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a3.zip)]  
[[handout](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a3_handout.pdf)]  
[[latex template](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a3_latex.zip)]  
 | Assignment 2 **due**  |  
| Thu Jan 20  | Vanishing Gradients, Fancy RNNs, Seq2Seq   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture06-fancy-rnn.pdf)] [[notes (lectures 5 and 6)](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-2019-notes05-LM_RNN.pdf)]   |  Suggested Readings: 
  1. [Sequence Modeling: Recurrent and Recursive Neural Nets](http://www.deeplearningbook.org/contents/rnn.html) (Sections 10.3, 10.5, 10.7-10.12)
  2. [Learning long-term dependencies with gradient descent is difficult](http://ai.dinfo.unifi.it/paolo//ps/tnn-94-gradient.pdf) (one of the original vanishing gradient papers)
  3. [On the difficulty of training Recurrent Neural Networks](https://arxiv.org/pdf/1211.5063.pdf) (proof of vanishing gradient problem)
  4. [Vanishing Gradients Jupyter Notebook](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1174/lectures/vanishing_grad_example.html) (demo for feedforward networks)
  5. [Understanding LSTM Networks](http://colah.github.io/posts/2015-08-Understanding-LSTMs/) (blog post overview)

 |   |   |  
| Tue Jan 25  | Machine Translation, Attention, Subword Models   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture07-nmt.pdf)] [[notes](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-2019-notes06-NMT_seq2seq_attention.pdf)]   |  Suggested Readings: 
  1. [Statistical Machine Translation slides, CS224n 2015](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1162/syllabus.shtml) (lectures 2/3/4)
  2. [Statistical Machine Translation](https://www.cambridge.org/core/books/statistical-machine-translation/94EADF9F680558E13BE759997553CDE5) (book by Philipp Koehn)
  3. [BLEU](https://www.aclweb.org/anthology/P02-1040.pdf) (original paper)
  4. [Sequence to Sequence Learning with Neural Networks](https://arxiv.org/pdf/1409.3215.pdf) (original seq2seq NMT paper)
  5. [Sequence Transduction with Recurrent Neural Networks](https://arxiv.org/pdf/1211.3711.pdf) (early seq2seq speech recognition paper)
  6. [Neural Machine Translation by Jointly Learning to Align and Translate](https://arxiv.org/pdf/1409.0473.pdf) (original seq2seq+attention paper)
  7. [Attention and Augmented Recurrent Neural Networks](https://distill.pub/2016/augmented-rnns/) (blog post overview)
  8. [Massive Exploration of Neural Machine Translation Architectures](https://arxiv.org/pdf/1703.03906.pdf) (practical advice for hyperparameter choices)
  9. [Achieving Open Vocabulary Neural Machine Translation with Hybrid Word-Character Models](https://arxiv.org/abs/1604.00788.pdf)
  10. [Revisiting Character-Based Neural Machine Translation with Capacity and Compression](https://arxiv.org/pdf/1808.09943.pdf)

 | Assignment 4 **out**   
[[code](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a4.zip)]  
[[handout](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a4.pdf)]  
[[latex template](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a4_latex.zip)]  
[[Azure Guide](https://docs.google.com/document/d/10rhknu-xJJCHUQx3DPqKuHT35EqftmZ1rEdR1nJoBFo/edit?usp=sharing)]  
[[Practical Guide to VMs](https://docs.google.com/document/d/1jtANWXbIYXMZO_2X7jupauPxcEbz-TVJkdatg4gzOdk/edit?usp=sharing)]  
 | Assignment 3 **due**  |  
| Thu Jan 27  | Final Projects: Custom and Default; Practical Tips   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture08-final-project.pdf)] [[Custom project tips](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/custom-final-project-tips.pdf)]   |  Suggested Readings: 
  1. [Practical Methodology](https://www.deeplearningbook.org/contents/guidelines.html) (_Deep Learning_ book chapter)

 | Project Proposal **out**   
[[instructions](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/project-proposal-instructions-2022.pdf)]   
  
Default Final Project **out**   
[[handout (IID SQuAD track)](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/default-final-project-handout-squad-track.pdf)]   
[[handout (Robust QA track)](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/default-final-project-handout-robustqa-track.pdf)]   |   |  
| Tue Feb 1  | Transformers _(by Anna Goldie)_   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture09-transformers.pdf)]   |  Suggested Readings: 
  1. [Project Handout (IID SQuAD track)](http://web.stanford.edu/class/cs224n/project/default-final-project-handout-squad-track.pdf)
  2. [Project Handout (Robust QA track)](http://web.stanford.edu/class/cs224n/project/default-final-project-handout-robustqa-track.pdf)
  3. [Attention Is All You Need](https://arxiv.org/abs/1706.03762.pdf)
  4. [The Illustrated Transformer](https://jalammar.github.io/illustrated-transformer/)
  5. [Transformer (Google AI blog post)](https://ai.googleblog.com/2017/08/transformer-novel-neural-network.html)
  6. [Layer Normalization](https://arxiv.org/pdf/1607.06450.pdf)
  7. [Image Transformer](https://arxiv.org/pdf/1802.05751.pdf)
  8. [Music Transformer: Generating music with long-term structure](https://arxiv.org/pdf/1809.04281.pdf)

 |   |   |  
| Thu Feb 3  | More about Transformers and Pretraining _(by Anna Goldie)_   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture10-pretraining.pdf)]   |  Suggested Readings: 
  1. [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/pdf/1810.04805.pdf)
  2. [Contextual Word Representations: A Contextual Introduction](https://arxiv.org/abs/1902.06006.pdf)
  3. [The Illustrated BERT, ELMo, and co.](http://jalammar.github.io/illustrated-bert/)
  4. [Martin & Jurafsky Chapter on Transfer Learning](https://web.stanford.edu/~jurafsky/slp3/11.pdf)

 | Assignment 5 **out**   
[[code](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a5.zip)]  
[[handout](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a5.pdf)]  
[[latex template](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/assignments/a5_latex.zip)]   |   |  
| Fri Feb 4  | Hugging Face Transformers Tutorial Session   |  1:30pm - 2:30pm  
Thornton 102 (will be recorded)   | [Colab](https://colab.research.google.com/drive/1pxc-ehTtnVM72-NViET_D2ZqOlpOi2LH?usp=sharing)  |   |  
| Tue Feb 8  | Question Answering   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/Danqi-QA-slides-2022.pdf)] [[notes](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/readings/cs224n-2019-notes07-QA.pdf)]   |  Suggested Readings: 
  1. [SQuAD: 100,000+ Questions for Machine Comprehension of Text](https://arxiv.org/pdf/1606.05250.pdf)
  2. [Bidirectional Attention Flow for Machine Comprehension](https://arxiv.org/pdf/1611.01603.pdf)
  3. [Reading Wikipedia to Answer Open-Domain Questions](https://arxiv.org/pdf/1704.00051.pdf)
  4. [Latent Retrieval for Weakly Supervised Open Domain Question Answering](https://arxiv.org/pdf/1906.00300.pdf)
  5. [Dense Passage Retrieval for Open-Domain Question Answering](https://arxiv.org/pdf/2004.04906.pdf)
  6. [Learning Dense Representations of Phrases at Scale](https://arxiv.org/pdf/2012.12624.pdf)

 |   | Project Proposal **due**  
Assignment 4 **due**  |  
| Thu Feb 10  | Natural Language Generation   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture12-generation-final.pdf)]   |  Suggested readings: 
  1. [The Curious Case of Neural Text Degeneration](https://arxiv.org/abs/1904.09751.pdf)
  2. [Get To The Point: Summarization with Pointer-Generator Networks](https://arxiv.org/abs/1704.04368.pdf)
  3. [Hierarchical Neural Story Generation](https://arxiv.org/abs/1805.04833.pdf)
  4. [How NOT To Evaluate Your Dialogue System](https://arxiv.org/abs/1603.08023.pdf)

 |   |   |  
| Tue Feb 15  | Integrating knowledge in language models [[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture-knowledge.pdf)]   |  Suggested readings: 
  1. [ERNIE: Enhanced Language Representation with Informative Entities](https://arxiv.org/pdf/1905.07129.pdf)
  2. [Barack’s Wife Hillary: Using Knowledge Graphs for Fact-Aware Language Modeling](https://arxiv.org/pdf/1906.07241.pdf)
  3. [Pretrained Encyclopedia: Weakly Supervised Knowledge-Pretrained Language Model](https://arxiv.org/pdf/1912.09637.pdf)
  4. [Language Models as Knowledge Bases?](https://www.aclweb.org/anthology/D19-1250.pdf)

 | Project Milestone **out**  
[[Instructions](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/CS224N_Final_Project_Milestone_Instructions.pdf)]  |   |  
| Thu Feb 17  | Bias, toxicity, and fairness  
_(by[Maarten Sap](https://homes.cs.washington.edu/~msap/))_  |  Suggested readings: 
  1. [The Risk of Racial Bias in Hate Speech Detection](https://homes.cs.washington.edu/~msap/pdfs/sap2019risk.pdf)
  2. [Social Bias Frames](https://homes.cs.washington.edu/~msap/social-bias-frames/)
  3. [PowerTransformer: Unsupervised Controllable Revision for Biased Language Correction](https://arxiv.org/abs/2010.13816)

 |   | Assignment 5 **due**  |  
| Tue Feb 22  | Retrieval Augmented Models + Knowledge  
_(by[Kelvin Guu](https://www.kelvinguu.com/))_   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture15-guu.pdf)]  
 |  Suggested readings: 
  1. [Locating and Editing Factual Knowledge in GPT](https://arxiv.org/abs/2202.05262)
  2. [LaMDA: Language Models for Dialog Applications](https://arxiv.org/abs/2201.08239)
  3. [REALM: Retrieval-Augmented Language Model Pre-Training](https://arxiv.org/abs/2002.08909)

 |   |   |  
| Thu Feb 24  | ConvNets, Tree Recursive Neural Networks and Constituency Parsing   
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture16-CNN-TreeRNN.pdf)]   | Suggested readings: 
  1. [Convolutional Neural Networks for Sentence Classification](https://arxiv.org/abs/1408.5882.pdf)
  2. [Improving neural networks by preventing co-adaptation of feature detectors](https://arxiv.org/abs/1207.0580)
  3. [A Convolutional Neural Network for Modelling Sentences](https://arxiv.org/pdf/1404.2188.pdf)
  4. [Parsing with Compositional Vector Grammars.](http://www.aclweb.org/anthology/P13-1045)
  5. [Constituency Parsing with a Self-Attentive Encoder](https://arxiv.org/pdf/1805.01052.pdf)

 |   | Project Milestone **due**  |  
| Tue Mar 1  | Scaling laws for large models  
_(by[Jared Kaplan](https://sites.krieger.jhu.edu/jared-kaplan/))_  | Suggested readings: 
  1. [Scaling Laws for Neural Language Models](https://arxiv.org/abs/2001.08361)

 |   |   |  
| Thu Mar 3  | Coreference  
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture18-coref.pdf)]   | Suggested readings: 
  1. [Coreference Resolution Chapter from Jurafsky and Martin](https://web.stanford.edu/~jurafsky/slp3/21.pdf)
  2. [End-to-end Neural Coreference Resolution](https://arxiv.org/pdf/1707.07045.pdf)

 |   |   |  
| Tue Mar 8  | Editing Neural Networks  
[[slides](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/slides/cs224n-2022-lecture-editing.pdf)]   |   |   |   |  
| Thu Mar 10  | [Lecture Cancelled]   | Extra project office hours available during usual lecture time, see Ed.  |   |   |  
| Sun Mar 13  |   |   |   |  Project **due** [[instructions](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/project-report-instructions-2022.pdf)]   |  
| Monday Mar 14  | Poster Session   |  Note: Only open to the Stanford community and invited guests.  
12:00pm-4:30 [[More details](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project.html)]  
Alumni Center McCaw Hall/Ford Gardens   |   | [[Printing guide](https://web.stanford.edu/class/archive/cs/cs224n/cs224n.1224/project/poster_printing_suggestions.pdf)]  |
