GFlowOut: Dropout with Generative Flow Networks

Dianbo Liu, Moksh Jain, Bonaventure F. P. Dossou, Qianli Shen, Salem Lahlou, Anirudh Goyal, Nikolay Malkin, Chris Chinenye Emezue, Dinghuai Zhang, Nadhir Hassen, Xu Ji, Kenji Kawaguchi, Yoshua Bengio

Introduction: The Problem with Standard Dropout

Modern deep neural networks are notoriously overconfident, often providing high-certainty predictions even when they are incorrect. This overconfidence poses a major risk in high-stakes fields such as medicine or autonomous driving. While Bayesian inference offers a principled way to handle uncertainty by treating model parameters as random variables, it is computationally expensive and notoriously difficult to scale.

Dropout is a popular, computationally "cheap" approximation of Bayesian inference (Monte Carlo Dropout), where units are randomly zeroed out during training and inference. However, standard dropout samples masks independently from a fixed distribution—much like a coin flip. This naive approach ignores two critical factors:

  1. Multi-modality: The optimal masks for a given input might belong to several distinct, high-probability groups.
  2. Dependencies: A mask at one layer should logically influence the mask at the subsequent layer. Standard methods, however, treat every layer's mask as an entirely independent event.

While existing variational dropout methods attempt to learn these masks, they frequently struggle with the discrete nature of the masks and the high variance in gradients during optimization. To address these shortcomings, researchers introduce GFlowOut, a novel approach that reimagines dropout by using Generative Flow Networks (GFlowNets) to learn complex, multi-modal posterior distributions over dropout masks.

The GFlowOut Approach

GFlowOut treats the generation of a dropout mask as a sequential decision-making process. Instead of executing one large random flip, the mask is constructed layer-by-layer using a GFlowNet.

The architecture relies on several key technical components:

  • Sequential Construction: The GFlowNet generates a mask for layer $l$ conditioned on the masks generated for all previous layers ($1$ to $l-1$). This explicitly models inter-layer dependencies, moving beyond the independent-layer assumption.
  • Sample-Dependent Conditioning: During training, the mask generator ($q$) is conditioned on both the input data ($x$) and the ground-truth label ($y$). This enables the model to learn which specific sub-networks are most effective for distinct types of data.
  • Test-Time Distillation: Because ground-truth labels are unavailable at test time, the authors train a secondary generator ($p$) that only observes the input ($x$). This generator attempts to mimic the label-aware generator by minimizing the Kullback–Leibler (KL) divergence.
  • Trajectory Balance (TB): The model is trained using the TB objective, a standard GFlowNet loss function. This ensures that the probability of generating a specific mask is proportional to its "reward"—in this case, how accurately the masked network predicts the correct label.

The researchers also propose ID-GFlowOut, a sample-independent variant where the mask distribution is shared across the entire dataset. This serves as a baseline to isolate and test the importance of sample-specific information.

Key Insights

The core innovation of this paper is recognizing that GFlowNets are uniquely suited for dropout because they excel at sampling from multi-modal discrete distributions. Where traditional variational inference often collapses to a single mode, GFlowOut maintains critical diversity.

Furthermore, the methodology proves that labels matter for masks. By conditioning the mask generator on labels during training, GFlowOut learns a significantly richer posterior. The model essentially learns to activate specific "pathways" to solve specific problems. The results also confirm that treating dropout masks as a joint distribution across layers leads to better-regularized models that generalize more effectively to corrupted or rotated data.

Experimental Results and Benchmarks

The researchers evaluated GFlowOut across a diverse range of benchmarks, including image classification (MNIST, CIFAR-10, CIFAR-100), out-of-distribution (OOD) detection (SVHN), large-scale Vision-Language tasks (VQA using the MCAN Transformer), and real-world clinical data (the eICU Collaborative Research Database).

Key performance highlights include:

  • Superior Robustness: On rotated CIFAR-10 images, GFlowOut achieved 31.00% accuracy, significantly outperforming standard random dropout (27.04%).
  • Better Uncertainty Calibration: In OOD detection (identifying SVHN images while trained on CIFAR-10), GFlowOut reached an AUROC of 0.955. This outperforms even Deep Ensembles (0.935), which are considered the industry standard for uncertainty estimation but are vastly more computationally expensive.
  • Clinical Impact: In a cross-hospital mortality prediction task using the eICU database, GFlowOut outperformed all baselines in F1-score, Precision, and Recall. This demonstrates its practical utility in high-stakes, real-world scenarios characterized by imbalanced and noisy data.
  • Efficiency: While training takes approximately twice as long as standard dropout (roughly 7 hours for a ResNet on an RTX8000 GPU), it remains comparable to other "learned" dropout methods like Contextual Dropout and offers similar speeds during inference.

Limitations and Future Directions

While tested successfully on MLPs, ResNets, and Transformers, the authors note that further work is required to scale GFlowOut to even larger, more complex architectures.

Additionally, the current model generates masks in a strictly "bottom-up" fashion, moving from the input layer forward. Future iterations could incorporate "top-down" information—passing signals from deeper layers back to shallower ones—to further refine mask generation. Finally, a highly promising future direction is applying GFlowOut to Reinforcement Learning (RL), where accurate posterior estimation could significantly improve how an agent explores its environment.

Summary updated

BibTeX
@inproceedings{liu2023gflowout,
  author = {Dianbo Liu and Moksh Jain and Bonaventure F. P. Dossou and Qianli Shen and Salem Lahlou and Anirudh Goyal and Nikolay Malkin and Chris Chinenye Emezue and Dinghuai Zhang and Nadhir Hassen and Xu Ji and Kenji Kawaguchi and Yoshua Bengio},
  title = {{GFlowOut: Dropout with Generative Flow Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=7R1gmDrfry},
}
Figure