Embarrassingly Parallel GFlowNets

Tiago Silva, Luiz Max Carvalho, Amauri H Souza, Samuel Kaski, Diego Mesquita

Introduction

Generative Flow Networks (GFlowNets) have emerged as a powerful framework for sampling from complex, discrete distributions, such as molecular structures, DNA sequences, and causal graphs. However, as datasets grow and become increasingly distributed, GFlowNets face significant hurdles in scalability and communication efficiency. Traditional training requires repeated passes over massive datasets to evaluate reward functions, and federated settings often demand constant communication between clients and a central server.

To address these challenges, we present EP-GFlowNet, the first "embarrassingly parallel" sampling method designed specifically for discrete, compositional distributions. By employing a divide-and-conquer strategy, EP-GFlowNet allows multiple clients to train local models independently and combine them in a single communication step, achieving the accuracy of centralized training with massive speedups and improved privacy.

Methodology

EP-GFlowNet decomposes the global sampling task into a three-stage pipeline:

1. Local Training

The global dataset is partitioned into shards, with each shard assigned to a local client. Each client trains its own GFlowNet to sample from a "sub-posterior" based on its specific data subset.

2. Aggregating Balance (AB) Condition

The core theoretical innovation of this work is the Aggregating Balance (AB) condition. This condition enables a central server to synthesize a global GFlowNet that samples from the product of the local distributions. Unlike standard federated learning algorithms that require hundreds of communication rounds, EP-GFlowNet requires only one round: clients simply send their trained policy networks to the server. This "agnostic aggregation" means the server does not need to know the specific training objective (e.g., Trajectory Balance or Detailed Balance) used by the clients.

3. Contrastive Balance (CB) Loss

To enhance local training efficiency, the authors introduce the Contrastive Balance (CB) loss. Traditional methods like Trajectory Balance (TB) often require estimating a partition function or state flows, which can be computationally intensive. CB loss simplifies this by comparing pairs of trajectories, leading to faster convergence and a more streamlined parameterization. Mathematically, the authors prove that minimizing the CB loss is equivalent to minimizing the KL divergence between forward and backward policies, grounding the approach in variational inference theory.

Experimental Evaluation

The researchers evaluated EP-GFlowNet across five diverse tasks: Grid World, Multiset Generation, Sequence Design, Bayesian Phylogenetic Inference, and Federated Bayesian Network Structure Learning (BNSL).

Accuracy and Scalability

Across all benchmarks, EP-GFlowNet matched the performance of centralized models that have access to the entire dataset simultaneously. In the Grid World task, EP-GFlowNet achieved an L1 error of approximately 0.038, nearly identical to the centralized version (0.027) and significantly outperforming the standard PCVI baseline, representing an 8x improvement in accuracy.

In the Bayesian Phylogenetic Inference task, EP-GFlowNet demonstrated superior scalability. While the training time for a centralized model grew linearly with the amount of data, EP-GFlowNet’s training time remained roughly constant as more clients were added to handle the increased load.

Model Reuse

A unique advantage of the EP-GFlowNet framework is its support for "log-pools of experts." Pre-trained models can be combined to sample from the intersection of their distributions without requiring any retraining of the individual components.

Theoretical Robustness

The paper provides a mathematical bound (Theorem 3.4) quantifying how errors in local models propagate to the global model. While the system is generally robust to minor local inaccuracies, the authors note it remains susceptible to "catastrophic failure" if a single client fails to capture the modes of its sub-distribution. This highlights the importance of local model quality in the aggregate result.

Limitations and Future Work

Despite its advantages, EP-GFlowNet has areas for further development:

  • Privacy: While raw data is not shared, the exchange of neural network policies could potentially leak information about reward functions. Integrating differential privacy is a suggested mitigation for future iterations.
  • Hybrid Spaces: Currently optimized for discrete spaces, future research aims to extend the framework to hybrid spaces—for example, simultaneously inferring discrete tree topologies and continuous branch lengths in phylogenetics.

Conclusion

EP-GFlowNet represents a significant step forward in making GFlowNets practical for large-scale, distributed applications. By enabling embarrassingly parallel training with a single communication round, it overcomes the primary bottlenecks of previous generative modeling approaches in discrete combinatorial spaces.

Summary updated

BibTeX
@inproceedings{silva2024embarrassingly,
  author = {Tiago Silva and Luiz Max Carvalho and Amauri H Souza and Samuel Kaski and Diego Mesquita},
  title = {{Embarrassingly Parallel GFlowNets}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=KJhLpzqNri},
}
Figure