Explainable active learning in investigating structure–stability of SmFe12-α-βXαYβ structures X, Y {Mo, Zn, Co, Cu, Ti, Al, Ga}

In this article, we propose a query-and-learn active learning approach combined with first-principles calculations to rapidly search for potentially stable crystal structure via elemental substitution, to clarify their stabilization mechanism, and integrate this approach to SmFe12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{12}$$\end{document}-based compounds with ThMn12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{12}$$\end{document} structure, which exhibits prominent magnetic properties. The proposed method aims to (1) accurately estimate formation energies with limited first-principles calculation data, (2) visually monitor the progress of the structure search process, (3) extract correlations between structures and formation energies, and (4) recommend the most beneficial candidates of SmFe12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{12}$$\end{document}-substituted structures for the subsequent first-principles calculations. The structures of SmFe12-α-βXαYβ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{12-\upalpha -\upbeta }\mathsf {X}_{\upalpha }\mathsf {Y}_{\upbeta }$$\end{document} before optimization are prepared by substituting X,Y\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathsf {X}, \mathsf {Y}$$\end{document} elements—Mo, Zn, Co, Cu, Ti, Al, Ga—in the region of α+β<4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\upalpha +\upbeta <4$$\end{document} into iron sites of the original SmFe12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{12}$$\end{document} structures. Using the optimized structures and formation energies obtained from the first-principles calculations after each active learning cycle, we construct an embedded two-dimensional space to rationally visualize the set of all the calculated and not-yet-calculated structures for monitoring the progress of the search. Our machine learning model with an embedding representation attained a prediction error for the formation energy of 1.25×10-2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$1.25\times 10^{-2}$$\end{document} (eV/atom) and required only one-sixth of the training data compared to other learning methods. Moreover, the time required to recall most potentially stable structures was nearly four times faster than the random search. The formation energy landscape visualized using the embedding representation revealed that the substitutions of Al and Ga have the highest potential to stabilize the SmFe12\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{12}$$\end{document} structure. In particular, SmFe9\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{9}$$\end{document}[Al/Ga]2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{2}$$\end{document}Ti showed the highest stability among the investigated structures. Finally, by quantitatively measuring the change in the structures before and after optimization using OFM descriptors, the correlations between the coordination number of substitution sites and the resulting formation energy are revealed. The negative-formation-energy-family SmFe12-α-β\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{12-\upalpha -\upbeta }$$\end{document}[Al/Ga]αYβ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$_{\upalpha }\mathsf {Y}_{\upbeta }$$\end{document} structures show a common trend of increasing coordination number at substituted sites, whereas structures with positive formation energy show a corresponding decreasing trend. Seeking the next generation of high-performance magnets is a crucial demand for replacing the widely accepted Nd-Fe-B magnets developed in the middle 80s. The iron-rich compounds with the original tetragonal ThMn12 structure appear as the most potential candidates except for the hard synthesizing it in nature due to its high energy of formation. Stabilization for this material system is expected by substituting new elements, but the vast number of possible structures makes the exploration difficult even for theoretical calculations. This article proposes an integration of first-principles calculations and explainable active learning to efficiently explore the crystal structure space of this material system. In particular, the explored crystal structure space can be rationally visualized, on which the relationship between substitution elements, substitution sites, and crystal structure stabilization can be intuitively interpreted.


Introduction
Finding functional and useful crystals or molecular structures is highly challenging, and numerous methods have been proposed. 1 -6 Even when the crystal structures are limited to those for which prototypes are known, the enormous number of possible substitutions of elements leads to considerable diffi culty in characterizing the function of physical properties associated with these structures. Within the vast pool of possible crystals or molecular structures, researchers frequently confi ned their explorations to a looping search set, formulating hypotheses about structures of interest and then verifying these hypotheses by validating physical properties using experiments or theoretical calculations. Naively, this approach is closely associated with the trial-and-error problem-solving method with solution-oriented and problem-specifi c features.
Solution-oriented approaches seeking to fi nd optimal solutions invest relatively little eff ort to reveal why and how the solution is found (e.g., optimal structures in materials discovery). Besides, problem-specifi c approaches make little eff ort to generalize the solution to diff erent problem scopes (e.g., extending the structure search space). Therefore, these approaches inevitably involve limitations when deployed in a screening space with wider bounds than the known material structures.
In this study, we propose a query-and-learn architecture based on active learning to assist researchers in actively monitoring the material structure discovery process. The query-andlearn method aims to (1) accurately estimate physical properties from the most limited fi rst-principles data, (2) accelerate the search for outstanding structures, (3) interpret the structure search process, and (4) generalize fi ndings by extracting the structure-property correlations. The problem regarding the formation mechanism of SmFe 12 -based compounds with the ThMn 12 structure is used to demonstrate the eff ectiveness of the proposed method.
The original structure of iron-rich SmFe 12 compounds were fi rst discovered in the late 1980s. 9 -11 It was expected that they would show high saturation magnetization, magnetocrystalline anisotropy, and Curie temperature. 12 However, SmFe 12 and other families of RFe 12 with R denoting a rare earth element have not been widely adopted to produce the excellent magnets that can be obtained owing to the practical diffi culty of stabilizing the material. Numerous studies have substituted elements such as Co, Ti, V, Cr, Mo, W, or Ga to obtain a stable ThMn 12 -type phase. 13 -19 Unrestricted from ternary compounds, recently researchers have emphasized searching for the most potentially stable SmFe 12 -based quaternary compounds using the bi-element substitution method. 20 -27 Because the stabilizing elements are assumed to be substituted at the Fe sites, a large supercell of SmFe 12 should be considered as a host structure to investigate substitution structures with the possibility of diverse elemental substitutions. Therefore, a more effi cient methodology to investigate the structure space, where the number of candidates increases combinatorially, is urgently required. Figure 1 summarizes key components in the query-andlearn active learning design in discovering formable SmFe 12 -based compounds in the ThMn 12 structure. At the beginning of the query step, a pool of not-yet-calculated structures is created by applying substitution operators on the prototype of SmFe 12 . The system queries the most informative candidates to estimate their properties before updating them to the training data of machine learning predictors. Canonically, the informativeness of queried structures is assumed to show the most signifi cant impact to improve the accuracy of the prediction model. However, the predictive ability term is usually challenging to clarify explicitly because predictive evaluations often lack information on the relative position among new queried-training-testing data. For example, authors in References 28 and 29 reported exploration strategies by assuming out-of-distribution structures as superior structures. Therefore, querying then accurately predicting structures in the out-of-distribution region are on the top demand rather than the task of predicting properties for all not-yet-calculated structures in the pool. Furthermore, the methods by which the estimator inferred the predicted value and the learned function changed by adding queried data are often blind to researchers' monitoring the discovery process. In the learn step of the query-and-learn design, we extend the prediction model's interpretability by introducing metric learning in transforming the original structure representation vector into a low-dimensional space, which preserves the smoothness of the function of formation energy. Consequently, information in the structure search progress can be actively monitored including prediction accuracy; features of the learned model, regions of outstanding structures, or inter-correlations between query structures with training structures. Studies of active learning designs used in materials science are shown in References 28 and 30 -32 , besides other machine learning-assisted material designs shown in  The contributions of this work are summarized as follows: • We investigate systematically the formation energy and magnetization of 3307 SmFe 12−α−β X α Y β with X, Y as Mo, Zn, Co, Cu, Ti, Al, and Ga, limited by α + β < 4 using the VASP calculation procedure from OQMD. 36 • We confi rm that SmFe 9 [Al/Ga] 2 Ti structures have the highest stability and SmFe 9 Co 3 structures have optimal magnetization value. • We confi rm that the SmFe 12−α−β [Al/Ga] α Y β structures show on average negative formation energies and an increase in the coordination number at substituted sites (Al/Ga), whereas other families showed opposite trends. • We propose an active learning design with embedding representation of orbital-fi eld matrix that achieves an optimal prediction accuracy and recalls outstanding structures using limited training data.
• We extract a relationship of bi-elements substitution to the stability, that is, SmFe 12−α−β [Al/Ga/Ti] α Y β is potentially stable, and SmFe 12−α−β [Mo] α Y β is potentially unstable, which can be interpreted using the embedding representation.
In the following sections, we will explain the proposed approach in detail, and use it for fi nding potentially stable SmFe 12 -based compounds. The exploration space for discovering potentially stable SmFe 12−α−β X α Y β structures is set with X and Y as Mo, Zn, Co, Cu, Ti, Al, and Ga, limited by α + β < 4 , where α and β are integers. We will demonstrate the effi ciency of the proposed approach, and show how to extract information associated with structural stability. Details of the data preparation are shown in the " First-principles calculation " section. The " Active learning design " section presents the components of the active learning architecture in detail. Last, the " Experiment and discussion " section shows the performance of active learning designs and the results of interpreting correlations extracted from the embedding space regarding the formation energy.

Creation of SmFe 12-α-β X α Y β structures
We focus on SmFe 12 -based crystalline magnetic materials under the formula SmFe 12−α−β X α Y β with X and Y as the substituted elements from Mo, Zn, Co, Cu, Ti, Al, and Ga; α and β are integer numbers of X and Y compositions, respectively. A hypothetical-not-yet-calculated structure is created by substituting α iron sites with the element X and β iron sites with the element Y . There are numerous possible hypothetical structures; hence, we limit our investigation to α + β < 4 . Owing to the symmetrical properties of the iron sites in the host SmFe 12 structure, new substituted structures were compared with one another to remove duplications. We followed the comparison procedure proposed by qmpy, a Python application programming interface of OQMD. 36 The internal coordinates of the structures were compared by examining all rotations allowed by each lattice and searching for rotations and translations to map the atoms of the same species into one another within a given level of tolerance. Here, any two structures with a percent deviation in lattice parameters and angles smaller than  The data set contains optimized structures, calculated formation energies, and structural deformations from the initial structures. Middle: from the data set of calculated structures, a two-dimensional embedding space is learned by applying metric learning for kernel regression on the orbitalfi eld matrix representation 7 , 8 and the calculated formation energy E of the optimized structures. A regression function estimating the formation energy E from the coordinates of substituted structures in the embedding space is learned from the data set of calculated structures to estimate the E for the not-yet-optimized structures. The expected formation energy prediction errors are also used to recommend candidates for the subsequent fi rst-principles calculation from among the structures that have not yet been calculated. The structure-stability relationship is mined as the correlation between local embedding representation and E . Right: structures with high potential to improve the regression function are queried to fi rst-principles calculations to optimize the structure, estimate the formation energy E , and evaluate the deformation after structure optimization. The calculated data are then updated to the data set of calculated structures. EXPLAINABLE ACTIVE LEARNING IN INVESTIGATING STRUCTURE-STABILITY OF SMFE 12-α-β X α Y β STRUCTURES X, Y = {MO, ZN, CO, CU, TI, AL, GA} 0.1 were considered identical. Furthermore, we applied our designed orbital-fi eld matrix (OFM) 7 , 8 to eliminate duplication. Notably, two structures were considered the same when the L 2 norm of the OFM diff erence was less than 10 −3 .
To initialize the active learning model data set, we substituted one atom from Mo, Zn, Co, Cu, Ti, Al, and Ga to one iron site of the SmFe 12 host structure. Consequently, there were 283 structures under the formula SmFe 12−α X α with α ∈ {1, 2, 3} . By substituting two elements, we created 3024 structures using the formula SmFe 12−α−β X α Y β with α + β < 4 . We used this data set as an initial of not-yet-calculated data set D ¬calculated 1 ; a detailed description is provided in the " Data set notation " section. To rephrase, this data set is considered a screening space/exploration space for the exploration process; we retain all these unknown structures as distinct from the initial space. Subsequently, all structures were subjected to structural optimization through fi rst-principles calculations to obtain the optimal structures.

Assessment of formation energy of structures
The fi rst-principles calculations using density functional theory (DFT) 37 , 38 are among the most practical calculation methods used in materials science. DFT calculations precisely estimate the total energy of the materials, which can be used to determine the formation energy of the substituted structure. The formation energy of a given structure s is defi ned as follows: where E[s] , E [ s ], and E[s i ] are the formation energy, total energy of structure s per formula unit, and simple substance s i per atom, respectively. Finally, N is the total number of atoms in the formula unit of s . The simple substances were chosen as (1) Im-3m with Fe and Mo, (2) R-3m with Sm and Al, (3) Fm-3m with Cu and Co, (4) P 6/ mmm with Ti, and (5) P 63/ mmc with Zn. Details of the substances chosen are provided in the Supplementary Information. A structure whose formation energy lies below or lower than zero, that is, E ≤ 0 , is a potentially formable material in nature, whereas a structure associated with E > 0 could be considered unstable. For the competing phases, the stability of the structure should be discussed using the hull distance. In this study, we use the formation energy defi ned in Equation 1 as an index for simplicity. The relationship between the experimental material and the hull distance at T = 0 K has been summarized in References 39 and 40 . The stability of the magnets at fi nite temperature can be found in Reference 41 . We discuss in detail the reliability of this calculation in the Supplementary Information.
In this study, we follow the computational settings of OQMD 36 , 42 to estimate the total energy of all structures. The calculations were performed using the Vienna ab initio simulation package (VASP) 43 , 44 by utilizing the projector-augmented wave method potentials 45 , 46 and the Perdew-Burke-Ernzerhof 47 exchange-correlation functional. Pseudopotentials used in this work were collected from POTCAR library version 5.4 of VASP. 45 , 48 -51 With the 4f element of Sm, Sm 3+ potentials were applied where fi ve electrons in f shell were treated as core electrons. Details of potential for other elements is shown in the Supplemental Information, with notation as shown in Reference 49 . All calculations were spin-polarized with the ferromagnetic alignment of the spins. For a given structure, we performed three optimization steps following the coarse relax, fi ne relax, and standard procedures provided by OQMD. The k -points per reciprocal lattice for these calculation series were selected as 4000, 6000, and 8000 for coarse relax, fi ne relax, and standard, respectively. Optimal lattice parameters from the last step were used as the initial setting for the next step. We set 520 eV as the cutoff energy in the standard calculation step. The total energies of the fi nal converged calculations were used to estimate the formation energy, E .
In addition, the total magnetic moment of these materials μ[s] was recalculated because we used an open-core approximation to treat the 4f electrons of Sm, as follows: is the correction term with g J 4f as the Lande factor, and J 4f is the angular momentum of lanthanide s k . Index i represents all atoms, and index k represents all lanthanide atoms in the structure. The contribution of the 4f electrons of Sm to the magnetization is J g J = 0.714 . In this paper, this value is fi nally converted to magnetization per formula unit, M (T/f.u.).

Active learning design
There are three essential components in the proposed active learning approach, including (1) a pool D of not-yet-calculated structures (non-optimized) and fi rst-principles calculated (optimized) structures, (2) an estimator E to predict the target formation energy, and (3) an acquisition function α to estimate the structures that should be queried in order of priority to enhance the prediction ability of E .

Data set notation
For a given query time t , we denote D calculated  To evaluate the ability of the active learning system to search potentially stable structures, we also collect D outstanding t from D ¬calculated t as a set of structures that are expected to be stable. Within the scope of fi nding the most potentially stable substituted SmFe 12 families, if the calculated or predicted formation energy E is smaller than −0.1 (eV/atom), the structure is considered potentially stable. At the time t of querying process, a predetermined number of structures with the lowest E pred predicted by E are then added to D outstanding t for verifi cation using fi rst-principles calculations. First-principles calculations are then carried out for all the structures in D beneficial t , and the obtained optimized structures are added to D calculated . We then use D calculated [1:t] as the training data for learning the estimator E . All the optimized structures confi rmed using fi rst-principles calculation with a formation energy lower below the specifi ed limit are considered as potentially stable structures, and they are added to data set D outstanding confirmed , which comprises all the potentially stable structures that are confi rmed up to this point. The set of all the structures estimated using the estimator E as potentially stable structures is denoted by D outstanding estimated . The pseudo-code summarization of the entire query-and-learn process is shown in the Supplemental Information.
In D calculated , we represent calculated structures accumulating up to t with representation vectors as x [1:t] and formation energy as y [1:t] . The formation energy of SmFe 12−α−β X α Y β structures is described in the " First-principles calculation " section. For simplicity, we denote x as a representation vector of not-yet-calculated structures, normal subscript denotes data point index, bracket subscript [1:t] represent for collected data up to t , and superscript represents the index of feature. In this study, we applied the OFM 7 , 8 as a descriptor to represent all structures. In OFM representation, the most outer-shell electron confi guration is set as a representation of each composition site. Details of OFM atomic representation is used in Element.electronic_structure in pymatgen 52 and the summary in Table I in the Supplemental Information. All elements in the OFM appear in the form of (u i , u j ) , which counts the average coordination number of neighbors u j surrounding the center u i . By representing each atom using outer-shell electron confi guration, each individual matrix element is associated with one specifi c coordination number of a pair of elements in a given structure. Practical interpretation samples are shown in References 53 and 54 . In this work, after removing features with zero in all structures, we fi nally required an 88-dimensional orbital-fi eld vector to represent all SmFe 12−α−β X α Y β structures.

Gaussian process estimator
The Gaussian process estimator assumes that the joint distribution of the observed values y [1:t] and predicted values ŷ follow the Gaussian prior distribution, expressed as follows: With these assumptions, the predicted values for the unknown state points follow the conditional distribution calculated by updating the prior probability distribution after observing the sampled state points. Thus, ŷ ≈ N (μ(x), σ(x)) with mean μ and variance σ are estimated as The mean μ and variance σ are the main components used to construct the acquisition functions, which are introduced in the " Acquisition function " section. The most conventional kernel, known as the Gaussian kernel κ ij is defi ned as the kernel between x i and x j as follows: where is a hyperparameter that is tunable to learn the best form of the kernel and d is conventionally defi ned as the Euclidean distance.

Metric learning
Human intuition regarding the Euclidean distance among data points from three-dimensional spaces often does not apply to higher-dimensional cases. In high-dimensional spaces (e.g., the 88-dimensional orbital-fi eld vector in this work), if an enormous number of examples are distributed uniformly in a high-dimensional hypercube, most examples are closer to the face of the hypercube than to their nearest neighbor. If we approximate a hypersphere by a hypercube, in high dimensions, almost all the volume of the hypercube is outside the hypersphere. 55 Moreover, with increasing dimensionality, the distance to the nearest neighbor approaches the distance to the farthest neighbor, 56 which implies that the learned weight of the Gaussian process could be meaningless in distinguishing between neighbors and distant data points. In the following, we observe that estimators working on high-dimensional spaces show more diffi culty in converging to obtain suitable prediction accuracy; in other words, it is more diffi cult to estimate both distant and neighbor data points.
To overcome the curse of high dimensionality as well as perform tracking to see how the learned function is created, we propose the use of a metric learning algorithm for kernel regression-MLKR, 57 which optimizes the smoothness of dependence between a representation vector and a target property. First, the Mahalanobis distance d(x i , x j ) is defi ned as a linear transformation of conventional Euclidean distance as follows: where A is a linear transformation matrix. The MLKR method attempts to optimize the loss function L defi ned by the training error as With the defi ned kernel in Equation 6 , we can iteratively fi nd the optimal A by A , defi ned as EXPLAINABLE ACTIVE LEARNING IN INVESTIGATING STRUCTURE-STABILITY OF SMFE 12-α-β X α Y β STRUCTURES X, Y = {MO, ZN, CO, CU, TI, AL, GA} with x ij := x i − x j . The matrix A is gradually optimized to fi nd the best embedding space. Therefore, we obtain a new embedding representation u := Ax by linear transformation of the original vector x . From the defi nition of L , the function of the target property learned on u is optimized to smoothly traverse through data points. Moreover, u with its low dimension, 2D in our setting, is expected to be of benefi t for both prediction estimators and human intuition regarding the Euclidean distance compared with the conventional x for 88 dimensions in the OFM representation.

Embedding function interpretation
Maximizing the prediction ability of the machine learning estimator using the most limited training data is the fi rst priority of the active learning method. The process of querying new labeled data are equivalent with correcting the form of learned function with respect to target property. For example, in binary classifi cation, asserting data points with maximal variance of predicted class labels is equivalent to locating the boundary that separates two observed classes. Therefore, as an alternative advantage, following the correction process leads to better insight regarding the phenomena of interest. In this work, we introduce a method to localize information on the learned function, monitoring its change to improve the querying data process in interpreting the phenomena of interest.
With the target property as a continuous variable, we consider the learned formation energy function y = f (u) , which is called interpretable if it is possible to allocate on the representation space u , where the function meets a predefi ned condition g . In detail, given a condition g , the probability distribution spanning on the embedding space u is defi ned as follows: with p(u|g) as the probability density at u under g , u i as the location of an observed data point i (i.e., u i = Ax i ); h as a tuning kernel width. The indicator [·] returns 1 if the condition [·] is true, and 0 otherwise. In the present work, we consider two forms of relevant conditions. where g y (u i ) and g x j (u i ) intuitively represent a region of interest with potentially stable materials and regions spanned by structures incorporating the nonzero OFM element x j . Then, we measure the Bhattacharyya coeffi cient 58 between a pair of (g y , g x j ) as with the integral taken over the space spanned by u . The Bhattacharyya coeffi cient BC(g y , g x j ) measures the probability of joint occurrence between two conditions g y and g x j .
Higher BC values indicate a higher possibility to obtain correlation between conditions g y and g x j and vice versa; this makes it easier to understand the meaning of the BC coeffi cient in identifying overlapping distributions. In the discussion of the results provided in the " Results and discussion " section, we characterize any distribution p(u|g) using a single-level contour representation.

Acquisition function
The acquisition function (x) quantifi es the reward of structures in each D ¬calculated t that contributes to the prediction accuracy of the estimation models, as well as the exploration process. Structures x * are queried to D beneficial t to calculate their formation energy if their acquisition function values reach an optimal value.
The majority form of is designed to determine the optimum of a fi xed expensive-to-compute function. In this work, we examine the two most canonical functions as follows: where μ(x) and σ(x) are the mean and variance of estimated values of not-yet-calculated structure x , respectively. In representation space upon which the estimator is located, x is either an OFM vector or embedding vector u = Ax learned by the metric learning method. The fi rst acquisition function, exr , based on the exploration strategy, assumes notyet-calculated structures with higher variance to enhance the prediction ability of the estimator (i.e., are benefi cial to the machine learning model). This acquisition function does not support directly fi nding superior structures because the information of the absolute value of the target property has not been included. The second acquisition function, exp , based on the exploitation strategy, selects not-yet-calculated structures with the lowest predicted target values as potential candidates to enhance the prediction ability of the estimator. Numerous acquisition functions 31 , 59 -61 have been introduced to balance the exploration and exploitation assumptions. Finally, we also examine an acquisition strategy uni that randomly selects from the pool of not-yet-calculated structures.

Experimental setup
We designed an experiment to simulate the process of exploring SmFe 12−α−β X α Y β structures with X, Y as Mo, Zn, Co, Cu, Ti, Al, and Ga using the proposed query-and-learn method. We collected ternary compounds-SmFe 12−α X α structures ( α < 4 ) to use as the initial training data and quaternary compounds SmFe 12−α−β X α Y β and α + β < 4 as the initial pool of not-yet-calculated data. Consequently, at the initial time of the exploration process, all not-yet-calculated structures were created using the bi-element substitution method rather than the single element substitution method as training structures. We summarize the initial training structures in Figure 2 , which shows the primary state of the training data D calculated with SmFe 12−α X α structures ( α < 4 ). In this fi gure, the structures are all referenced to SmFe 12 values of formation energy (0.07 eV/atom) and magnetization (2.011 T/f.u.). Substituting Ti, Al, Co, and Ga regularly creates substituted structures with formation energies lower than the reference value of SmFe 12 . Among them, Ti and Al show a higher rate in creating negative formation energy structures than others. With Mo, Zn, and Cu, several substituted structures are more stable than the host SmFe 12 , whereas the others are not. A part of our calculations were found to be consistent with other fi rst-principles calculation methods such as the Quantum MAterials Simulator (QMAS), 62 -64 OpenMX, 20 or experimental results. 13 , 65 , 66 Details of comparisons are shown in the Supplementary Information section. Figure 2 in the Supplemental Information shows summarization of all SmFe 12−α−β X α Y β structures in the region of α + β < 4 . All structures were described using 88-dimensional OFM vectors after eliminating duplicated columns.
For a time query t , two batches of structures were selected, denoted by D beneficial t and D outstanding t . A detailed description of all batches is provided in the " Data set notation " section. We set 40 as the number of selected structures for each

Query-and-learn in monitoring the SmFe 12-α-β X α Y β structures discovery process
We now present the proposed query-and-learn method designed to monitor the materials discovery process. The relative positions of not-yet-calculated, calculated and queried structures, the form of the formation energy function, and generalizing knowledge of the structure-stability mechanism of SmFe 12 family are discussed. Figure 3 shows the learned embedding function regarding the formation energy of SmFe 12 structures. In this fi gure, we show the results of a random querying strategy with the initial query t = 1 on the upper panel and the last query t = 30 on the lower panel. We demonstrate the results of diff erent strategies in querying structures in the Supplemental Information. The calculated structures are denoted using face and edge color, which indicate the portion of each substituted element. For each query time t , non-calculated structures are shown as gray dots. White rhombus markers indicate structures that were queried at t in D beneficial t and white triangle markers indicate estimation regarding the most potentially stable structures in D outstanding t . For each query time, we show in the left and middle column of Figure 3 the predicted formation energy ŷ and the estimated variance σ(ŷ) deriving from f , respectively. Moreover, we show in the right of Figure 3 the absolute error |y −ŷ| in prediction between the ground truth fi rst-principles method y and the calculated formation energy Gaussian process regression ŷ . In each t , we evaluated the error in predicting formation energy for all not-yet-calculated structures in D ¬calculated Values of all these attributes ŷ, σ(ŷ) and |y −ŷ| shown in background color with nearest-neighbor interpolation in the embedding space. From this fi gure, the learned function of ŷ appears as a smooth function traversing throughout all structures between negative to positive formation energy regions. Although queried structures were randomized well and distributed throughout the entire structure space using uni , our predicted potentially stable structures (white triangles) were also accurately allocated in the most negative formation energy region. Moreover, in t = 1 , not-yet-calculated structures using the bi-element substituted method are uniformly dispersed throughout calculated structures with the single substituted element method.
Next, we investigated the learned formation energy function on embedding space via extremum interpretation. Figure  4 shows the formation energy landscape generated by embedding representation in the fi rst and the last query time. Aiming to stabilize the SmFe 12 structure, the local minima of the formation energy function is defi ned as our region of interest, which contains the most negative formation energy structures in D outstanding estimated . This region is defi ned as the distribution spanned by p(u|g y ) in the " Embedding function interpretation " section. In Figure 4 , p(u|g y ) distributions are shown in red contours. In the following discussion, we refer to these distributions as the target contours for simplicity. By contrast, distributions of structures with nonzero OFM features defi ned as p(u|g x j ) are shown in the embedding space via other contour lines. Intuitively, higher overlapping contours show a higher correlation between these properties. In the middle and the right of Figure 4 Figure 2 in the Supplemental Information shows SmFe 9 [Al/ Ga] 2 Ti structures as the most negative formation energy. By contrast, structures with Mo-substituted elements show distancing from the potentially stable regions. Notably, these correlations between the substituted element and corresponding stability could be found at the beginning of the querying process.   Figure 3 . Distribution of SmFe 12−α−β X α Y β structures on embedding spaces at initial time t = 1 (upper panel) and the last query t = 30 (lower panel). Predicted formation energy E pred and its variance σ( E pred ) of structures learned from the Gaussian process are shown in background colors in the fi rst and the second column, respectively. Absolute error in predicting the formation energies | E pred − E DFT | are interpolated in the background of the third column. Not-yet-calculated structures are shown as gray dots. Figure 5 shows the dependence of normalized BC(g y , g x j ) on query time t in the active learning process for all OFM features. OFM features show a matrix with blocks of similar center atom representation; each block is presented keeping a similar order of neighbor representation. From Figure 5 , structures with (s 1 , M) and (d 5 , M) features (i.e., Cu-and Mo-substituted structures) showed the lowest BC scores for all t . In other words, these structures were not located within the region of negative formation energy. By contrast, BC(g y , g (p 1 ,M) ) always remained at the highest score, or as we showed previously in the learned embedding space, these SmFe 12−α−β [Al/Ga] α B β structures were mostly associated with negative formation energy. We show another example in interpreting the substituted eff ect using BC(g y , g (d 2 ,M) ) or Ti-substituted structures. Structures excluding (d 2 , s 1 ) and (d 2 , d 5 ) , that is, except SmFe 12−α−β [Mo/Cu] α Ti β , showed high possibility of negative formation energy. All these correlations were established by analyzing all queried data shown in the Supplementary information. Interestingly, these correlations could be performed very early, even at the beginning of the exploration process. In summary, the BC score on a learned embedding space is potentially useful in understanding the form of the formation energy function and determining where interesting information is located without labeling all data.

Prediction ability of active learning designs
We examine the prediction accuracies of different active learning designs. For any query time t , we measured the mean absolute error (MAE) between the predicted and observed formation energies of structures in D ¬calculated t . Because different structure querying strategies update their training data diff erently, not-yet-calculated structures in D ¬calculated t also diff ered among experiments. Therefore, MAE measured on D ¬calculated t can be approximated as the natural prediction loss of our designed system. Figure 6 a shows the MAE results of active learning designs drawn from possible combinations of representation methods, estimators, and querying strategies. In this fi gure, with three acquisition functions, including uniform, exploration, and exploitation functions, experiments using the OFM representation are denoted in cyan, green, and blue, respectively. By contrast, active learning designs based on embedding representations are shown in yellow, orange, and red, respectively, with these three acquisition functions. Finally, we independently evaluate each of the six active   learning designs ten times with diff erent initial random structures in order to evaluate the prediction accuracies. The diff erence between active learning designs primarily depended on the nature of the representation method. At t = 1 , all active learning systems obtained MAE at 2.5 × 10 −2 (eV/ atom). Overall, MAEs gradually decreased with increasing t for all the active learning systems. However, the performance of designs with high-dimensional OFM representation showed gradual linear improvement by adding new queried structures. This could be explained as new queried data points that are added using this strategy help the estimator forecast their neighbor only, rather than correcting the estimator learning on the entire dataspace. The MAE curve with the highest fl uctuation belonged to a system using exploitation querying strategies. In other words, adding excessively biased data (e.g., low energy structures), as in the exploitation strategy, into the prediction model misguided the model to estimate other structures and directly reduced its prediction ability. By contrast, the lowest-bounded MAE curve always belonged to a design that utilized a uniform sampling strategy operating on the embedding representation. By querying up to t = 5 , one-sixth of all not-yet-calculated structures, the design using the uniform querying strategy on embedding space quickly reached the optimal MAE at 1.25 × 10 −2 (eV/atom) and then remained at this performance level for the remainder of the experiment. The model outperforms others because the Mahalanobis metric learned using MLKR preserving both Euclidean distance and following the direction of the target function 57 helps to correct the form of the estimator locally and globally. Thus, given several queried data points uniformly sampling on the embedding space, we could improve these two aspects simultaneously.
Next, we evaluated active learning designs in recalling the most potentially stable structures. We heuristically defi ned −0.1 (eV/atom) as the upper-limit formation energy for the set of most potentially stable structures. Consequently, the ground truth of the D outstanding confirmed set contained 74 structures incorporated with formation energy lower than −0.1 (eV/atom) or equivalent with 2.2% total not-yet-calculated candidates. Figure 6 b shows the recall rate results for all active learning designs. The colors and patterns denoted for diff erent active learning designs are synchronized with the MAE results, as shown in Figure 6 a. This fi gure shows that all active learning designs recalled all D outstanding confirmed structures without querying all unlabeled structures. The worst recall performance of the active learning design by an exploration querying strategy and OFM representation required 14/30 query steps to recall all these potentially stable structures. By contrast, methods with the best recall performance required 8/30 query steps. In the naivest case, when we randomly selected a structure from an unlabeled structure data set and avoided using any structures to update all active learning components, we needed to query all not-yet-calculated structures to recall all D outstanding confirmed structures. Equivalently, the rate of recall of the top 2.2% of structures with the lowest formation energy was enhanced between 2.1 and 3.7 times compared with the basic random selection method. We also report the results of using active learning with diff erent initialization training data in Supplemental Information Materials.

Structure-stability relationship
In this section, we discuss the structure-stability relationship of this SmFe 12 family in detail. We investigate how diff erent substituted elements distorted the host structure by measuring displacement of the OFM elements before and after performing a structure optimization step based on calculation from fi rst-principles. The displacement (·) was measured as x = x opt − x org with x opt ; x org shows the value of an OFM element of calculated and initial structure, respectively. In In the upper panel with (d 6 , M ) , structures owning (d 6 , p 1 ) and (d 6 , d 2 ) , that is, Al/Ga and Ti-substituted structures, respectively, show on average negative formation energies, indicating a trend of potentially stable structures. Further, the distribution of structures owning (d 6 , d 2 ) show on average a reduction in coordination number, (d 6 , p 1 ) structures appear with a distribution of a positive mean value. As an interpretation, in SmFe 12−α−β X α Y β -substituted structures, only Al/Ga-substituted sites come close to Fe sites on average (i.e., increasing coordination number). In the lower panel with (p 1 , M) , we confi rmed again that in all Al/Ga-substituted families, there is a tendency of increasing coordination number of neighbors surrounding all p 1 -like OFM element (yellow violin distribution). Moreover, almost all structures with (p 1 , M ) exhibited a mean negative formation energy. By contrast, as shown in the Supplementary information section, structures with other OFM elements all showed decreasing trends of the average coordination number and mean positive formation energy except (d 2 , M ) -Ti element. The lowest mean value of formation energy belonged to (p 1 , d 2 ) structures (i.e., the SmFe 12−α−β [Al/Ga] α Ti β family group).
Ideal structures in the SmFe 12 family should meet one more qualifi cation about maximizing the magnetization of the substituted one. In the Supplemental Information, the most potential structures are mixed between Al, Co, and Cu-substituted structures that show optimal stability and magnetization. In Figure 8 , we show the non-optimized original structure SmFe 12 compared to other Al, Co, and Cu-substituted structures after the optimization process. Three structures, SmFe 10 Al 2 , SmFe 10 CoAl, and SmFe 10 CuCo are shown with formation energy lower than SmFe 12 and sorted in increasing value of formation energy, respectively. Overall, these structures are shown with smaller sizes than the original structure SmFe 12 and the decreasing distance at the Fe-8f site to neighbors refl ects an increasing coordination number at this Fe site. In detail, structures with two Al-substituted elements, SmFe 10 Al 2 structure show the highest shrinkage level to the lattice parameter on the xand y -axis while slightly expanding the lattice parameter on the z -axis. Substituting one Al and one Co site, SmFe 10 CoAl structure obtains a smaller volume compared to the original but slightly larger than SmFe 10 Al 2 . The largest volume among these three substituted structures belongs to SmFe 10 CuCo. In other words, Cu-and Co-substituted sites cannot distort other Fe and Sm sites. This evidence highlights the diff erence between the increased coordination number of Al-substituted structures and others.

Conclusion
In this study, we have introduced a query-and-learn active learning approach in exploring SmFe 12−α−β X α Y β structures with X, Y as Mo, Zn, Co, Cu, Ti, Al, Ga, and α + β < 4 . Our proposed method was developed to accelerate the rate of discovery of potentially stable structures and generalize our understanding of the stability mechanism of this family. 3307 SmFe 12−α−β X α Y β structures with formation energy and magnetism calculated using fi rst-principles calculations were used to form the exploration space. MAE of active learning designs showed the lowest values at 1.25 × 10 −2 (eV/atom)-3.7 % of the range calculated from fi rst-principles by utilizing the embedded descriptor originating from the OFM. Moreover, the design reached this irreducible error approximately six times faster than the alternatives compared. In the experiment aiming to fi nd the most potentially stable structures, all active learning designs presented a successful recall rate 2.1-3.7 times faster than the random search strategy. Finally, we interpreted the formation energy landscape learned by embedding representation via smooth correlations between distributions of the local extreme and diff erent coordination number information. We discovered that structures with substitution of non-transition-metal elements of like Al and Ga, associated with Ti, in particular SmFe 9 [Al/Ga] 2 Ti, had the highest possibility of stabilizing the SmFe 12 structure. Moreover, the mean negative formation energy SmFe 12−α−β [Al/Ga] α Y β structures exhibited an increasing trend of neighbor atoms surrounding Al/Gasubstituted sites on average, whereas other families showed opposite trends.