Similarity Search
Similarity search retrieves the entries of a database that most resemble a query structure, for example to find molecules or materials likely to share a desired property. A search method has three parts: a representation that turns each structure into a numerical fingerprint, a metric that scores the similarity of two fingerprints, and an algorithm that finds the best-scoring entries. For molecules, common fingerprints include SMILES-derived count vectors, substructure keys (MACCS, BCI) and Morgan circular fingerprints compared with the Tanimoto coefficient. These depend on well-defined bonds and do not apply to periodic systems such as bulk crystals and adsorbates on surfaces. Descriptors built for periodic systems, such as atom-centered symmetry functions and SOAP, grow rapidly in size with the number of elements. As databases reach hundreds of thousands to millions of entries, exhaustive comparison becomes too slow, and approximate nearest neighbor (ANN) methods (hashing, quantization, tree or graph based, implemented in libraries such as FAISS) trade a little accuracy for large savings in time and memory. Related learned representations are discussed in Graph neural networks and Neural network potentials.
Neural network embeddings with ANN indexing (2022)
Yang, Liu and Kitchin proposed using per-atom embeddings from a GemNet model trained on energies as a fingerprint that works for molecules and periodic systems alike, indexed with the FAISS IndexIVFPQ method under L2 distance. Whole structures are ranked by the number of query atoms matched among each atom’s k nearest embeddings. Searches in QM9, the Materials Project and OC20 returned structures similar in composition, geometry and projected density of states, and the retrieved QM9 neighbors of benzene trained a Gaussian process to predict its energy within 0.04 eV, against 3.64 eV for Morgan fingerprint neighbors. The authors note that the notion of similarity follows the property the network was trained on, so the approach is property-oriented, and that any model or vector search engine could be substituted (Yang et al. 2022). Summary: yang2022a.
Nearest-neighbor distance as an uncertainty signal (2024)
Musielewicz and coworkers indexed latent vectors of about 460,000 relaxed OC20 training systems with FAISS and used the L2 distance from a new structure to its nearest training neighbor as an uncertainty estimate, which at inference was the cheapest of all methods they tested (Musielewicz et al. 2024). After linear recalibration, the sum of per-atom nearest-neighbor distances in GemNet-OC’s invariant latent space gave the best calibrated uncertainties for EquiformerV2 relaxed energies. Summary: musielewicz2024.