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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext b55ecca5-ec83-41ae-835e-7080c6d37d48Cited 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
- 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
- PGrad: Learning Principal Gradients For Domain GeneralizationZhe Wang, Jake Grigsby, Yanjun QiICLR 2023 · 1 citation
