Few-Shot Defect Prototypes for Transferring Soft-Spot Prediction Across Glasses

Amorphous solids such as metallic glasses have no crystal lattice, so there is no simple map showing where they will give way. Machine learning can learn to spot the "soft" atoms, meaning the atoms most likely to rearrange. The catch is the training labels. Each label comes from an expensive simulation: computing activation energy barriers for one Cu-Zr dataset with the Activation-Relaxation Technique nouveau (ARTn, a saddle-point search on the atomic energy landscape) takes roughly 41 days (Predicting and Interpreting Energy Barriers of Metallic Glasses with Graph Neural Networks). Worse, models trained on one composition or cooling history transfer poorly to another. In practice, every new alloy or preparation protocol means paying the labeling bill again.

We propose to treat each new glass as a few-shot problem. We train a symmetry-respecting graph network on atomic neighborhoods using the episodic recipe of prototypical networks. The network is a graph neural network that reads each atom's local neighborhood as a graph and gives the same answer however the sample is rotated. A prototypical network classifies an input by its distance to per-class average embeddings, called prototypes (Prototypical Networks for Few-shot Learning). At deployment on an unseen composition or thermal history, the encoder stays frozen. The only thing re-estimated is a small set of defect prototypes, built from a few dozen to a few hundred ARTn-labeled atoms of the new glass. The claim is that this recovers most of the accuracy of a fully retrained model at a small fraction of the labeling cost. Because each prototype can be replaced by a real atom, the result is also a per-glass catalogue of defect motifs that physicists can check with cluster analysis.

Core Claim and What Is New

The closest existing work is the Structural Constraint Neural Network (SCNN) (Towards interpreting the thermally activated β dynamics in metallic glass with the structural constraint neural network). SCNN applies a prototype layer to Cu-Zr glasses. It uses hand-crafted descriptors (Bessel radial functions, spherical harmonics, shell averages), four fixed prototypes matched by cosine similarity, and a binary low- versus high-barrier label. It reports an area under the ROC curve (AUC) of 0.869, against 0.882 for an unconstrained multilayer perceptron. SCNN uses prototypes purely as an interpretability device, learned once on a pooled training set.

Our contribution differs in function, not only in architecture. Here the prototypes are the mechanism of transfer. They are recomputed per target glass from few labels, which answers the transferability limitation flagged for both SCNN and SymGNN. The encoder learns geometry end to end instead of reading engineered features. Classes are allowed several prototypes each, because barrier distributions in glasses are broad and structurally heterogeneous. Distances are squared Euclidean, which Snell et al. argue makes the class mean the right representative. SymGNN motivates the encoder choice: it showed an E(3)-invariant edge-attention graph network reaches a Pearson correlation of 0.7859 on Cu64Zr36 with sub-second inference. But SymGNN is a regressor explained after the fact with GNNExplainer, and it has no mechanism for cheap adaptation.

Model

The encoder $f_\phi$ maps atom $i$'s neighborhood graph, out to roughly 10 Å so that SymGNN's medium-range-order finding is covered, to an embedding $z_i = f_\phi(x_i)$. We bin the barrier axis into $B$ ordered bins by quantile. Each bin $b$ gets $m$ prototypes $c_{b,j}$. At adaptation time these are obtained by running k-means with $m$ clusters on the embeddings of the labeled support atoms in bin $b$. We choose $m$ per bin by held-out likelihood on the source glasses, which addresses the manual-$m$ problem raised in Deep Learning for Case-Based Reasoning Through Prototypes. A query atom's bin probabilities are

$$p(b \mid x) \propto \sum_{j=1}^{m} \exp\left(-\lVert z - c_{b,j} \rVert^2\right),$$

and its predicted barrier is $\hat E = \sum_b p(b \mid x)\,\bar E_b$, where $\bar E_b$ is the mean barrier of support atoms in bin $b$. This gives both a classification (as in SCNN) and a continuous estimate (as in SymGNN) from the same distances.

Training is episodic across source glasses. Each episode samples one source glass, a small labeled support set, and a query set, so that the model is trained to generalize from few labels within a glass. This follows the episodic protocol of Matching Networks for One Shot Learning and prototypical networks.

For interpretability, we snap each prototype to its nearest real support atom, following SCNN's replacement idea. We then run cluster analysis on the snapped atoms (for example, Z12 icosahedral fraction and S444/S666 defect clusters as in SCNN). The regularizers of Deep Learning for Case-Based Reasoning Through Prototypes keep prototypes near data.

Research Program

The primary regime is thermally activated barriers in Cu-Zr. We use the Cu64Zr36, Cu80Zr20 and Cu50Zr50 configurations with ARTn barriers from the SymGNN work, and the six-model multi-cooling-rate set of 24,000 atoms from SCNN. If these configurations are not released, we regenerate matched ones with the same potentials and ARTn protocol and report results on both.

Evaluation is leave-one-glass-out. We train on all but one composition or cooling rate. On the held-out glass we reveal $k \in \{10, 30, 100, 300, 1000\}$ labeled atoms and test on the rest. The ARTn cost is proportional to $k$, so the curve of accuracy against $k$ is a curve of accuracy against compute spent.

The secondary regime tests whether the idea survives a change of physics: plastic rearrangement under athermal quasistatic (AQS) shear, meaning strain applied in tiny steps with energy minimization after each step. We use 2D binary Lennard-Jones glasses under three quench protocols and 2D polydisperse swap-Monte-Carlo glasses, both from Predicting plasticity in disordered solids from structural indicators. We also use the 3D Wahnström cyclic-shear system from Correlation between plastic rearrangements and local structure in a cyclically driven glass. Labels are rearranging versus immobile atoms by non-affine displacement ($D^2_{\min}$), and held-out units are preparation protocols.

The ultra-stable polydisperse glasses are the case where Patinet et al. found nearly all as-cast indicators collapse. There we additionally record each atom's distance to its nearest prototype, to test whether environments with no nearby prototype concentrate where failure starts.

Baselines

The do-nothing reference is zero-shot transfer: the source-trained model is applied to the held-out glass with prototypes from source data only. The gap between this and full retraining defines the room for improvement.

The strongest existing method is SymGNN (Predicting and Interpreting Energy Barriers of Metallic Glasses with Graph Neural Networks). It reports a Pearson correlation of 0.7859 on Cu64Zr36 when trained in-distribution with full labels, and that number serves as the practical ceiling. For cross-composition transfer, no reported result was found on Lacuna. We will run SymGNN ourselves in two ways: trained on all labels of the target glass (the ceiling), and pretrained on source glasses then fine-tuned on the same $k$ target labels, with the same tuning budget in epochs and hyperparameter trials as our method. Beating it means matching the fine-tuned SymGNN's correlation with at most one third of the labels, or exceeding it at equal $k \le 300$.

For the binary task we also run SCNN and its MLP comparator under our split. Their reported in-distribution AUCs are 0.869 and 0.882 (Towards interpreting the thermally activated β dynamics in metallic glass with the structural constraint neural network). The raw-prototype-descriptor classifier from the same paper, at 0.767 AUC, is the physics-feature floor.

For AQS tasks, the reference indicators are the softness field and the low-frequency vibrational modes. Patinet et al. report their correlation as close to unity in ductile glasses, but give no numbers for the ultra-stable case. We recompute them on identical configurations.

Ablations isolate the key ingredients. The first swaps Euclidean for cosine distance. The second sets $m=1$ versus adaptive $m$. The third keeps the same encoder but trains it with ordinary cross-entropy rather than episodes, applying prototypes only at test time. That last ablation tells us whether episodic training or the prototype head does the work.

Why not just…?

Why not just fine-tune SymGNN on the few target labels? This is the real threat. With a good pretrained encoder, fine-tuning a small head may match prototype re-estimation. The fine-tuned SymGNN baseline above settles it directly. If it matches our curve at every $k$, we will report that the transfer advantage is absent. The remaining contribution would then be the prototype catalogue, and we would recast the work as an interpretability study rather than claim label efficiency. Our expectation that prototypes win at small $k$ rests on Snell et al.'s finding that linear heads overfit in low-data regimes, but that finding comes from images and has not been shown for atoms.

Why not just use hand-crafted indicators, which need no labels at all? In ductile 2D glasses they already correlate near unity with first plastic events, so on those systems we do not expect to beat them. They fail in two places. First, on ultra-stable glasses, per Patinet et al. Second, the best of them require diagonalizing the full dynamical matrix, which is impractical at scale. Our comparison reports both regimes separately, rather than averaging over them.

Why not just cluster a black-box model's embeddings after training, or run nearest-neighbour lookup on descriptors? Post-hoc clustering of an unconstrained encoder is exactly the "cross-entropy encoder plus test-time prototypes" ablation, so the experiment answers this question. Plain nearest-neighbour lookup on SCNN-style descriptors is included at the same $k$. The only prior evidence for learned prototypes over nearest-neighbour lookup is ProtoTEx's text result of 0.75 versus 0.67 F1 (ProtoTEx), which may not carry over to atomistic data.

Decisive Checks

The central test is the label-efficiency curve on held-out Cu-Zr compositions and cooling rates. The method succeeds if, at 100 to 300 ARTn-labeled atoms, it closes most of the gap between zero-shot transfer and SymGNN retrained on the full target data, and does so clearly better than fine-tuning.

The second test is physical. On the held-out glass, low-barrier prototypes, once snapped to real atoms, should be depleted in icosahedral order relative to high-barrier ones, consistent with SCNN and with the Wahnström shear-band observation of about 30% icosahedral participation outside bands versus under 5% inside. If they are not, the prototypes are not the interpretable objects we claim.

The third test is the AQS protocol transfer. In ultra-stable glasses, we expect as-cast prototype assignment to degrade like the other indicators. The informative outcome is whether distance to the nearest prototype, tracked along the strain path, flags failure sites before yield. A negative result there would be worth reporting, because it would show that the brittle-glass breakdown is not a problem of missing labels.