CGLearn: Consistent Gradient-Based Learning for Out-of-Distribution Generalization

Jawad Chowdhury, Gabriel Terejanu
11/9/2024
cs.LGcs.AI

Official code: hasanjawad001/CGLearn (6 stars, MIT, last commit 2025-03-13).

Abstract

Improving generalization and achieving highly predictive, robust machine learning models necessitates learning the underlying causal structure of the variables of interest. A prominent and effective method for this is learning invariant predictors across multiple environments. In this work, we introduce a simple yet powerful approach, CGLearn, which relies on the agreement of gradients across various environments. This agreement serves as a powerful indication of reliable features, while disagreement suggests less reliability due to potential differences in underlying causal mechanisms. Our proposed method demonstrates superior performance compared to state-of-the-art methods in both linear and nonlinear settings across various regression and classification tasks. CGLearn shows robust applicability even in the absence of separate environments by exploiting invariance across different subsamples of observational data. Comprehensive experiments on both synthetic and real-world datasets highlight its effectiveness in diverse scenarios. Our findings underscore the importance of leveraging gradient agreement for learning causal invariance, providing a significant step forward in the field of robust machine learning. The source code of the linear and nonlinear implementation of CGLearn is open-source and available at: https://github.com/hasanjawad001/CGLearn.

View on arXivView PDF

Code Implementations(1)

MIT
61PythonNov 9, 20241 years agoMIT

Similar Papers

Cite this paper

@article{chowdhury2024cglearn,
  title  = {CGLearn: Consistent Gradient-Based Learning for Out-of-Distribution Generalization},
  author = {Jawad Chowdhury and Gabriel Terejanu},
  year   = {2024},
  eprint = {2411.06040},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2411.06040v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2411.06040.svg)](https://codeofpaper.com/paper/2411.06040)

Discussion