Variational Search Distributions

Daniel M. Steinberg, Rafael Oliveira, Cheng Soon Ong, Edwin V. Bonilla

In the fields of drug discovery and synthetic biology, finding a "good" design is akin to finding a needle in a haystack—if the haystack were the size of the galaxy. Whether engineering a protein sequence to degrade plastic or a DNA strand to bind to a specific target, the search space is astronomically large (e.g., $20^{100}$ possible configurations for a single short protein).

To navigate these combinatorial spaces, researchers have developed Variational Search Distributions (VSD), a novel framework for a task termed active generation. Instead of hunting for a single optimal design, VSD trains generative models to learn the entire "neighborhood" of high-performing, rare designs by efficiently evaluating a black-box oracle (like a lab experiment or simulation) in a batch-sequential manner.

The Problem: Beyond the Single Best Design

Traditional Black-Box Optimization (BBO) focuses on finding the single global maximum of a function—the absolute "best" possible design. However, in practical engineering, we often need a diverse set of functional candidates rather than a single winner. A diverse portfolio of enzymes, for instance, provides robustness against unknown industrial conditions like varying pH or temperature.

Conceptual comparison of traditional optimization versus active generation. While traditional methods seek the single best design (a), VSD aims to learn the distribution of all designs exceeding a fitness threshold (d).

The challenge is that these "fit" designs are incredibly rare, and searching for them is expensive because every evaluation requires a real-world experiment. Current methods struggle with three main issues:

  1. Discrete Spaces: Standard gradient-based optimization cannot be easily applied to discrete sequences of amino acids or nucleotides.
  2. Diversity Collapse: Many algorithms prematurely converge onto a single solution, ignoring other potentially useful areas of the design space.
  3. Scalability: Handling large batches of candidates per round is computationally taxing for many Bayesian optimization methods.

Methods: Search as Inference

VSD addresses these challenges by treating the search for desirable designs as a variational inference problem. Instead of merely maximizing fitness, VSD attempts to match a generative model $q(\mathbf{x})$ to the "super level-set" distribution—the set of all designs $\mathbf{x}$ where the fitness $y$ exceeds a specific threshold $\tau$.

Key Technical Ingredients

  • Variational Inference (VI): VSD minimizes the reverse Kullback-Leibler (KL) divergence between the generative model and the target distribution of fit designs. This formulation allows the model to leverage off-the-shelf gradient-based optimization routines.
  • Class Probability Estimation (CPE): Rather than predicting an exact, continuous fitness score for every sequence, VSD uses a scalable classifier to estimate the probability that a design belongs to the "rare desired class" (i.e., exceeds the threshold).
  • REINFORCE Gradients: Because the design space is discrete, VSD uses the score function estimator (REINFORCE) to update the generative model's parameters.
  • Flexible Priors: VSD can incorporate prior knowledge—such as a language model trained on all known natural proteins—to effectively narrow the search space from the outset.

Key Insights and Results

The authors evaluated VSD across a range of complex tasks, from a proof-of-concept "unrolled" MNIST task to high-dimensional biological fitness landscapes including DHFR (antibiotic resistance), TrpB (enzyme activity), and AAV (viral capsids for gene therapy).

1. Diversity is a Feature, Not a Bug: Because VSD optimizes a distribution rather than a single point, it naturally maintains diversity in its generated batches. This prevents the "mode collapse" frequently observed in other adaptive sampling methods.

2. Theoretical Convergence: The framework provides a mathematical guarantee: VSD converges to the true distribution of fit designs at the same asymptotic rate as a Monte Carlo estimator that has full, perfect knowledge of the fitness function.

3. Outperforming Baselines: On real-world biological sequence tasks, VSD consistently achieved higher Precision and Recall than existing active generation baselines like CbAS (Conditioning by Adaptive Sampling) and DbAS. Furthermore, in traditional BBO tasks where the goal is to find the absolute best sequence, VSD remained highly competitive with—and often outperformed—state-of-the-art Latent Space Optimization (LSO) methods like LaMBO-2.

4. Scalability: VSD successfully handled sequences up to length 237 (GFP), demonstrating its ability to scale to realistic protein engineering dimensions where many traditional Bayesian methods falter.

Limitations and Future Work

While VSD represents a significant step forward for active generation, it has a few limitations. Like all methods relying on REINFORCE, the gradients can suffer from high variance. The authors utilized exponential smoothing to stabilize training, but more advanced variance reduction techniques could further improve efficiency. Additionally, VSD's success is tied to the quality of its Class Probability Estimator; if the surrogate classifier is overly confident or biased, the generative model will inherit those flaws.

Currently, VSD focuses on discrete combinatorial spaces. Extending this framework to mixed discrete-continuous spaces—such as designing molecules with specific continuous 3D side-chain conformations—remains a promising avenue for future research.

Summary updated

BibTeX
@inproceedings{steinberg2025variational,
  author = {Daniel M. Steinberg and Rafael Oliveira and Cheng Soon Ong and Edwin V. Bonilla},
  title = {{Variational Search Distributions}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=1vrpdV9U3i},
}
Figure