Natural Language Processing with Deep Learning

  • CS224N-2019
  • CS224N
  • Playlist
  • 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 2010s, deep learning (or neural network) approaches obtained very high performance across many different NLP tasks, using single end-to-end neural models that did not require traditional, task-specific feature engineering. In the 2020s amazing further progress was made through the scaling of Large Language Models, such as ChatGPT. In this course, students will gain a thorough introduction to both the basics of Deep Learning for NLP and the latest cutting-edge research on Large Language Models (LLMs). 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 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. Disclaimer: assignments change from year to year; please do not do assignments from previous years!

    CS224n Websites: Winter 2024 / Winter 2023 / Winter 2022 / Winter 2021 / Winter 2020 / Winter 2019 / Winter 2018 / Winter 2017 / Autumn 2015 / Autumn 2014 / Autumn 2013 / Autumn 2012 / Autumn 2011 / Winter 2011 / Spring 2010 / Spring 2009 / Spring 2008 / Spring 2007 / Spring 2006 / Spring 2005 / Spring 2004 / Spring 2003 / Spring 2002 / Spring 2000
    CS224n Lecture Videos: Winter 2023 / Winter 2021 / Winter 2019 / Winter 2017
    CS224n Reports: Winter 2024 / Winter 2023 / Winter 2022 / Winter 2021 / Winter 2020 / Winter 2019 / Winter 2018 / Winter 2017 / Autumn 2015 and earlier
    CS224d Reports: Spring 2016 / Spring 2015

    Prerequisites

    Reference Texts

    The following texts are useful, but none are required. All of them can be read free online.

    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:


    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.

    Disclaimer: Assignments change; please do not do old assignments. We will give no points for doing last year's assignments.

    Date Description Course Materials Events Deadlines
    Week 1

    Tue Apr 2
    Word Vectors
    [slides] [notes]
    Suggested Readings:
    1. Efficient Estimation of Word Representations in Vector Space (original word2vec paper)
    2. Distributed Representations of Words and Phrases and their Compositionality (negative sampling paper)
    Assignment 1 out
    [code]
    [preview]
    Thu Apr 4 Word Vectors and Language Models
    [slides] [notes] [code]
    Suggested Readings:
    1. GloVe: Global Vectors for Word Representation (original GloVe paper)
    2. Improving Distributional Similarity with Lessons Learned from Word Embeddings
    3. Evaluation methods for unsupervised word embeddings
    Additional Readings:
    1. A Latent Variable Model Approach to PMI-based Word Embeddings
    2. Linear Algebraic Structure of Word Senses, with Applications to Polysemy
    3. On the Dimensionality of Word Embedding
    Fri Apr 5 Python Review Session
    [slides] [colab]
    3:30pm - 4:20pm
    Gates B01
    Week 2

    Tue Apr 9
    Backpropagation and Neural Network Basics
    [slides] [notes]
    Suggested Readings:
    1. matrix calculus notes
    2. Review of differential calculus
    3. CS231n notes on network architectures
    4. CS231n notes on backprop
    5. Derivatives, Backpropagation, and Vectorization
    6. Learning Representations by Backpropagating Errors (seminal Rumelhart et al. backpropagation paper)
    Additional Readings:
    1. Yes you should understand backprop
    2. Natural Language Processing (Almost) from Scratch
    Assignment 2 out
    [code]
    [handout]
    [latex template]
    Assignment 1 due
    Thu Apr 11 Dependency Parsing
    [slides] [notes]
    Suggested Readings:
    1. Incrementality in Deterministic Dependency Parsing
    2. A Fast and Accurate Dependency Parser using Neural Networks
    3. Dependency Parsing
    4. Globally Normalized Transition-Based Neural Networks
    5. Universal Stanford Dependencies: A cross-linguistic typology
    6. Universal Dependencies website
    7. Jurafsky & Martin Chapter 18
    Fri Apr 12 PyTorch Tutorial Session
    [colab]
    3:30pm - 4:20pm
    Gates B01
    Week 3

    Tue Apr 16
    Recurrent Neural Networks
    [slides] [notes (lectures 5 and 6)]
    Suggested Readings:
    1. N-gram Language Models (textbook chapter)
    2. The Unreasonable Effectiveness of Recurrent Neural Networks (blog post overview)
    3. Sequence Modeling: Recurrent and Recursive Neural Nets (Sections 10.1 and 10.2)
    4. On Chomsky and the Two Cultures of Statistical Learning
    5. Sequence Modeling: Recurrent and Recursive Neural Nets (Sections 10.3, 10.5, 10.7-10.12)
    6. Learning long-term dependencies with gradient descent is difficult (one of the original vanishing gradient papers)
    7. On the difficulty of training Recurrent Neural Networks (proof of vanishing gradient problem)
    8. Vanishing Gradients Jupyter Notebook (demo for feedforward networks)
    9. Understanding LSTM Networks (blog post overview)
    Thu Apr 18 Sequence to Sequence Models and Machine Translation
    [slides] [notes (lectures 5 and 6)]
    Suggested Readings:
    1. Statistical Machine Translation slides, CS224n 2015 (lectures 2/3/4)
    2. Statistical Machine Translation (book by Philipp Koehn)
    3. BLEU (original paper)
    4. Sequence to Sequence Learning with Neural Networks (original seq2seq NMT paper)
    5. Sequence Transduction with Recurrent Neural Networks (early seq2seq speech recognition paper)
    6. Neural Machine Translation by Jointly Learning to Align and Translate (original seq2seq+attention paper)
    7. Attention and Augmented Recurrent Neural Networks (blog post overview)
    8. Massive Exploration of Neural Machine Translation Architectures (practical advice for hyperparameter choices)
    9. Achieving Open Vocabulary Neural Machine Translation with Hybrid Word-Character Models
    10. Revisiting Character-Based Neural Machine Translation with Capacity and Compression
    Assignment 3 out
    [code]
    [handout]
    [latex template]
    [overleaf link]
    Assignment 2 due
    Week 4

    Tue Apr 23
    Final Projects and LLM intro
    [slides]
    Suggested Readings:
    1. Practical Methodology (Deep Learning book chapter)
    Project Proposal out
    [handout]

    Default Final Project out
    [handout]
    Thu Apr 25 Transformers
    (by Anna Goldie)
    [slides] [notes]
    Suggested Readings:
    1. Attention Is All You Need
    2. The Illustrated Transformer
    3. Transformer (Google AI blog post)
    4. Layer Normalization
    5. Image Transformer
    6. Music Transformer: Generating music with long-term structure
    7. Jurafsky and Martin Chapter 10 (Transformers and Large Language Models)
    Week 5

    Tue Apr 30
    Pretraining
    [slides]
    Suggested Readings:
    1. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
    2. Contextual Word Representations: A Contextual Introduction
    3. The Illustrated BERT, ELMo, and co.
    4. Jurafsky and Martin Chapter 11 (Fine-Tuning and Masked Language Models)
    Assignment 4 out
    [code]
    [handout]
    [overleaf]
    [colab run script]
    Assignment 3 due
    Thu May 2 Post-training (RLHF, SFT, DPO)
    (by Archit Sharma)
    [slides]
    Suggested Readings:
    1. Aligning language models to follow instructions
    2. Scaling Instruction-Finetuned Language Models
    3. AlpacaFarm: A Simulation Framework for Methods that Learn from Human Feedback
    4. How Far Can Camels Go? Exploring the State of Instruction Tuning on Open Resources
    5. Direct Preference Optimization: Your Language Model is Secretly a Reward Model
    Fri May 3 Hugging Face Transformers Tutorial Session
    [colab]
    3:30pm - 4:20pm
    Gates B03
    Project Proposal due
    Week 6

    Tue May 7
    Benchmarking and Evaluation
    (by Yann Dubois)
    [slides]
    Suggested Readings:
    1. Challenges and Opportunities in NLP Benchmarking
    2. Measuring Massive Multitask Language Understanding
    3. Holistic Evaluation of Language Models
    4. AlpacaEval
    Thu May 9 Efficient Neural Network Training
    (by Shikhar Murty)
    [slides]
    Suggested readings:
    1. Mixed Precision Training
    2. ZeRO: Memory Optimizations Toward Training Trillion Parameter Models
    3. PyTorch FSDP: Experiences on Scaling Fully Sharded Data Parallel
    4. LoRA: Low-Rank Adaptation of Large Language Models
    Final Project Proposals Returned

    Project Milestone out
    [handout]
    Assignment 4 due
    Week 7

    Tue May 14
    Speech Brain-Computer Interface
    (by Chaofei Fan)
    [slides]
    Suggested readings:
    1. A high-performance speech neuroprosthesis
    2. An accurate and rapidly calibrating speech neuroprosthesis
    3. A high-performance neuroprosthesis for speech decoding and avatar control
    4. Brain-Machine Interfaces (Principles of Neural Science chapter)
    Thu May 16 Reasoning and Agents
    (by Shikhar Murty)
    [slides]
    Suggested readings:
    1. Orca: Progressive Learning from Complex Explanation Traces of GPT-4
    2. Least-to-Most Prompting Enables Complex Reasoning in Large Language Models
    3. ReAct: Synergizing Reasoning and Acting in Language Models
    4. BAGEL: Bootstrapping Agents by Guiding Exploration with Language
    5. WebArena: A Realistic Web Environment for Building Autonomous Agents
    Additional Readings:
    1. Reasoning or Reciting? Exploring the Capabilities and Limitations of Language Models Through Counterfactual Tasks
    2. Response: Emergent analogical reasoning in large language models
    3. WebLINX: Real-World Website Navigation with Multi-Turn Dialogue
    Week 8

    Tue May 21
    Life after DPO
    (by Nathan Lambert)
    [slides]
    Suggested readings:
    1. RewardBench: Evaluating Reward Models for Language Modeling
    2. D2PO: Discriminator-Guided DPO with Response Evaluation Models
    3. Social Choice for AI Alignment: Dealing with Diverse Human Feedback
    Wed May 22 Final Project Milestone due
    Thu May 23 ConvNets, Tree Recursive Neural Networks and Constituency Parsing
    [slides]
    Suggested readings (tentative):
    1. Convolutional Neural Networks for Sentence Classification
    2. Improving neural networks by preventing co-adaptation of feature detectors
    3. A Convolutional Neural Network for Modelling Sentences
    4. Parsing with Compositional Vector Grammars.
    5. Constituency Parsing with a Self-Attentive Encoder
    Final Project Report Instructions out
    [Instructions]
    Fri May 24
    Course Withdrawal Deadline
    Week 9

    Tue May 28
    An Introduction to Responsible NLP
    (by Adina Williams)
    Suggested readings:
    1. Preface + Introduction chapter of the FairML book by Solon Barocas, Moritz Hardt, Arvind Narayanan
    2. Introducing v0.5 of the AI Safety Benchmark from MLCommons
    Final Project Milestones Returned
    Thu May 30 NLP, linguistics, and philosophy
    [slides]
    Suggested readings:
    Week 10

    Tue June 4
    Final Project Emergency Assistance (no lecture) Extra project office hours available during usual lecture time, see Ed.
    Thu June 6 No class Final project due
    Mon June 10 Final Project Poster Session 11 am - 3 pm [More details]
    Location: McCaw Hall and Ford Gardens
    On-campus students must attend in person!
    [Printing guide]