Abstract
Traditional neural networks excel at interpolation but struggle with out-of-distribution (OOD) extrapolation, often requiring multiple training environments to learn robust invariances. This paper introduces CGreg (Counterfactual G-invariance Regularization), a framework that enables models to generalize from a single, biased environment. By assuming that symmetries are mandatory unless contradicted by data, CGreg leverages a hierarchy of invariant subspaces to perform "single-environment extrapolation." Experimental results on modified MNIST and sequence tasks demonstrate that CGreg significantly outperforms standard models and existing invariant learning techniques.
Introduction
Standard machine learning operates under the "unseen-is-underspecified" hypothesis: without diverse training data, a model has no reason to assume a label remains invariant under transformations not seen during training. For instance, a model trained only on upright red digits might rely on "uprightness" or "redness" for classification. While humans can infer symmetries from single examples, neural networks typically require multiple environments (e.g., Invariant Risk Minimization) to identify stable features. This work addresses the challenge: Can we build a model that extrapolates from a single environment by intelligently assuming which symmetries should exist?
Theoretical Framework: Counterfactual G-Invariance
The authors propose flipping the traditional learning paradigm. Instead of requiring evidence to become invariant, the model assumes all known group symmetries (e.g., rotations, flips, permutations) are mandatory by default.
Structural Causal Models (SCM)
The framework is grounded in Structural Causal Models, where data generation involves "hidden" variables transformed by groups. This causal structure allows for the formal definition of counterfactual G-invariance, ensuring model consistency under hypothetical environment interventions.
CGreg: Counterfactual G-invariance Regularization
The core technical contribution is the CGreg penalty. It utilizes the Reynolds operator from group theory to decompose neural network weight spaces into a hierarchy of subspaces ordered by "invariance strength." The penalty pushes the model toward the most invariant subspaces possible. Symmetries are only "unlearned" if they are explicitly incompatible with the training labels. A key theoretical result (Theorem 2) shows that if the "ignored" transformations form a normal subgroup of the total transformations, standard G-invariance suffices for counterfactual extrapolation.
Experimental Evaluation
The authors evaluated CGreg across 12 tasks in two domains:
- Modified MNIST: Tasks like MNIST-34 used "economically" sampled training data (e.g., only upright, red digits). Test data included random rotations, flips, and color permutations.
- Sequence Tasks: Predicting arithmetic functions (like sums) from sorted integer sequences, where the goal is to generalize to unsorted permutations.
Key Results
- MNIST Extrapolation: CGreg achieved ~94% accuracy on tasks where standard VGG models plummeted to ~15% (random guessing) due to reliance on spurious correlations like color or orientation.
- Selective Learning: Unlike "forced" invariance, CGreg successfully identifies when a symmetry must be broken to maintain performance (e.g., distinguishing '6' from '9').
- Sequence Generalization: CGreg consistently outperformed Transformers and GRUs in permutation tasks, successfully extrapolating to unsorted sequences after training only on sorted ones.
Discussion and Limitations
CGreg represents a philosophical shift toward "invariance by default." However, challenges remain. Finding invariant bases can be computationally expensive as the number of transformation groups grows. Furthermore, the current framework is limited to finite linear automorphism groups, leaving non-linear or continuous transformations (like general affine transforms) for future work.
Conclusion
By treating OOD extrapolation as a counterfactual query rather than a pattern-matching exercise across environments, CGreg enables robust learning from limited data. This approach provides a theoretical and practical path toward more human-like generalization in neural networks.
Summary updated