Paper commentary
Robust Training of Machine Learning Interatomic Potentials with Dimensionality Reduction and Stratified Sampling
DIRECT sampling picks diverse training structures for robust interatomic potentials
- Problem Active learning needs over 100 iterations on complex configuration spaces, and other routes still rely on their own sampling choices. Building a robust training set before expensive DFT runs has been hard.
- Method DIRECT builds the training set before any DFT runs. It encodes structures with an M3GNet model, reduces them with PCA, clusters them with BIRCH, and samples each cluster.
- Results DIRECT covers the feature space better than manual sampling, scoring 0.996 average coverage against 0.642 for manual sampling.
Where training-set selection gets stuck
Building a robust MLIP training set is hard because the configuration space is large and must be covered before DFT runs. Teams usually assemble that configuration space from domain expertise, such as ground-state structures, relaxation trajectory snapshots, strained structures, AIMD structures and defect structures. Ab initio calculations such as DFT then run on structures sampled from that space to obtain energies and forces as training data.
Active learning fills coverage gaps by using the MLIP to simulate the materials and adding structures that require extrapolation to refit it iteratively. Its key advantage is efficient uncertainty evaluation on new structures without referring to the DFT PES, which keeps the cost of structure augmentation low. For highly complex spaces it can be inefficient, as the authors' earlier fit of a 7-element complex concentrated perovskite required over 100 AL iterations.
An ideal strategy would generate and sample the configuration space before any DFT computation, so the iterations are not spent inside the loop. Montes De Oca Zapiain et al. showed that a tungsten MLIP trained on an EM set had much more consistent energy accuracy across both sets than one trained on the domain expertise set. Another high-throughput scheme applies random atom displacements and isotropic and anisotropic lattice scaling to non-diagonal supercells, and the as-fitted MLIPs reproduce the force constant matrix of crystalline systems.
Those routes still rely on their own sampling choices, which is the gap this paper targets.
The paper asks how to choose a spread-out set of structures from a large configuration space before the expensive DFT step. Its answer is DIRECT sampling, which the authors apply to 1.3 million structures from the Materials Project relaxation dataset.
The DIRECT idea in one pass
DIRECT treats training-set selection as a coverage problem in a fixed-length feature space. Each structure is first turned into a vector, and the selected set is meant to spread across that vector space. The workflow runs five steps in order: configuration space generation, featurization, dimensionality reduction, clustering and stratified sampling.
Only the structures picked by the last step reach DFT calculations, which are the most expensive part of the pipeline. Figure 1 draws the standard MLIP steps in black boxes and the proposed improvements in purple boxes.
The configuration space can come from AIMD trajectories, random displacements and lattice strains, or M3GNet MD sampling. The featurizer is the concatenated output of the final graph convolutional layer of a pre-trained M3GNet formation energy model, which has 128 elements. The authors reason that this layer already holds a fixed-length description of structure and chemistry, because it is used to predict formation energy.
The MEGNet formation energy model gives a 96-element vector, and it produces similar results.
Principal component analysis then reduces the normalized encoded features. The method keeps the first m PCs with eigenvalues over 1, following Kaiser's rule. BIRCH clusters the structures in the m-dimensional space, with each PC weighted by its explained variance. Clustering 50,050 Ti-H M3GNet MD snapshots into 3,000 clusters serves as the example in Figure 1.

Figure 1 : Workflow of DImensionality REduction - Clustering - sTratified (DIRECT) sam- pling. The standard steps in MLIP development are in black boxes, while the key conceptual improvements proposed in this work are highlighted in purple boxes. The methods in the brackets are those used in the present work, though they can be substituted with other sim- ilar approaches.
Original paper · CC BY 4.0 · Ji Qi, Tsz Wai Ko, Brandon C. Wood, Tuan Anh Pham, Shyue Ping Ong · Robust Training of Machine Learning Interatomic Potentials with Dimensionality Reduction and Stratified Sampling · Original paper figure · Extracted the figure area from page 5 of the original PDF.Stratified sampling then takes k structures from each cluster to build the training set. With k equal to 1, the structure closest to each cluster centroid is chosen. With k above 1, the structures are sorted by distance to the centroid and picked at constant index intervals. Static DFT calculations then run on at most n times k structures.
DIRECT can feed an active learning loop, but it aims to cover the configuration space before any DFT runs, so fewer AL iterations are needed.
Encoding and reducing the features
DIRECT feeds the 128-element M3GNet vectors into principal component analysis before any clustering happens. The encoder output comes from the final graph convolutional layer of the M3GNet formation energy model, which the authors chose as the structure featurizer. The 96-element MEGNet vectors give similar results, so the authors kept the M3GNet vectors for the main workflow.
PCA runs on these normalized fixed-length features, so every structure ends up as a short coordinate vector in a shared space.
The number of components follows Kaiser's rule. DIRECT keeps the first m principal components whose eigenvalues are over 1. Each kept component explains more variance than any single original variable, so the reduced space keeps the main spread of the features. The workflow figure plots only the first two components for ease of visualization, even though the authors usually use more than two.
Before clustering, the BIRCH step weights each principal component by its explained variance. This weighting keeps the components that carry more variance from being swamped by the minor ones. The reduced, weighted features then pass to BIRCH, which groups them by location in the m-dimensional space.
Clustering and stratified selection in DIRECT
Each principal component is weighted by its explained variance before clustering, so the components that carry more variance count for more. As an example, the authors cluster 50,050 Ti-H M3GNet MD snapshots into 3,000 clusters. The number of clusters n can range from 1 to N, and the desired accuracy and computational budget set the choice.
Within each cluster, DIRECT sorts the structures by their Euclidean distance to the cluster centroid. When k is 1, the structure with the shortest distance to the centroid is selected from each cluster. When k is greater than 1, DIRECT takes k structures at constant index intervals along that sorted list, which spreads the picks across the cluster.
A cluster smaller than k contributes all of its members, and the user decides whether duplicate selection is allowed.
Static DFT calculations then run on at most n times k structures, so n and k together set the DFT budget M. The authors suggest a large n, close to M, so that the extrema of the configuration space are covered. Choosing k above 1 reduces the CPU and memory needs for clustering when n can't reach M for large N and M. An interlacing approach follows naturally: the user can start with k = 1 and raise k later if more resolution is needed.
DIRECT is designed to cover the configuration space before DFT, so it can run without an active learning loop.
Coverage against manual sampling
The test runs on MPF.2021.2.8.All, which keeps all ionic steps from both relaxations and is cleaned down to 1,315,097 structures. The manual sampling set holds 185,877 structures, while DIRECT with n = 20,044 and k = 20 builds a set of 185,670 structures. Because the two sets are nearly the same size, the comparison isolates how the sampling strategy spreads structures across feature space.
The coverage score divides the range of each principal component into 50,000 bins and counts the bins that hold at least one sampled structure. Across the first 14 PCs, DIRECT averages 0.996, while manual sampling averages 0.642, and every manual-sampling PC stays below 0.8. Looking at the first two PCs, manual sampling undersamples structures at the boundaries of the feature space, whereas DIRECT covers those edges.
Similar trends appear for the 128-element M3GNet feature space, so the result doesn't depend on the PC projection alone.
The M3GNet features compress the data more efficiently than the MEGNet features do. The first 2 PCs explain 49% of the variance and the first 14 PCs explain 93% for M3GNet. For MEGNet, the first 2 PCs explain 25% and the first 14 PCs explain 57%. The authors credit the 3-body interactions in M3GNet for this more robust encoding.
DIRECT also produces a much larger mean absolute deviation (MAD) than manual sampling in energy, force and stress. Energies give a MAD of 1.73 eV atom−1 for DIRECT against 1.34 eV atom−1 for manual sampling. Stresses give 3.49 GPa for DIRECT against 1.95 GPa for manual sampling. The authors attribute this gap to DIRECT sampling more uncommon local environments in feature space.
Testing the DIRECT-trained universal potential on both test sets
The authors retrained M3GNet-DIRECT and M3GNet-MS with the original M3GNet settings, but with atom embedding and MLP dimensions doubled from 64 to 128. Each test set is a random 5% of its own dataset, so the DIRECT test set holds 7,635 structures and the MS test set holds 7,684. The authors excluded any structure that appeared in the training or validation processes of either potential from both test sets.
Each potential is expected to do best on its own dataset, and the paper confirms this pattern in its parity plots.
M3GNet-DIRECT keeps comparable MAEs across both test sets, which the authors read as better extrapolation to harder structures. The DIRECT test set is the harder of the two, with more data points that have large energies, forces and stresses and larger MADs. Averaged over both test sets, M3GNet-DIRECT gives 0.041 eV atom −1 for energies, 0.101 eV Å−1 for forces and 0.54 GPa for stresses.
The original M3GNet UP reports 0.035 eV atom −1, 0.072 eV Å−1 and 0.41 GPa, so the M3GNet-DIRECT errors are only slightly higher.
The cumulative error plots compare the two potentials on the combined test data from both sets. M3GNet-MS and M3GNet-DIRECT have similar errors for about 90% of the test structures. For the remaining, most challenging 10% of structures, M3GNet-DIRECT gives lower energy, force and stress errors than M3GNet-MS.
Energy above hull on unseen oxides and sulfides
The test set holds 506 O-containing and 291 S-containing hypothetical materials, drawn from about 30 million candidates. Each structure was relaxed with the M3GNet UP using a force convergence criterion of 0.1 eV Å−1. The energy above hull was then compared against DFT-calculated structures in the Materials Project. Only converged DFT results were kept as test sets, so each group started from 1,000 selected candidates.
The authors plotted the cumulative absolute error in Ehull for both groups in Figure 5.
For the O-containing compounds, M3GNet-DIRECT improves on M3GNet-MS only slightly. For the S-containing compounds, the gap is much wider, which is where the two potentials really differ. The error distribution of M3GNet-DIRECT looks similar for O-containing and S-containing materials. M3GNet-MS, in contrast, performs much worse on the S-containing set than on the O-containing set.
The authors trace this gap back to the composition of the original Materials Project training data. That dataset holds 34,556 O-containing materials and only 5,333 S-containing materials among 62,783 compounds. A training set built from that imbalance serves S-containing materials worse, which matches the M3GNet-MS result. The DIRECT set, built from clusters over the feature space, narrows that gap for the sulfides.
Sampling titanium hydride configurations with M3GNet MD
Titanium hydride is a hard test for MD because hydrogen diffuses quickly even at ambient temperatures. A relatively short time step of about 0.5 fs is required for stable MD simulations of this system. That makes the Ti-H system a robust test for the proposed workflow. The authors chose the moment tensor potential (MTP) here because descriptor-based MLIPs are more computationally efficient for a particular chemistry than universal potentials.
Their low model complexity relative to UPs is the reason given for this efficiency.
The configuration space for TiHn was built from multi-temperature MD runs with the M3GNet-DIRECT UP over a set of hydrogen compositions. The Ti-H dataset covers 91 supercells of crystalline and grain boundary TiHn structures at 300, 1000 and 3000 K, plus a 3×3×2 supercell of H2 at 300 K. Each of the 274 MD runs lasted 10 ps with a time step of 0.5 fs.

Figure 6 : Plot of the first two principal components of the feature space of TiH n (0 ≤ n ≤ 2) sampled by structures from three different sources, i.e., 75,000 AIMD snapshots for HCP Ti36H2, BCC Ti 36H36 and FCC Ti 36H72 at 1000 K, 2,063 configurations from MTP AL and 273,000 MD NpT snapshots from M3GNet-DIRECT. H 2 structures are excluded in this analysis to ensure better resolution for Ti-containing structures.
Original paper · CC BY 4.0The authors compare three configuration sources for the same Ti-H feature space. The first source is 75,000 AIMD snapshots of HCP Ti36H2, BCC Ti36H36 and FCC Ti36H72 at 1000 K. The second source is 2,077 structures collected by MTP AL for the same 274 MD scenarios that M3GNet MD used. The third source is 273,000 MD NpT snapshots from M3GNet-DIRECT, and the AIMD and MTP AL snapshots are projected onto the same first two principal components.
In contrast, M3GNet-DIRECT MD samples the largest configuration space and covers most of the region visited by MTP AL and AIMD. The few AL structures outside the M3GNet-DIRECT region may need extra MD conditions or AL coupled with DIRECT sampling. The authors didn't test that coupling in this section, so the coverage claim rests on the projection alone.
MTP accuracy against active learning
The MTP-DIRECT training set starts from one structure picked from each of 954 clusters. DFT static calculations on those structures converged for 947 of them, and these formed the MTP-DIRECT training set. The test set holds 400 AIMD snapshots taken from four 10-ps trajectories at 0.1 ps intervals. The four trajectories cover HCP Ti 36H2 at 1000 K, BCC Ti 36H36 at 1000 K, and FCC Ti 36H72 at 1000 and 3000 K.
Static DFT calculations on these AIMD snapshots supply the reference energies and forces for the test data.
Both MTPs reach comparable test MAE and RMSE, below 10 eV atom −1 for energies and 0.15 eV Å−1 for forces. The predictions of both MTPs lie close to the diagonal line in the parity plots. The authors read this closeness as high reliability of MTP-DIRECT and MTP-AL for Ti-H energies and forces. MTP-DIRECT is trained on 947 structures, while MTP-AL uses 2,077, so the DIRECT training set is about half the size.
The test set covers only four AIMD trajectories, so this accuracy evidence applies to those titanium hydride scenarios.
Active learning iterations needed for MD reliability
The authors ran the same active learning process on MTP-DIRECT that they used to train MTP-AL. They counted an MD run as reliable when no snapshot within the 10 ps had an extrapolation grade γ over 3. The authors call this a fairly strict threshold for reliability. All MD runs by MTP-DIRECT at 300 and 1000 K for the 91 Ti-containing Ti-H structures finished at the 0th AL iteration.
None of those runs showed any structure with γ over 3, so MTP-DIRECT was already reliable without AL for those scenarios.
After just 5 AL iterations, MTP-DIRECT reliably completed the 91 MD runs for Ti-H at 3000 K. The same 5 iterations also made the MD run for H72 at 300 K reliable. Starting AL from scratch, with the 92 MD starting structures as the initial training set, took about 10 iterations at 300 K. The same scratch run took about 20 iterations at 3000 K, and H72 at 300 K needed 28 iterations.
Starting from the DIRECT set cuts the AL iterations needed to reach MD reliability by 75%. The DIRECT start also cuts the static DFT calculations by 50%, compared to the simple AL scheme. The 947-structure DIRECT training set is therefore a strong starting point, not just a final fit.
Hydrogen diffusion predictions
Both MTPs reproduce the AIMD ordering of hydrogen mean squared displacement at 1000 K, which is highest in BCC and lowest in FCC. The larger fluctuation of hydrogen MSD in HCP Ti36H2 under AIMD is attributed to the few hydrogen atoms in that cell. Using 3 × 3 × 2 supercells in MTP simulations largely ameliorates this limitation, because MLIPs are computationally efficient.
The authors ran 1-ns MD/NpT simulations with MTP-AL and MTP-DIRECT from 300 to 1000 K in 100 K intervals. Both MTPs agree well on the predicted activation energy and diffusivity, as shown in the Arrhenius plot in Figure 9b. MTP-DIRECT gives 0.42 eV for HCP Ti36H2, while MTP-AL gives 0.49 eV. For BCC Ti36H36, MTP-DIRECT gives 0.14 eV and MTP-AL gives 0.16 eV.
For FCC Ti36H72, MTP-DIRECT gives 0.91 eV and MTP-AL gives 0.80 eV. These values match experimental activation energies of 0.45 eV for HCP from 873 to 1298 K, 0.15 eV for BCC from 555 to 625 K, and 0.92 eV for FCC from 670 to 880 K.
Experimental hydrogen diffusivities are 3 × 10−5, 8 × 10−5 and 6 × 10−8 cm2/s for HCP, BCC and FCC at 1000 K, 800 K and 800 K, respectively. The comparison is made across different temperature ranges, so the agreement is at the level of magnitude and trend.
Limits of the evidence
The MTP accuracy comparison uses test structures from four 10-ps AIMD trajectories only, so its evidence covers just those titanium hydride scenarios. The 400 test structures come from HCP Ti36H2 at 1000 K, BCC Ti36H36 at 1000 K, and FCC Ti36H72 at 1000 and 3000 K. Both MTPs reach test MAE and RMSE below 10 eV atom−1 for energies and below 0.15 eV Å−1 for forces, so the comparison is between two similar models.
The MTP-DIRECT training set has 947 structures, which is half the 2,077 structures generated by MTP AL. The Ti-H experiments test one system, and the titanium hydride MTP was fitted with a single set of settings. The MTP cutoff radius was fixed at 5 Å and the maximum level at 20, and the energy, force and stress weights were set at 1, 0.01 and 0.
They didn't vary these settings across other hydride compositions or cutoffs in the paper.
The DIRECT set's gain over the MS set is small for O-containing compounds, with Ehull errors that differ only slightly between the two UPs. The Ehull test set is small, with 506 O-containing and 291 S-containing hypothetical materials. The Materials Project set holds 34,556 O-containing and 5,333 S-containing materials, which the authors link to the M3GNet-MS gap.
The M3GNet-DIRECT average MAEs of 0.041 eV atom−1, 0.101 eV Å−1 and 0.54 GPa are slightly higher than the original M3GNet UP values of 0.035 eV atom−1, 0.072 eV Å−1 and 0.41 GPa.
The authors describe several DIRECT options, such as the k above 1 interlacing approach, as ideas whose scope this study doesn't test. They didn't test DIRECT with other MLIP architectures, and they state that it is agnostic to the chosen architecture. The paper also reports that the M3GNet-DIRECT gains are concentrated in the most challenging 10% of test structures.
Paper info
- Authors
- Ji Qi, Tsz Wai Ko, Brandon C. Wood, Tuan Anh Pham, Shyue Ping Ong
- Venue
- arXiv · Preprint
- First published
- 2023-7-24
- Added
- 2026-11-6
- Updated
- 2023-7-24
- Version
- v1
- arXiv
- 2307.13710
- Category
- cond-mat.mtrl-sci
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Machine learning interatomic potentials (MLIPs) enable the accurate simulation of materials at larger sizes and time scales, and play increasingly important roles in the computational understanding and design of materials. However, MLIPs are only as accurate and robust as the data they are trained on. In this work, we present DImensionality-Reduced Encoded Clusters with sTratified (DIRECT) sampling as an approach to select a robust training set of structures from a large and complex configuration space. By applying DIRECT sampling on the Materials Project relaxation trajectories dataset with over one million structures and 89 elements, we develop an improved materials 3-body graph network (M3GNet) universal potential that extrapolate more reliably to unseen structures. We further show that molecular dynamics (MD) simulations with universal potentials such as M3GNet can be used in place of expensive \textit{ab initio} MD to rapidly create a large configuration space for target materials systems. Combined with DIRECT sampling, we develop a highly reliable moment tensor potential for Ti-H system without the need for iterative optimization. This work paves the way towards robust high throughput development of MLIPs across any compositional complexity.
Quote from the paper
Ji Qi, Tsz Wai Ko, Brandon C. Wood, Tuan Anh Pham, Shyue Ping Ong (2023). Robust Training of Machine Learning Interatomic Potentials with Dimensionality Reduction and Stratified Sampling. arXiv:2307.13710v1. https://arxiv.org/abs/2307.13710v1
BibTeX
@misc{qi2023robust,
title = {{Robust Training of Machine Learning Interatomic Potentials with Dimensionality Reduction and Stratified Sampling}},
author = {Ji Qi and Tsz Wai Ko and Brandon C. Wood and Tuan Anh Pham and Shyue Ping Ong},
year = {2023},
eprint = {2307.13710},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2307.13710v1}
}