Gradient Matching for Domain Generalization
Yuge Shi, Jeffrey Seely, Philip H. S. Torr, Siddharth Narayanaswamy, Awni Y. Hannun, Nicolas Usunier, Gabriel Synnaeve
Abstract
Machine learning systems typically assume that the distributions of training and test sets match closely. However, a critical requirement of such systems in the real world is their ability to generalize to unseen domains. Here, we propose an inter-domain gradient matching objective that targets domain generalization by maximizing the inner product between gradients from different domains. Since direct optimization of the gradient inner product can be computationally prohibitive -- requires computation of second-order derivatives -- we derive a simpler first-order algorithm named Fish that approximates its optimization. We demonstrate the efficacy of Fish on 6 datasets from the Wilds benchmark, which captures distribution shift across a diverse range of modalities. Our method produces competitive results on these datasets and surpasses all baselines on 4 of them. We perform experiments on both the Wilds benchmark, which captures distribution shift in the real world, as well as datasets in DomainBed benchmark that focuses more on synthetic-to-real transfer. Our method produces competitive results on both benchmarks, demonstrating its effectiveness across a wide range of domain generalization tasks.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
120 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Improving Out-of-Distribution Robustness via Selective Augmentation cites WILDS: A Benchmark of in-the-Wild Distribution Shifts
- Model-Based Domain Generalization cites Episodic Training for Domain Generalization
- Model-Based Domain Generalization cites WILDS: A Benchmark of in-the-Wild Distribution Shifts
- Ensemble of Averages: Improving Model Selection and Boosting Performance in Domain Generalization cites Fishr: Invariant Gradient Variances for Out-of-Distribution Generalization
- Ensemble of Averages: Improving Model Selection and Boosting Performance in Domain Generalization cites Episodic Training for Domain Generalization
- Ensemble of Averages: Improving Model Selection and Boosting Performance in Domain Generalization cites Moment Matching for Multi-Source Domain Adaptation
- Fishr: Invariant Gradient Variances for Out-of-Distribution Generalization cites Moment Matching for Multi-Source Domain Adaptation
- Fishr: Invariant Gradient Variances for Out-of-Distribution Generalization cites WILDS: A Benchmark of in-the-Wild Distribution Shifts
- Prompt-aligned Gradient for Prompt Tuning cites Fishr: Invariant Gradient Variances for Out-of-Distribution Generalization
- WILDS: A Benchmark of in-the-Wild Distribution Shifts cites Moment Matching for Multi-Source Domain Adaptation
Cited by top-tier papers120
- Prompt-aligned Gradient for Prompt TuningBeier Zhu, Yulei Niu, Yucheng Han, Yue Wu et al.ICCV 2023 · 475 citations
- Improving Out-of-Distribution Robustness via Selective AugmentationHuaxiu Yao, Yu Wang, Sai Li, Linjun Zhang et al.ICML 2022 · 275 citations
- Fishr: Invariant Gradient Variances for Out-of-Distribution GeneralizationAlexandre Ramé, Corentin Dancette, Matthieu CordICML 2022 · 262 citations
- Ensemble of Averages: Improving Model Selection and Boosting Performance in Domain GeneralizationDevansh Arpit, Huan Wang, Yingbo Zhou, Caiming XiongNeurIPS 2022 · 232 citations
- Model-Based Domain GeneralizationAlexander Robey, George J. Pappas, Hamed HassaniNeurIPS 2021 · 167 citations
Builds on3
- Moment Matching for Multi-Source Domain AdaptationXingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang et al.ICCV 2019 · 2,239 citations
- WILDS: A Benchmark of in-the-Wild Distribution ShiftsPang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie et al.ICML 2021 · 1,773 citations
- Episodic Training for Domain GeneralizationDa Li, Jianshu Zhang, Yongxin Yang, Cong Liu et al.ICCV 2019 · 488 citations
Related papers
- Balanced Direction from Multifarious Choices: Arithmetic Meta-Learning for Domain GeneralizationXiran Wang, Jian Zhang, Lei Qi, Yinghuan ShiCVPR 2025
- Understanding Hessian Alignment for Domain GeneralizationSobhan Hemati, Guojun Zhang, Amir Hossein Estiri, Xi ChenICCV 2023 · 21 citations
- In Search of Lost Domain GeneralizationIshaan Gulrajani, David Lopez-PazICLR 2021 · 1,416 citations
- SIMPLE: Specialized Model-Sample Matching for Domain GeneralizationZiyue Li, Kan Ren, Xinyang Jiang, Yifei Shen et al.ICLR 2023
- Extending the WILDS Benchmark for Unsupervised AdaptationShiori Sagawa, Pang Wei Koh, Tony Lee, Irena Gao et al.ICLR 2022 · 116 citations
