Define latent spaces by example: optimisation over the outputs of generative models

Samuel Willis, Alexandru I. Stere, Dragos D. Margineantu, Henry T. Oldroyd, John A. Fozard, Carl Henrik Ek, Henry Moss, Erik BodinarXiv 2025 · DOI

Introduction

Modern generative AI models, such as diffusion and flow matching architectures, have revolutionized content creation. However, "steering" these models to produce outputs that satisfy complex, specific constraints remains a significant challenge. This paper introduces surrogate latent spaces, a novel framework for efficient black-box optimization over the outputs of high-dimensional generative models without the need for fine-tuning or gradient access.

The Challenges of Latent Space Optimization

Optimizing the outputs of models like Stable Diffusion or RFDiffusion typically faces two major hurdles:

  1. The Curse of Dimensionality: Latent spaces often match the dimensionality of the output data, reaching millions of dimensions. Searching such a vast space is computationally prohibitive.
  2. The Manifold Problem: Direct optimization in high-dimensional space often leads the model away from the "manifold" of realistic data, resulting in physically implausible or visually incoherent "garbage" outputs.

Methodology: Surrogate Latent Spaces

The proposed solution involves constructing a low-dimensional (e.g., 2D to 100D) subspace defined by a small set of "seed" examples. This approach transforms the optimization problem into a manageable navigation task within a custom-built "surrogate" space.

Key Components

  • By-Example Definition: Users select a few seed examples that approximate the desired output. These seeds define the axes of the surrogate space.
  • Latent Optimal Linear combinations (LOL): This framework maps a simple Euclidean coordinate system onto the model’s complex latent distribution, ensuring that every point in the surrogate space corresponds to a valid, high-quality output.
  • Stationarity via Weight Charts: By utilizing the Knothe-Rosenblatt chart, the authors ensure that distances in the search space correlate with similarity in the output space, creating a "smooth" landscape for optimizers like Bayesian Optimization (BO) or CMA-ES.
Visualization of the surrogate latent space optimization process, showing seed images ($x_1, x_2, x_3$), the resulting interpolated image grid, and the ImageReward score landscape.

Experimental Results

The researchers validated their approach across multiple domains, including images, proteins, audio, and video.

Protein Design

In a challenging task involving the generation of 600-residue proteins, standard sampling techniques typically fail (0% success rate). By applying surrogate latent spaces with the CMA-ES optimizer, the authors achieved a ten-fold increase in successful and diverse protein designs, producing physically plausible structures where baselines could not.

Image Steering

Using models like FLUX.1-schnell and Stable Diffusion, the method was evaluated on prompt-following benchmarks (ImageReward and PickScore). The "zero-training" surrogate approach achieved reward scores comparable to state-of-the-art fine-tuning methods like DPOK, but without the hours of GPU-intensive training.

Conclusion and Future Directions

Surrogate latent spaces offer a highly efficient, architecture-agnostic way to steer generative models. By "Euclidean-izing" the manifold, the method makes robust, classical black-box optimization algorithms compatible with modern high-dimensional AI. Future work may explore adaptive seed selection to allow the search space to evolve dynamically as the optimizer discovers better regions of the latent manifold.

Summary updated

BibTeX
@misc{willis2025define,
  author = {Samuel Willis and Alexandru I. Stere and Dragos D. Margineantu and Henry T. Oldroyd and John A. Fozard and Carl Henrik Ek and Henry Moss and Erik Bodin},
  title = {{Define latent spaces by example: optimisation over the outputs of generative models}},
  year = {2025},
  eprint = {2509.23800},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.23800},
}
Figure