Abstract
Machine learning models are increasingly used to predict material properties and accelerate atomistic simulations, but the reliability of their predictions depends on the representativeness of the training data. We present a scalable, GPU-accelerated uncertainty quantification framework based on $k$-nearest-neighbor kernel density estimation (KDE) in a PCA-reduced descriptor space. This method efficiently detects sparsely sampled regions in large, high-dimensional datasets and provides a transferable, model-agnostic uncertainty metric without requiring retraining costly model ensembles. The framework is validated across diverse case studies varying in chemistry, prediction models, descriptors, and target properties. In all cases, the KDE-based score reliably flags extrapolative configurations, correlates well with conventional ensemble-based uncertainties, and highlights regions of reduced prediction trustworthiness. The approach offers a practical route for improving the interpretability, robustness, and deployment readiness of ML models in materials science.
Introduction: The Challenge of Silent Failures
In atomistic machine learning, Neural Network Potentials (NNPs) have emerged as powerful tools, capable of predicting energies and forces with quantum-mechanical accuracy at a fraction of the computational cost. However, these models suffer from a critical vulnerability: they often fail silently and catastrophically when presented with atomic configurations that lie outside their training distribution.
To mitigate this, the current gold standard for uncertainty quantification (UQ) is the "query-by-committee" or ensemble approach. By training multiple models and measuring their variance, researchers can identify regions of high uncertainty. While reliable, this approach is computationally expensive, requiring the training and execution of 5–10 separate models. This overhead is often prohibitive for large-scale datasets or long-duration molecular dynamics (MD) simulations. There is a pressing need for a fast, scalable, and model-agnostic UQ metric that provides ensemble-level reliability without the ensemble-level cost.
Methodology: Scalable KDE via PCA and GPU Acceleration
We propose a post-hoc UQ framework that evaluates the local density of training data around unseen atomic environments. The workflow consists of three primary stages:
- Descriptor Compression: High-dimensional atomic descriptors (e.g., 256-dimensional MACE or SOAP descriptors) are extracted from the training set. We utilize Principal Component Analysis (PCA) to compress these into a lower-dimensional space (typically 16 dimensions). Surprisingly, this aggressive reduction preserves the essential information needed for UQ.
- GPU-Accelerated Search: During inference, the framework employs the FAISS library to perform highly optimized $k$-nearest-neighbor searches within the training database for every atom in a new configuration.
- Kernel Density Estimation (KDE): A local density score, $\rho$, is calculated using an exponential kernel based on the distance to the $k$ neighbors. A score near 1 indicates a well-represented environment, while a score near 0 flags dangerous extrapolation.
As shown in Figure 1, the computational time scales linearly with the number of descriptors and remains highly efficient even as the PCA dimensionality increases. This efficiency allows the method to process millions of atomic environments in seconds.
Validation and Key Results
The framework was validated across four diverse case studies, including platinum clusters, water dynamics in zeolites, and NMR chemical shift predictions.
Performance and Accuracy
On the rMD17 benchmark, the KDE density score achieved a Spearman correlation coefficient identical to that of expensive ensemble methods, while outperforming other single-model alternatives like Gaussian Mixture Models. In the NMR chemical shift study, the KDE density perfectly correlated with the Mean Absolute Error (MAE) of the predictions; frameworks with low density scores consistently exhibited higher errors.
Correlation with Ensembles
A critical test for any single-model UQ method is how well it tracks with the traditional ensemble variance. As illustrated in Figure 5, the KDE density score ($\rho$) mirrors the behavior of ensemble energy variance. When the ensemble members diverge—indicating an out-of-distribution configuration—the KDE density score drops sharply, providing a clear signal of reduced confidence.
Efficiency Gains
The KDE method evaluated 1,000 test atoms against a 4-million atom database in under one minute on a single Tesla T4 GPU. This represents a speedup of more than 7x compared to running a standard 5-model ensemble, making it viable for real-time UQ during active learning or long MD runs.
Discussion and Future Outlook
Our results demonstrate that the intrinsic dimensionality of atomic environment descriptors is remarkably low, allowing for efficient UQ via PCA-KDE. This "plug-and-play" approach is entirely model-agnostic, working seamlessly with SchNet, MACE, or Kernel Ridge Regression models without requiring modifications to the underlying architecture.
While the method requires an upfront cost to compute and store the training database, its inference speed and reliability make it a powerful tool for deploying robust ML models. Future work will explore the theoretical underpinnings of why such aggressive dimensionality reduction is effective and how to further optimize database management for "foundation" models trained on billions of configurations. By providing a transparent confidence metric, this framework moves atomistic machine learning closer to reliable, automated discovery.
Summary updated