Active Flow Matching

Yashvir S. Grewal, Daniel M. Steinberg, Thang D. Bui, Cheng Soon Ong, Edwin V. Bonilla

TL;DR

Active Flow Matching (AFM) bridges the gap between powerful discrete flow matching models and principled active generation frameworks for black-box optimization. By reformulating variational objectives to operate on tractable conditional endpoint distributions rather than intractable marginals, AFM successfully steers implicit generative models toward high-fitness regions under tight experimental budgets.

What Problem Does This Paper Address?

Designing biological sequences (such as proteins, RNA, or small molecules) requires navigating massive, combinatorial search spaces where experimental validation is slow and expensive. Standard autoregressive models struggle with "epistasis"—complex, non-additive interactions where a mutation's effect depends heavily on the rest of the sequence context. Discrete Flow Matching (DFM) and discrete diffusion models solve this by generating sequences through parallel, iterative refinement, capturing long-range dependencies beautifully.

However, these models are implicit generators: they do not provide a tractable, closed-form marginal likelihood $q_\phi(x)$. To compute it, one would have to marginalize over an exponentially large number of stochastic corruption paths. This creates a fundamental mathematical conflict with active generation frameworks like Variational Search Distributions (VSD) and Conditioning by Adaptive Sampling (CbAS), which rely on evaluating $\log q_\phi(x)$ or its gradients to balance exploration and exploitation.

Methods

The core innovation of Active Flow Matching (AFM) is a clever mathematical pivot: instead of trying to compute or optimize the intractable marginal distribution at the terminal step ($t=1$), the authors lift the variational objectives to the conditional endpoint distributions ($q_\phi(x_1 | x_t, t)$) averaged over the flow path. These conditionals are naturally provided by the flow model's denoising network.

  • Objectives: The authors derive forward-KL, reverse-KL, and symmetric-KL variants of AFM.
  • Self-Normalised Importance Sampling (SNIS): Because sampling directly from the high-fitness target distribution is impossible, they use SNIS to estimate the objectives from a proposal distribution.
  • Mixture Proposal Distribution: To minimize estimator variance and balance exploration-exploitation, they introduce a three-component proposal mixture:
  • Prior component: A uniform distribution over sequences to ensure broad exploration.
  • Flow component: Samples from the previous round's flow model to enable local refinement (estimated via Monte Carlo integration).
  • Replay buffer component: A weighted buffer of previously observed high-scoring sequences to drive exploitation.

Datasets

The authors evaluated AFM across six challenging sequence design tasks:

  1. Ehrlich Synthetic Landscapes ($L=32, 64$): Procedurally generated functions that simulate biophysical properties like ruggedness, constraints, and epistasis.
  2. Adeno-Associated Virus (AAV) Capsid Design ($L=28$): Optimizing a 28-amino acid sequence to maximize viral packaging fitness using a pre-trained CNN oracle.
  3. Structure-Based Protein Design (FoldX): Optimizing the mRouge red fluorescent protein ($L=228$) for thermodynamic stability ($-\Delta G$) and solvent-accessible surface area (SASA).
  4. Molecular Docking (F2/Thrombin): Optimizing small molecules (represented as SELFIES strings) targeting Thrombin using the Dockstring benchmark.

Key Insights and Ideas

  • Lifting to the Flow Path: The "aha moment" is realizing that while the destination (the marginal distribution) is mathematically obscured, the journey (the conditional path) is perfectly transparent. Rewriting the KL divergence to evaluate along intermediate timesteps $t$ bypasses the combinatorial explosion of tracking all possible generation paths.
  • No New Flow Theory Needed: Crucially, the forward-KL AFM variant mathematically reduces to a reweighted version of standard discrete flow matching. This means practitioners can use existing DFM architectures and training loops without inventing new flow dynamics.
  • Forward-KL Dominates: Empirically, the forward-KL variant consistently outperformed the reverse-KL variant. Reverse-KL suffers from mode-seeking behavior, which causes the model to prematurely collapse into suboptimal local maxima, whereas forward-KL maintains the necessary diversity for active exploration.

Key Results

  • On the Ehrlich and AAV tasks, forward-KL AFM converged significantly faster to near-optimal solutions compared to state-of-the-art autoregressive baselines (VSD-TFM, CbAS-TFM) and discrete diffusion methods (LaMBO-2).
  • In FoldX stability optimization, forward-KL AFM discovered highly stable protein variants much faster than other methods, though it struggled slightly on the SASA objective.
  • In F2 Molecular Docking, forward-KL AFM strongly outperformed VSD, achieving substantially higher docking scores across 100 rounds of optimization.
Budget-constrained optimization on Ehrlich synthetic landscapes and the AAV capsid design task.
Structure-based protein design with FoldX and F2 Docking oracles.

Limitations and Future Work

  • Classifier Dependency: AFM relies heavily on a classifier to estimate the high-fitness probability $p(y \ge \tau | x)$. If the classifier is inaccurate—especially in early rounds when labeled data is sparse—the generative model can be steered off course.
  • High Variance in Importance Sampling: If the proposal distribution doesn't overlap well with the target distribution, the finite-sample variance of the SNIS estimator can be high, requiring careful tuning of the mixture coefficients.
  • Theoretical Gap for Reverse-KL: Unlike the forward-KL variant, the authors note they have not yet proven that the reverse-KL AFM variant yields a mathematically consistent estimate of the desired marginal distribution.
  • Future Directions: Promising avenues include extending AFM to multi-objective and constrained optimization, incorporating tighter variance reduction strategies, and applying it to domains beyond biological sequence design.

Summary updated

BibTeX
@inproceedings{grewal2025active,
  author = {Yashvir S. Grewal and Daniel M. Steinberg and Thang D. Bui and Cheng Soon Ong and Edwin V. Bonilla},
  title = {{Active Flow Matching}},
  booktitle = {AIML-CEB @ AJCAI},
  year = {2025},
  url = {https://openreview.net/forum?id=kLjoHh2nHN},
}
Figure