Discrete Probabilistic Inference as Control in Multi-path Environments

Tristan Deleu, Padideh Nouri, Nikolay Malkin, Doina Precup, Yoshua Bengio

TL;DR

Generative Flow Networks (GFlowNets) and Maximum Entropy Reinforcement Learning (MaxEnt RL) are often viewed as distinct paradigms for sampling structured discrete objects. This paper proves that by properly correcting the reward function via backward transition probabilities, standard MaxEnt RL algorithms are mathematically equivalent to core GFlowNet objectives. This bridges the conceptual gap between the two fields, allowing probabilistic inference to directly leverage decades of reinforcement learning algorithms and infrastructure.

What Problem Does This Paper Address?

Sampling from unnormalized Gibbs distributions over discrete, compositional structures (such as molecules, phylogenetic trees, or graphs) is a fundamental problem in probabilistic inference. Casting this as a sequential decision problem seems natural: start from an empty state and add pieces step by step.

However, standard Maximum Entropy Reinforcement Learning (MaxEnt RL) encounters a major hurdle in multi-path environments—directed acyclic graph (DAG) MDPs where the same terminating state $x$ can be reached via multiple distinct trajectory sequences. MaxEnt RL optimizes policy entropy over trajectories, meaning the marginal distribution over terminating states ends up biased toward objects with many construction routes.

GFlowNets resolve this via flow-conservation constraints, but their relationship to the broader RL toolbox has remained incompletely understood. The authors tackle this by showing how to systematically adjust the reward in MaxEnt RL so its marginal distribution exactly matches the target Gibbs distribution, establishing an exact mathematical equivalence between specific algorithms in both families.

Methods

  • Generalized Reward Correction: The authors generalize recent work (Tiapkin et al., 2024) by correcting the trajectory return with a backward transition probability $P_B$: $$\sum_{t=0}^T r(s_t, s_{t+1}) = -\mathcal{E}(s_T) + \alpha \sum_{t=0}^{T-1} \log P_B(s_t \mid s_{t+1})$$ This formulation guarantees that the optimal MaxEnt policy’s marginal terminating distribution satisfies $\pi^*(x) \propto \exp(-\mathcal{E}(x)/\alpha)$, even with intermediate rewards.

  • Algorithmic Equivalences Proved:

  • PCL $\Leftrightarrow$ SubTB: Path Consistency Learning (PCL) is exactly proportional to Subtrajectory Balance (SubTB) under the corrected reward ($\mathcal{L}_{\text{PCL}} = \alpha^2 \mathcal{L}_{\text{SubTB}}$), identifying soft value functions with state flows: $V^*_{\text{soft}}(s) = \alpha \log F(s)$.
  • SQL $\Leftrightarrow$ DB: Soft Q-Learning (SQL) is equivalent to Detailed Balance (DB) via the Unified PCL perspective.
  • $\pi$-SQL $\Leftrightarrow$ Modified DB: In environments where all states are valid terminating states ($S \equiv \mathcal{X}$), Soft Q-Learning can be reparametrized purely through a policy ($\pi$-SQL), which exactly matches the Modified Detailed Balance loss.
  • SQL $\Leftrightarrow$ FL-DB: In environments with intermediate rewards, SQL corresponds to Forward-Looking Detailed Balance (FL-DB).

Datasets

The authors empirically evaluate their theoretical findings across three discrete domains:

  1. Discrete Factor Graphs: 4 factor graph structures (Chain, Permuted Chain, Factor Graph 1, Factor Graph 2) with $d=6$ variables, each taking $K=5$ values (adapted from Buesing et al., 2020 to allow multi-path variable assignments).
  2. Bayesian Network Structure Learning: Learning DAG structures over $d=5$ variables from 100 ancestral samples of a synthetic ground-truth Erdős–Rényi graph, scored via BGe and Linear Gaussian metrics (following Deleu et al., 2022).
  3. Parsimonious Phylogenetic Tree Generation: 6 real-world biological sequence datasets (DS1 to DS6) from Zhou et al. (2024), spanning 27 to 50 species ($d$) with sequence lengths up to 2520 base pairs.

Key Insights and Ideas

  • Trajectory vs. Marginal Sampling: The core issue with vanilla MaxEnt RL in DAGs is trajectory marginalization: $\pi^*(x) = \sum_{\tau \to x} \pi^*(\tau)$. Subtracting trajectory log-backward probabilities $\log P_B$ in the reward neutralizes the sum over paths, aligning inference with control.
  • PCL and Trajectory Balance are Two Sides of the Same Coin: GFlowNet researchers independently developed Trajectory Balance (TB) and SubTB, while RL researchers developed Path Consistency Learning (PCL). They are essentially identical losses up to temperature scaling $\alpha^2$.
  • Unified vs. Dueling Parametrization: GFlowNet's DB traditionally trains two networks (forward policy $P_F$ and state flow $F$). MaxEnt RL shows that a single $Q$-network natively parametrizes both $P_F$ and $F$, matching performance while reducing parameter count.

Key Results

  • Empirical Validation of Equivalences:
  • Across all tasks, algorithms shown to be theoretically equivalent display virtually identical learning dynamics: TB matches PCL, and DB matches SQL (in factor graphs, Bayesian networks, and phylogenetics).
  • On Bayesian network structure learning, Modified DB and $\pi$-SQL trace matching Jensen-Shannon Divergence (JSD) curves throughout training.
  • Phylogenetic Tree Benchmark:
  • On larger state spaces where the partition function is intractable, DB and SQL attain strong Pearson correlations between terminating state log-probabilities and true returns (e.g., on DS5: $R = 0.9633$ for DB vs. $R = 0.9712$ for SQL; on DS1: $R = 0.9141$ for DB vs. $R = 0.8695$ for SQL).
  • Discrete Soft Actor-Critic (SAC)—which does not have a native GFlowNet counterpart—was evaluated under the same conditions but was prone to training instabilities, performing worse on average than DB/SQL (e.g., DS1 correlation of $0.6003$ vs. $0.9141$ for DB).

Limitations and Future Work

  • Deterministic MDP Assumption: The equivalence proofs assume deterministic transition dynamics, standard in compositional generation but restrictive for inherently stochastic environments.
  • Predefined Backward Policy $P_B$: The reward correction depends on a chosen backward policy $P_B$ (e.g., uniform over parents or trajectory-count proportional). While $P_B$ can be learned, optimal choices for arbitrary DAGs remain an active area of study.
  • Future Directions: Incorporating advanced RL exploration methods (count-based exploration, curiosity-driven exploration) into the corrected MaxEnt RL framework to discover modes in complex multimodal energy landscapes; extending the framework to continuous action/state spaces and diffusion models.

Summary updated

BibTeX
@inproceedings{deleu2024discrete,
  author = {Tristan Deleu and Padideh Nouri and Nikolay Malkin and Doina Precup and Yoshua Bengio},
  title = {{Discrete Probabilistic Inference as Control in Multi-path Environments}},
  booktitle = {Conference on Uncertainty in Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=3C69sU1YkK},
}
Figure