---
title: Equivariant VFM for Controlled Generation
url: https://www.emergentmind.com/topics/controlled-generation-with-equivariant-variational-flow-matching
type: topic
---

# Equivariant VFM for Controlled Generation

Controlled Generation with Equivariant Variational Flow Matching (cVFM) defines a principled framework that unifies constraint-driven generative modeling and symmetry-aware sampling within the flow matching paradigm. Central to this approach is the recasting of flow matching as a variational inference problem, enabling both direct and post hoc controlled generation as well as the exact enforcement of group symmetries, with practical emphasis on molecular graph and geometry generation. The framework integrates external constraints ("controls") either through end-to-end supervision or by leveraging Bayesian inference at sampling, and introduces precise mathematical conditions and architectural patterns required to guarantee equivariant generation across arbitrary symmetry groups.

## 1. Variational Flow Matching and the Controlled Generation Objective

Variational Flow Matching (VFM) parameterizes a time-dependent vector field as an expectation under a learned variational posterior. The key formal object is the velocity field
$$
u_t(x) = \mathbb{E}_{q_t(x_1|x)}[u_t(x|x_1)]
$$
where $u_t(x|x_1)$ is an analytically specified vector field (typically describing straight-line or Gaussian perturbation between $x$ and $x_1$), and $q_t(x_1|x)$ is a learnable variational posterior.

Controlled generation is incorporated by conditioning the terminal marginal $p_1(x_1)$ on an auxiliary variable $y$, yielding the target distribution $p_1(x_1|y)$. The corresponding controlled velocity field is
$$
u_t(x|y) = \mathbb{E}_{p_t(x_1|x, y)} [ u_t(x|x_1) ]
$$
which guarantees correct transport $p_0 \rightarrow p_1(\cdot|y)$. In practice, $p_t(x_1|x, y)$ is approximated by a neural posterior $q_t^\theta(x_1|x, y)$, and learning proceeds by minimizing the negative log-likelihood:
$$
\mathcal{L}_c(\theta) = \mathbb{E}_{t,x_1,x,y}[ -\log q_t^\theta(x_1|x, y) ] + \text{const}
$$
This is equivalent to minimizing the KL divergence between the true and approximate endpoint pairs.

For linear conditional fields $u_t(x|x_1)$, matching the component-wise mean of $q_t$ suffices, giving a "mean-field" loss:
$$
\mathcal{L}_{\text{MF-cVFM}}(\theta) = -\mathbb{E}_{t,x_1,x,y}\sum_{d=1}^D\log q_t^\theta(x_1^d|x,y)
$$
This construction covers both discrete and continuous generative domains.

## 2. Pathways for Controlled Generation

Two complementary control mechanisms are established for constraint-driven generation within the VFM framework.

### A. End-to-End Conditional Training

Here, $q_t^\theta(x_1|x, y)$ is directly parameterized by a network receiving both the partially noised state $x$ at intermediary time $t$ and the control $y$. The mean-field loss above is optimized using supervised pairs $(x_1,x,y)$. For generation, the ODE
$$
\frac{dx}{dt} = (1 - t)^{-1} [ \mathbb{E}_{q_t^\theta(x_1|x,y)}[x_1] - x ]
$$
is integrated from $x_0\sim p_0$ to $x_1$, ensuring samples satisfy the required constraints $y$ by construction.

### B. Post Hoc Bayesian Inference

For pretrained, unconditional VFM generators, controlled sampling is performed by reweighting the posterior at inference:
$$
p_t(x_1|x,y) \propto p_t(x_1|x) \cdot p(y|x_1)
$$
where $p_t(x_1|x)$ is the pretrained VFM's posterior (often Gaussian with mean $\mu_t(x)$ and covariance $\Sigma_t$). The mode $x_1^\ast$ solving
$$
\nabla_{x_1} \log p_t(x_1|x) + \nabla_{x_1}\log p(y|x_1) = 0
$$
can be found via the iterative update:
$$
x_1^{(k+1)} = \mu_t(x) + \Sigma_t \cdot \nabla_{x_1}\log p(y|x_1^{(k)})
$$
initialized at $\mu_t(x)$. The resulting $x_1^\ast$ seeds the ODE for generation. This approach enables constraint-driven, classifier-guided, or reward-driven generation for arbitrary $y$, reusing a single backbone model without retraining.

## 3. Equivariance: Theory, Implementation, and Guarantees

To ensure that the generative process respects symmetries inherent in the data domain, sufficient and necessary equivariance conditions are imposed. Let $G$ be a symmetry group (e.g., permutations $S_n$, rigid motions SE(3)) acting on configurations $x$. The following must hold:

1. **Prior invariance**: $p_0(g\cdot x) = p_0(x)$ for all $g\in G$.
2. **Bi-equivariance of the conditional velocity**: $u_t(g\cdot x | g\cdot x_1) = g\cdot u_t(x | x_1)$
3. **Posterior-mean equivariance**: $\mathbb{E}_{q_t^\theta(x_1|g\cdot x)}[x_1] = g\cdot\mathbb{E}_{q_t^\theta(x_1|x)}[x_1]$

If these are satisfied, the vector field
$$
v_t^\theta(x) = u_t(x | \mathbb{E}_{q_t^\theta(x_1|x)}[x_1])
$$
generates marginals $p_t$ that are $G$-invariant for all $t$. In practice, this is achieved by enforcing $G$-equivariance in the network architecture for $q_t^\theta$ (e.g., E(n)-equivariant message-passing networks) and selecting $p_0$ to be invariant (e.g., isotropic Gaussian for continuous, uniform discrete for categorical components).

## 4. Equivariant VFM for Molecular Generation

The application to molecules requires handling both discrete (atom types $A$, bond types $E$, charges $C$) and continuous (3D coordinates $R$) modalities, with invariance to atom permutation, and SE(3) symmetry in spatial coordinates. For $\sigma\in S_n$,
$$
\sigma\cdot(A,E,R) = (A_{\sigma^{-1}(\cdot)}, E_{\sigma^{-1}(\cdot),\sigma^{-1}(\cdot)}, R_{\sigma^{-1}(\cdot)})
$$
For $g=(Q, t)\in$ SE(3),
$$
g\cdot R = Q R + t
$$
with $A, E, C$ invariant. The network producing the mean-field parameters must be permutation-equivariant (e.g., to $S_n$) and SE(3)-equivariant (e.g., based on geometric message passing) for $R$. This guarantees all generated marginals and final samples respect molecular symmetries exactly—no further post hoc symmetrization or data augmentation is required, and both training and sampling are symmetry-consistent by construction.

## 5. Experimental Results: Molecular Generation and Control

Extensive experiments on molecules demonstrate both state-of-the-art (SOTA) unconditional generation and superior performance in property-conditioned molecular design. Evaluation measures include:

- Discrete: Validity %, Uniqueness %, Fréchet ChemNet Distance (FCD)
- Continuous: Negative Log-Likelihood (NLL), atom/molecule stability %
- Joint: NMol/Atom stability, Validity, Uniqueness, Jensen–Shannon of energy, number of function evaluations (NFE)
- Conditional: Property alignment (e.g., polarizability $\alpha$, HOMO/LUMO energies, dipole $μ$, heat capacity $C_v$) via Mean Absolute Error (MAE).

Key findings ([2506.18340]):

| Setting      | Validity | Uniqueness | FCD (QM9) | Atom-Stability | Mol-Stability | NLL         | MAE (α)         | NFE |
|--------------|----------|------------|-----------|---------------|--------------|-------------|-----------------|-----|
| Uncontrolled | ≥99%     | >99%       | 0.47      | 99.6%         | 99.5%        | −120.7      | —               | 100 |
| E2E Control  | —        | —          | —         | —             | —            | —           | 2.05 (Bohr³)    | 100 |
| Post-hoc VI  | —        | —          | —         | —             | —            | —           | 2.25            | 100 |
| Combined     | —        | —          | —         | —             | —            | —           | 1.98            | 100 |

End-to-end training achieves MAE of 2.05 Bohr³ for $\alpha$ compared to 2.76 (EDM) and 2.41 (EquiFM); post hoc inference without retraining yields 2.25, and combined approaches approach specialized diffusion-based models but at significantly lower sampling cost.

## 6. Implications, Generalizations, and Theoretical Impact

Controlled VFM unifies flow-based generative modeling and Bayesian conditioning, enabling a flexible and reusable approach to sampling under arbitrary constraints without retraining, and providing a direct parallel to classifier guidance in diffusion but with exact ODE flows. Posterior-mean equivariance emerges as the critical sufficient property for full symmetry preservation, simplifying the design of symmetry-aware architectures: enforcing equivariance at the neural posterior-mean level guarantees global invariance in the generative process.

The framework is immediately extensible to any domain with combinatorial or geometric symmetries, such as polymer, crystal, or protein generation, and applies to both purely discrete, continuous, or combined data. Reusable pretrained VFM backbones facilitate rapid iteration on new controls or property constraints through plug-and-play classifiers or reward models, streamlining discovery pipelines in chemistry, materials science, and structured data domains.

## 7. Relation to Other Equivariant Flow Matching Approaches

Controlled equivariant VFM stands in close conceptual relation to methods such as EfficientFlow [2512.02020], PropMolFlow [2505.21469], and ActionFlow [2409.04576], which leverage equivariant flow matching in different contexts (visuomotor policy learning, property-guided molecular design, spatially symmetric control respectively). The core principle—enforcing symmetries via isotropic priors and equivariant architectures, and leveraging mean-field or surrogate variational objectives—remains consistent. The innovations in [2506.18340] specifically introduce the variational inference interpretation and post hoc control for flexible, constraint-driven generation with symmetry guarantees, achieving SOTA results at reduced computational cost. This positions cVFM as a foundational unifying framework for constraint-satisfying, symmetry-aware generation in advanced machine learning systems.

Source: https://www.emergentmind.com/topics/controlled-generation-with-equivariant-variational-flow-matching