TL;DR
The Latent Prompt Transformer (LPT) unifies molecule generation and property optimization into a single end-to-end framework, using a continuous latent vector as a prompt to guide a causal Transformer. By combining MCMC-based maximum likelihood estimation with an online distribution-shifting algorithm, LPT progressively generates molecules with highly optimized target properties, achieving state-of-the-art results across single-objective, multi-objective, and structure-constrained design tasks.
What Problem Does This Paper Address?
Designing molecules with specific biological or chemical properties is a cornerstone of drug discovery, but navigating the vast chemical space is notoriously difficult. A popular approach is Latent Space Optimization (LSO), which maps discrete molecular structures into a continuous, low-dimensional latent space (often using a Variational Autoencoder, or VAE) where optimization algorithms can search more easily.
However, traditional LSO methods suffer from a major drawback: decoupling. The generative model is trained completely separately from the property optimization stage. As a result, the learned latent space isn't tailored to the specific target properties you want to optimize. Furthermore, VAEs require an auxiliary encoder network for training, which introduces extra parameters and complexity.
This paper introduces the Latent Prompt Transformer (LPT) to solve these issues by unifying molecule generation and property prediction within a single, cohesive probabilistic framework.
Methods
LPT models the joint distribution of a molecule $x$ and its property $y$ via a shared continuous latent variable $z$, which acts as an information bottleneck. The architecture consists of three core components:
- A Learnable Prior Model $p_\alpha(z)$: Instead of a standard, uninformative Gaussian prior, LPT uses an implicit generator (parameterized by a 1D UNet) that transforms Gaussian white noise into an informative latent prompt space.
- A Molecule Generation Model $p_\beta(x|z)$: A 3-layer causal Transformer that treats the latent vector $z$ as a prompt, incorporating it at every step of autoregressive sequence generation via cross-attention mechanisms.
- A Property Predictor Model $p_\gamma(y|z)$: A small multi-layer perceptron (MLP) that predicts real-valued properties or binary constraints directly from the latent prompt.
Training and Optimization Loop
- MCMC-based MLE: LPT eliminates the need for an auxiliary variational encoder network. Instead, it uses Markov chain Monte Carlo (MCMC) sampling—specifically Langevin dynamics—to sample from the exact posterior distribution $p(z_0|x,y)$ during Maximum Likelihood Estimation (MLE) training.
- Online Learning via Distribution Shifting: To discover molecules that far exceed the properties present in the initial training data, the authors use an online learning loop. The model targets a property value slightly beyond its current boundary ($y^* + \delta_y$), infers the corresponding latent prompt, generates new candidate molecules, evaluates them using an external oracle, and adds them to a replay buffer to retrain the model.
- Persistent Markov Chains (PMC): To overcome the computational overhead of MCMC, LPT initializes the sampling chains from the previous iteration's output rather than restarting from random noise, reducing the required MCMC steps from 15 down to 2 (a $5\times$ speedup).
Datasets
The authors evaluated LPT across several chemical and biological benchmarks:
- ZINC (250K dataset): Used for offline pre-training of the molecular sequence generation model using SELFIES representations.
- Design-Bench: Evaluated on TF Bind 8 (optimizing 8-base DNA sequences for binding affinity) and GFP (optimizing 237-amino acid protein sequences for fluorescence).
- Practical Molecular Optimization (PMO): Used to evaluate sample efficiency under a strict budget of 10,000 oracle queries.
- PHGDH-NAD (New Benchmark): The authors introduced a highly practical new task: designing molecules that bind to the NAD binding site of Phosphoglycerate dehydrogenase (PHGDH), a critical cancer therapeutic target. They manually processed data to ensure compatibility with AutoDock-GPU docking software.
Key Insights and Ideas
- Latent Vectors as Prompts: Instead of using the latent vector merely to initialize a decoder, LPT feeds the latent vector into the Transformer via cross-attention at every generation step. This ensures the target property constraints tightly guide the entire autoregressive generation process.
- The Power of Posterior Sampling: By treating optimization as a conditional sampling problem ($x \sim p(x|y)$), LPT can leverage Bayes' rule to infer the ideal latent prompt from a desired property value before generating the molecule.
- Prioritized Retraining: During the online learning phase, LPT uses weighted retraining, assigning higher importance weights to synthetic molecules that achieve top property scores. This forces the generative model to focus its capacity on high-value regions of chemical space.
Key Results
LPT achieved state-of-the-art performance across single-objective, multi-objective, and structure-constrained optimization tasks.
Binding Affinity Maximization
When optimizing for binding affinity (measured by the dissociation constant $K_D$, where lower is better), LPT significantly outperformed strong baselines like LIMO and SGDS. On the newly proposed PHGDH target, LPT discovered molecules with exceptionally strong binding affinities:
Online Distribution Shifting
The online learning algorithm successfully shifted the generated molecule distribution toward higher docking scores over successive iterations, demonstrating its ability to extrapolate effectively beyond the training data.
Biological Sequence Design
On the Design-Bench tasks, LPT achieved a top performance score of 0.954 on TF Bind 8 (outperforming GFlowNet-AL's 0.84) and 0.857 on GFP (outperforming COMS' 0.831), while maintaining highly competitive sequence diversity.
Limitations and Future Work
While LPT demonstrates exceptional performance and sample efficiency, the authors note a few limitations:
- Data Intensity: Generative models inherently require a substantial amount of data for initial training compared to purely heuristic or genetic algorithms, which can create a performance gap when working under extremely tight data budgets without pre-training.
- Multi-Objective Trade-offs: While LPT handles multi-objective tasks via heuristic combinations, future work is needed to better characterize and navigate the exact Pareto front of optimal solutions.
- Alternative Architectures: The current model relies on sequence-based representations (SMILES/SELFIES); extending the latent prompt framework to graph- or 3D-based molecular architectures remains an open area for exploration.
Summary updated