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

Discrete Neural Flow Samplers with Locally Equivariant Transformer

Zijing Ou, Ruixiang Zhang, Yingzhen Li · OpenReview

Introduction

Sampling from unnormalized discrete distributions is a fundamental challenge in statistical physics, Bayesian inference, and combinatorial optimization. In these scenarios, the "energy" of a state is known, but the normalizing constant (the partition function) is intractable. Traditional Markov Chain Monte Carlo (MCMC) methods often struggle with "poor mixing," becoming trapped in local minima and requiring extensive time to explore the state space. While neural samplers have emerged as a potential solution, many rely on pre-existing datasets or face computational bottlenecks as the dimensionality of the discrete state space grows.

Discrete Neural Flow Samplers (DNFS)

The authors propose Discrete Neural Flow Samplers (DNFS), a framework that treats sampling as a dynamic evolution. Instead of discrete jumps, DNFS learns the transition rates of a Continuous-Time Markov Chain (CTMC). The model is trained to satisfy the Kolmogorov forward equation, which relates the temporal change in probability to these transition rates.

Variance Reduction via Control Variates

A significant challenge in training such models is the intractable partition function $Z$. To address this, the authors employ a coordinate descent algorithm alongside a "control variate" technique. This approach significantly reduces the variance in estimating the time derivative of $\log Z$, leading to more stable training compared to standard estimation methods.

Locally Equivariant Transformer (leTF)

The architectural centerpiece of DNFS is the Locally Equivariant Transformer (leTF). In a $d$-dimensional space, calculating the probability of flipping any single bit would typically require $d$ separate forward passes. The leTF overcomes this with a "hollow" architecture: the output at position $i$ is designed to be independent of the input at position $i$. This allows the model to compute transition rates for all possible bit flips in a single forward pass, reducing the computational cost per sample from $O(d)$ to $O(1)$.

Architecture of the Locally Equivariant Transformer (leTF) featuring a 'hollow' design for efficient transition rate computation.

Experimental Evaluation

DNFS was evaluated on several benchmarks:

  • Synthetic 2D Distributions: Complex patterns like 2spirals and checkerboard encoded as 32-bit vectors.
  • Ising Models: Physics-based magnetism models on $10 \times 10$ and $9 \times 9$ lattices.
  • Combinatorial Optimization: Maximum Independent Set (MIS) and Maximum Cut (MaxCut) problems on random graphs (Erdos–Rényi and Barabási–Albert).

Key Results

DNFS demonstrates superior performance in capturing multi-modal structures, such as the checkerboard pattern, where other methods like GFlowNet often suffer from mode collapse.

In Ising model experiments, the leTF architecture achieved an Effective Sample Size (ESS) near 1.0, indicating highly independent samples. It also matched theoretical free energy and entropy values with minimal error. When applied to optimization tasks like MIS, DNFS combined with MCMC refinement (DNFS+DMALA) achieved results comparable to the GUROBI exact solver while significantly outperforming pure MCMC baselines.

Comparison of leTF against baseline architectures (leConv, leAttn, leMLP) in terms of log RMSE and Effective Sample Size (ESS).

Discussion and Future Work

The paper highlights the efficiency of "one-way flows," proving that complex sampling paths can be represented by simplified rate matrices without loss of expressiveness. However, challenges remain in scaling to extremely high dimensions where the loss function's summation over ratios can become unstable. Future work includes extending DNFS to more complex discrete structures like graphs or natural language and addressing the approximation bias introduced by Taylor expansions used to accelerate ratio calculations.

Summary updated

BibTeX
@inproceedings{ou2025discrete,
  author = {Zijing Ou and Ruixiang Zhang and Yingzhen Li},
  title = {{Discrete Neural Flow Samplers with Locally Equivariant Transformer}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=Wk65okms3T},
}
Figure