TL;DR
Diffusion models are great for generating 3D molecules, but they don't tell us when they've made a bad one. This paper introduces a post-hoc method to estimate the "uncertainty" of a generated molecule by looking at how much the model's internal predictions vary during generation. This uncertainty score effectively flags low-quality molecules and can be used to improve generation quality without retraining the model.
What Problem Does This Paper Address?
Generating realistic and chemically valid 3D molecules is crucial for drug discovery and materials science. Diffusion models have emerged as a powerful tool for this task, but a significant challenge remains: these models often produce molecules that are chemically invalid or unstable, yet they lack a reliable way to signal these failures. This means researchers might waste resources evaluating poor-quality outputs. Existing methods for flagging unreliable outputs in other domains (like image generation) haven't been systematically applied to molecular diffusion, leaving a gap in ensuring the quality of generated molecules.
Methods
The core of this paper's contribution is a post-hoc uncertainty estimation technique. It works by:
- Laplace Approximation of the Denoising Network: They fit an approximate posterior distribution (specifically, a Laplace approximation) to the parameters of a pretrained diffusion model's denoising network. This allows them to capture uncertainty about the model's internal workings without retraining.
- Noise Prediction Variability: During the molecule generation process (which involves a series of denoising steps), they measure how much the denoising network's prediction of the "noise" varies across multiple samples drawn from the approximate posterior. The intuition is that if the model is uncertain about its prediction, its outputs will be more variable.
- Aggregating Variability: This variability is measured across selected timesteps in the generation process, different atoms within the molecule, and different feature dimensions. These per-step uncertainties are then aggregated into a single, scalar uncertainty score for each generated molecule.
Datasets
- QM9: A standard dataset of small organic molecules (up to 9 heavy atoms) used for training and evaluation.
- GEOM-Drugs: A larger dataset of drug-like molecules with more atoms and conformational complexity, used for evaluating the robustness of the method.
Key Insights and Ideas
- Uncertainty as a Quality Signal: The most significant insight is that the model's internal "uncertainty" during generation is a strong indicator of the final molecule's quality. This is a crucial departure from relying solely on the model's output likelihood, which can be misleading.
- Post-hoc Flexibility: The method is "post-hoc," meaning it can be applied to any already trained diffusion model without needing to retrain it. This makes it highly practical for existing models.
- Test-Time Improvement: The uncertainty score can be directly used to improve generation quality after sampling. By generating more molecules than needed and filtering out those with high uncertainty, researchers can obtain a higher-quality set of molecules.
- Sensitivity vs. True Epistemic Uncertainty: Ablation studies suggest that the proposed uncertainty score might be more akin to a "sensitivity measure" (how much predictions change with small perturbations) rather than a strict Bayesian "epistemic uncertainty." This is still valuable for flagging issues.
Key Results
- Strong Correlation: The proposed uncertainty score shows a statistically significant negative correlation with established molecular quality metrics (molecular stability, atom stability, and validity) on the QM9 dataset. This means higher uncertainty corresponds to lower quality.
- Outperforms NLL: The uncertainty score is a better predictor of sample quality than the standard diffusion model log-likelihood (NLL) on QM9. For example, it achieved a -0.284 correlation with molecular stability compared to -0.15 for NLL.
- Test-Time Scaling Benefits: Using uncertainty-based filtering on QM9, researchers could improve molecular stability by ~10%, atomic stability by ~1%, and validity by ~5% by generating 20K molecules and keeping the best 10K. These gains were comparable to switching to a more powerful diffusion model.
- Dataset Dependency: The effectiveness of uncertainty-based filtering did not transfer to the larger GEOM-Drugs dataset, suggesting that the method's performance might be dataset-dependent or require adaptation for more complex molecular structures.
Limitations and Future Work
- Dataset Transferability: The paper acknowledges that the uncertainty estimation method's effectiveness did not transfer to the larger GEOM-Drugs dataset. Investigating why this is the case and how to adapt the method for more complex molecules is a key area for future work.
- Semantic Feature Space: The authors suggest exploring uncertainty estimation in a "semantic" feature space, potentially using a pretrained molecular encoder. This could offer a more robust approach, analogous to methods used in image generation.
- Adaptive Test-Time Scaling: The proposed uncertainty score is a natural replacement for NLL in existing adaptive test-time scaling methods, opening up further avenues for improving generation pipelines.
- Timestep Selection: While concentrating uncertainty measurement at later timesteps (closer to the clean sample) proved effective, further exploration of optimal timestep selection could be beneficial.
Summary updated