Introduction
Generative Marginalization Models (MAMs) introduce a novel family of generative models for discrete data that explicitly learn to predict marginal probabilities in a single neural network forward pass. By bypassing the sequential bottlenecks inherent in traditional autoregressive models, MAMs achieve up to a 10,000x speedup in marginal inference. Furthermore, they unlock scalable "energy-based" training for high-dimensional problems like molecule design and physical system simulation.
The Bottleneck in Arbitrary Marginal Inference
In generative modeling, evaluating the probability of a subset of variables—known as a marginal probability—is a frequent requirement. Tasks like image inpainting, masked language modeling, or constrained protein design require the model to evaluate the likelihood of specific known parts while ignoring (marginalizing out) the unknown parts. Users also frequently want to generate data in an arbitrary order rather than strictly left-to-right.
Currently, Any-Order Autoregressive Models (AO-ARMs) handle this by factorizing the distribution using the chain rule of probability. However, this introduces a massive computational bottleneck: evaluating a marginal probability for a sequence of length $D$ requires up to $D$ sequential passes through the neural network. For high-dimensional data, this $O(D)$ complexity is agonizingly slow.
This bottleneck also cripples energy-based training (EB). In EB, instead of training on a dataset of examples (Maximum Likelihood Estimation, or MLE), the model learns by trying to match an unnormalized reward or energy function (e.g., a physics simulator or a chemical property scorer). Because ARMs require $D$ forward passes to evaluate a full sequence's probability, training them on high-dimensional energy functions frequently leads to out-of-memory errors or impossibly slow training times.
Enter Marginalization Models (MAMs)
To solve this, the authors introduce Marginalization Models. Instead of relying solely on step-by-step conditional probabilities, MAMs train a neural network to directly output the marginal probability of any arbitrary subset of variables in one go.
The methodology relies on a few core innovations:
- Augmented Vector Space: The model takes a fixed-size input vector where "marginalized out" (unknown) variables are replaced with a special mask token.
- Marginalization Self-Consistency: A valid probability distribution must obey the sum rule (e.g., the probability of a partial state must equal the sum of the probabilities of all its possible immediate extensions). The authors design a scalable loss function that penalizes the network if its predictions violate this rule locally.
- Two-Stage MLE Training: For standard data-driven training, optimizing everything at once is unstable. The authors mathematically prove that training can be split into two easier steps: first, train a standard conditional model (like an AO-ARM), and second, "distill" those learned conditionals into the marginal network using the self-consistency loss.
- Joint Energy-Based Training: For EB training, the authors jointly train the conditional and marginal networks using a KL divergence objective paired with persistent block-wise Gibbs sampling. This allows the model to scale without requiring $O(D)$ forward passes per step.
Key Results and Capabilities
The authors evaluated MAMs across a diverse suite of discrete data benchmarks, including images (Binary MNIST, CIFAR-10, ImageNet32), text (Text8), molecules (MOSES), and physical systems (2D Ising models).
Massive Inference Speedups: By explicitly modeling marginals, MAMs decouple the sequence length $D$ from the inference cost. On image datasets, MAMs achieved nearly 4 orders of magnitude (~10,000x) speedup in marginal inference compared to AO-ARMs. For example, on CIFAR-10, an AO-ARM took 2401 seconds to evaluate a batch of marginals, while MAM took just 0.495 seconds.
High Fidelity: Despite the massive speedup, MAM's marginal estimates maintained a near-perfect Pearson correlation (~0.98 to 0.99) with the exact estimates produced by the slower AO-ARMs.
Scaling Energy-Based Training: On the 30x30 Ising model ($D=900$), standard ARMs and GFlowNets completely failed due to out-of-memory errors. MAM successfully trained and achieved strong generative performance, proving its unique ability to scale any-order generative modeling to high dimensions in EB settings.
Limitations and Future Directions
While MAMs offer a paradigm shift in inference speed, they do have limitations. Because they use neural networks as function approximators, the output marginals are not perfectly normalized (they don't sum exactly to 1), which could be an issue for applications requiring strict mathematical guarantees. Additionally, like most deep learning models, the marginal network's estimates degrade if queried on data manifolds vastly different from the training distribution.
Future work may focus on designing novel neural network architectures that automatically satisfy marginalization self-consistency by construction, rather than relying on a penalty in the loss function.
Summary updated