NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Winning Prize Comes from Losing Tickets: Improve Invariant Learning by Exploring Variant Parameters for Out-of-Distribution Generalization

Zhuo Huang, Muyang Li, Li Shen, Jun Yu, Chen Gong, Bo Han, Tongliang Liu · DOI

TL;DR

This paper introduces EVIL (Exploring Variant parameters for Invariant Learning), a novel method to improve Out-of-Distribution (OOD) generalization by not only identifying invariant parameters crucial for generalization but also by actively exploring "variant" parameters that are sensitive to distribution shifts. By strategically leveraging both types of parameters, EVIL effectively prunes a more robust subnetwork, leading to significant performance gains across various OOD generalization techniques.

What Problem Does This Paper Address?

Deep learning models excel at tasks when training and testing data come from the same distribution (IID). However, in real-world applications, this assumption often breaks, leading to a drastic drop in performance when models encounter unseen data distributions (Out-of-Distribution or OOD generalization). Traditional approaches to OOD generalization often focus on identifying "invariant" features that are consistent across distributions. Some recent methods, inspired by the Lottery Ticket Hypothesis (LTH), aim to find sparse subnetworks that are critical for this invariant learning. However, these methods can be misled by distribution-specific "noise" in the training data, leading to suboptimal subnetworks. The core challenge is to effectively distinguish between truly invariant features and spurious, distribution-dependent features to build models that generalize robustly.

Methods

The paper proposes EVIL (Exploring Variant parameters for Invariant Learning), a two-stage framework:

  1. Parameter Exploration: This stage is the core novelty. EVIL uses two distinct optimization targets:
  2. Invariant Learning Loss ($L_{inv}$): This is the standard task-specific loss (e.g., classification) that aims to learn invariant features. Parameters contributing to this are considered "invariant."

    • Variant Learning Loss ($L_{var}$): This novel loss uses distribution information (rather than just labels) to train a separate head to discriminate between different data distributions. Parameters that are highly activated by this loss are identified as "variant" – they are sensitive to distribution shifts and likely capture spurious correlations.

    By minimizing both losses, EVIL can identify parameters that are either strongly related to the task (invariant) or strongly related to distribution shifts (variant). The paper then dynamically updates a mask to select invariant parameters and prune variant parameters, iteratively refining the subnetwork.

  3. Invariant Learning: Once the robust subnetwork is identified through parameter exploration, it is trained using standard invariant learning techniques (like ERM, IRM, REx, DRO, SAM) to further enhance OOD generalization.

Datasets

The experiments were conducted on the DomainBed benchmark, which is a well-known testbed for OOD generalization. This benchmark includes seven datasets: CMNIST, RMNIST, PACS, VLCS, OfficeHome, TerraIncognita, and DomainNet. The authors also report results on large-scale datasets like ImageNet, iWildCam, and FMoW, using a CLIP ViT-B/16 backbone.

Key Insights and Ideas

  • Variant parameters are not just noise, but valuable signals: Instead of solely focusing on invariant parameters, EVIL recognizes that parameters sensitive to distribution shifts (variant parameters) can be actively used to identify and exclude spurious correlations, thereby improving the robustness of the invariant learning process.
  • Distribution information is key for identifying spurious features: Using a separate head trained on distribution labels (instead of class labels) is an effective way to pinpoint parameters that are overly influenced by specific environments.
  • Dynamic mask updating is crucial: The iterative process of exploring and updating the mask allows EVIL to dynamically refine the subnetwork, adapting to the nuances of different datasets and training stages.
  • EVIL complements existing methods: The framework is designed to be plug-and-play, enhancing the performance of various established OOD generalization techniques like ERM, IRM, and SAM.

Key Results

  • EVIL consistently improves the performance of various OOD generalization methods, achieving significant gains. For instance, when combined with ERM, DRO, and SAM, EVIL increased test accuracies by 2.4%, 1.9%, and 1.9% respectively, on average.
  • EVIL-SAM achieved the best OOD generalization performance among the compared methods, notably improving SAM's performance by 7.2% on the TerraIncognita dataset.
  • The method is computationally efficient, showing "much less computational burden" compared to other methods.
  • EVIL demonstrates effectiveness across different network architectures (ResNet, Wide ResNet) and large-scale models (CLIP ViT-B/16), indicating its model-agnostic nature.
  • Ablation studies confirmed that leveraging distribution knowledge for variant parameter exploration is crucial for EVIL's success, outperforming methods that only use label information.

Limitations and Future Work

  • Computational Cost of EVIL-SAM: While EVIL itself is efficient, the EVIL-SAM variant requires an "extra backward to compute the parameter perturbation," adding to its computational cost.
  • Hyperparameter Sensitivity: The paper investigates the sensitivity to hyperparameters like $\alpha$ and $\Delta T$, finding optimal values (e.g., $\alpha=0.2$, $\Delta T=300$) but acknowledging that suboptimal choices can lead to performance drops.
  • Future Work: The authors suggest that EVIL can be further leveraged to enhance robustness by exploring techniques like SAM. The paper also implies that EVIL's ability to produce flatter minima (as shown by Hessian spectra analysis) is key to its generalization capabilities, suggesting further research into this connection. The code is made publicly available, encouraging further exploration and application of the EVIL framework.

Summary updated

BibTeX
@article{huang2025winning,
  author = {Zhuo Huang and Muyang Li and Li Shen and Jun Yu and Chen Gong and Bo Han and Tongliang Liu},
  title = {{Winning Prize Comes from Losing Tickets: Improve Invariant Learning by Exploring Variant Parameters for Out-of-Distribution Generalization}},
  journal = {Int. J. Comput. Vis.},
  year = {2025},
  doi = {10.1007/s11263-024-02075-x},
}
Figure