Learning Modular Structures That Generalize Out-of-Distribution

Arjun Ashok, Chaitanya Devaguptapu, Vineeth Balasubramanian · DOI

TL;DR

This paper introduces a novel training method that encourages neural networks to learn modular structures, specifically by promoting feature reuse across different training domains. This approach aims to improve out-of-distribution (O.O.D.) generalization by forcing the network to rely on robust, invariant features rather than spurious correlations. Preliminary results show promising gains on O.O.D. benchmark datasets.

What Problem Does This Paper Address?

Modern deep neural networks, while powerful, often exhibit a critical weakness: they tend to learn "shortcuts" or spurious correlations present in their training data. This means they might solve a task by exploiting superficial patterns that don't reflect the true underlying mechanism. Consequently, when faced with data that deviates even slightly from the training distribution (out-of-distribution or O.O.D. data), their performance plummets. This is a major hurdle for deploying ML systems in real-world, dynamic environments. The paper tackles this by seeking to enforce a more structured, modular learning process that prioritizes features that are genuinely useful and transferable, rather than those that are merely coincidental.

Methods

The core of the proposed method lies in regularizing the network during training to encourage modularity and feature reuse. They introduce two key regularization terms applied to a differentiable probabilistic binary mask over the network's weights.

  1. Specialization Objective ($\mathcal{S}_1(\pi)$): This term encourages each feature in a layer to be a distinct composition of the features from the previous layer. It aims to minimize redundancy by ensuring that each feature relies on a minimal set of underlying features and differs as much as possible from other features. This is achieved by minimizing the sum of squared sampling probabilities of outgoing weights from each feature.
  2. Reuse Objective ($\mathcal{S}_2(\pi)$): This objective promotes the preservation of features that are well-reused across multiple training domains. It does this by regularizing to keep features that have a large number of outgoing weights sampled with high probability, effectively discarding features that are not consistently utilized. This term is inspired by group lasso regularization but applied to the masks.

By combining these regularizers with the standard task loss and a general-purpose regularizer, the authors aim to train a network that implicitly learns a modular sub-network composed of specialized and reused features. The probabilistic masks are relaxed using the Gumbel-Sigmoid estimator, allowing for differentiable optimization, and are then binarized to extract the final subnetwork.

Datasets

The paper evaluates its method on two benchmark O.O.D. generalization datasets:

  • Colored MNIST (C-MNIST): This dataset is artificially biased by inducing a correlation between spurious visual attributes (e.g., color) and the class label during training. The test set reverses this correlation.
  • Rotated MNIST (R-MNIST): Similar to C-MNIST, this dataset introduces a correlation between spurious features (e.g., rotation angle) and the class label during training, which is then reversed in the test set.

Key Insights and Ideas

  • Modularity as an Inductive Bias for O.O.D. Generalization: The paper posits that enforcing structural modularity within a neural network can act as a powerful inductive bias, guiding the model to learn more robust and invariant features, thereby improving O.O.D. performance.
  • Feature Reuse is Key to Invariance: The core idea is that features which are consistently "activated" or reused across different training domains are more likely to capture the true underlying causal mechanisms rather than spurious correlations.
  • Differentiable Masks for Subnetwork Extraction: Using differentiable probabilistic masks allows for the optimization of subnetwork structures directly during training, rather than relying on post-hoc pruning or selection methods.
  • Specialization and Reuse are Complementary: The two proposed regularization terms work in tandem: specialization ensures features are distinct and efficient, while reuse ensures they are broadly applicable and robust to domain shifts.

Key Results

The paper presents preliminary results on C-MNIST and R-MNIST, comparing their proposed method (referred to as "+ modReg" when combined with ERM or IRM) against standard Empirical Risk Minimization (ERM) and Invariant Risk Minimization (IRM).

  • Consistent Gains: The proposed method consistently improves O.O.D. accuracy across different architectures (CNN, MLP) and base algorithms (ERM, IRM) on both datasets.
  • Significant Boost on C-MNIST: The method shows particularly strong gains on the heavily biased C-MNIST dataset, indicating its effectiveness in disentangling spurious correlations.
  • Improved Performance on R-MNIST: Even on R-MNIST, where existing methods like IRM have achieved high performance, the proposed method still provides noticeable improvements. For example, with IRM and CNN, performance increases from 97.3% to 98.1% on R-MNIST.

Limitations and Future Work

  • Preliminary Evaluation: The authors acknowledge that the results are preliminary and based on evaluations on two benchmark datasets.
  • Scalability and Larger Architectures: Future work includes scaling the method to larger datasets and evaluating it on more complex architectures like ResNets.
  • Comparison with Other O.O.D. Methods: The authors also plan to evaluate their method in conjunction with other existing O.O.D. generalization techniques.

Summary updated

BibTeX
@inproceedings{ashok2022learning,
  author = {Arjun Ashok and Chaitanya Devaguptapu and Vineeth Balasubramanian},
  title = {{Learning Modular Structures That Generalize Out-of-Distribution}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  url = {https://openreview.net/forum?id=YTErRgZEJh},
}
Figure