Link Search Menu Expand Document

CS329D: ML Under Distribution Shifts

A graduate course surveying topics in machine learning when the training and test data arise from different distributions.

Tatsunori Hashimoto


Office Hours: TBD


The progress of machine learning systems has seemed remarkable and inexorable — a wide array of benchmark tasks including image classification, speech recognition, and question answering have seen consistent and substantial accuracy gains year on year. However, these same models are known to fail consistently on atypical examples and domains not contained within the training data. This course will cover methods for understanding and improving machine learning under distributional shifts, where the training and test distribution for a model are mismatched.

Course goals

The course aims to cover recent research on the following topics:

  • Definition of various distribution shifts in terms of distributional overlap or as the result of changes to the environment.
  • Real-world distribution shifts: domain adaptation in NLP and vision as well as fairness in prediction tasks.
  • Methods for improving robustness: neural approaches, invariance constraints, and minimax losses.
  • Adversarial shifts: adversarial examples in image recognition, provable defenses, and data poisoning.

The goal of the course is to introduce the variety of areas in which distributional shifts are central and equip students with the fundamentals necessary to conduct research on developing more robust machine learning methods. Because of this goal, the course will aim to cover the classic papers and basic concepts in this area, rather than spend the quarter on any single task or problem.

Course activities

The course will consist of three kinds of activities

  • Lectures: The course will consist of 10 lectures, covering domain adaptation theory and methods, representation-based approaches to robustness, minimax methods, adversarial examples, and data poisoning.
  • Paper discussions: There will be 9 student driven discussion and critique sessions in which we go over and discuss selected papers in each area.
  • Project: Each student will be responsible for implementing and testing one of the methods from the class on a distribution shift task of their choice.

The instructors will have open office hours on zoom. Please check canvas for the zoom link (this is to restrict the office hours to enrolled students).

For details on grading and other accommodations see the course policies


All lectures and discussions will be held in person in Hewlett 103. Discussions will be held on Mondays from 3:15-4:45pm and lectures will be held on Wednesdays from 3:15-4:45pm. We will make our best effort to record and post lectures and discussions on this Canvas page in a timely fashion. Office hours will be over Zoom and are listed on Canvas. You will be submitting all assignments via Gradescope, and you will be automatically added in the first week of instruction. We will have course announcements on Piazza, which you can join using the access code shared on Canvas. If you would like to contact the course staff, please make a Piazza post or email us.

Weekly Schedule

Week-to-week schedule and papers covered are tentative, and may change within the first week of the quarter.

Introduction and taxonomy of distribution shifts

Sep 20
  1. Overview of the course
  2. Distribution shifts in the real world
  3. A taxonomy of distribution shifts and how they arise
Sep 22
Covariate and label shifts
Lecture + Discussion
  1. What is a covariate shift?
  2. Handling covariate shift under distribuitonal overlap.
  3. Shortcut Learning in Deep Neural Networks
Sep 27
Covariate and label shifts 2
  1. Improving Predictive Inference Under Covariate Shift by Weighting the Log-Likelihood
  2. Adjusting the Outputs of a Classifier to New a Priori Probabilities: A Simple Procedure

Domain adaptation theory

Sep 29
Domain adaptation
  1. When can we provably learn under distribution shift?
  2. Can unlabeled data help?
  3. Defining generalization bounds under distribution shift.
Oct 4
Domain adaptation 2
  1. A Theory of Learning from Different Domains
  2. Optimal Transport for Domain Adaptation

Neural and representation-based methods

Oct 6
Neural domain adaptation
  1. Indistinguishability over representations.
  2. Adversarial approaches to neural domain adaptation.
  3. Connections to classical theory.
Oct 11
Neural domain adaptation 2
  1. Domain Adversarial Training of Neural Networks
  2. Geometry-Consistent Generative Adversarial Networks for One-Sided Unsupervised Domain Mapping
Oct 13
Neural domain adaptation 3
  1. Provable guarantees from representational indistinguishability
  2. Self-training based domain adaptation
  3. Self-supervision based domain adaptation
Oct 18
Learning from invariant representations 2
  1. Test-Time Training with Self-Supervision for Generalization under Distribution Shifts
  2. Support and Invertibility in Domain-Invariant Representations

Robustness and domain generalization

Oct 20
Empirical phenomena in robust machine learning
  1. How do different robustness interventions fare in practice?
  2. Can (data augmentation / unlabeled data / bigger models) help?
Oct 25
Empirical phenomena in robust machine learning 2 + Project (Progress report due)
  1. Using Pre-Training Can Improve Model Robustness and Uncertainty
  2. Accuracy on the Line: On the Strong Correlation Between Out-of-Distribution and In-Distribution Generalization
Oct 27
Connections to causality
  1. Distribution shifts as arising from causal interventions.
  2. Existing connections between causality and robustness.
  3. Robustness and invariance as tools for causal inference.
Nov 1
Connections to causality 2
  1. Conditional Variance Penalties and Domain Shift Robustness
  2. Invariant Risk Minimization
Nov 3
Minimax methods
  1. Robustness as a minimax game between nature and the model.
  2. Tractable families of worst-case distributions and duality.
  3. Pitfalls and pessimism from worst-case bounds.
Nov 8
Minimax methods 2
  1. Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization
  2. Certifiying Some Distributional Robustness with Principled Adversarial Training

Adversarial robustness

Nov 10
Adversarial examples
  1. Defining and motivating adversarial examples.
  2. Heuristic defenses and their pitfalls
  3. Provable defenses.
Nov 15
Adversarial examples 2
  1. Unlabeled Data Improves Adversarial Robustness
  2. Certified Adversarial Robustness via Randomized Smoothing
Nov 17
Data poisoning
  1. Classical robust statistics
  2. High-dimensional mean estimation
  3. Convex optimization under data poisoning
Nov 29
Data Poisoning 2
  1. Being Robust (in High Dimensions) Can Be Practical
  2. SEVER: A Robust Meta-Algorithm for Stochastic Optimization
Dec 1
Short project presentations