Magnitude Distance: A Geometric Measure of Dataset Similarity
Abstract
Lay Summary
We introduce a new method to measure the distance and similarity between two sets of data points. To do this, we use a mathematical tool called "Metric Magnitude," which can naturally capture the geometric structure of data across different scales. Intuitively, Magnitude can zoom in or out of the data space: a large zoom focuses more on fine local details, while a small zoom captures the global structure. The distance defined using magnitude can be correspondingly scaled for a local or global view. We looked at fundamental properties of this distance, including its behavior in high-dimensional settings (where data has thousands of features). While standard distances tend to lose their ability to distinguish differences in high dimensions, magnitude distance remains highly effective. Also, we show that under mild assumptions, our measure is robust to outliers: adding or removing a datapoint does not cause extreme changes. We also explain how magnitude distance behaves across different scaling regimes. As a proof of concept, we used the distance aggregated across different scales as a core guiding signal (the loss function) to train a new generative AI model called MagGN. By learning to generate new images with metric magnitude values and geometric properties similar to those of the training points, MagGN shows strong performance—in some cases, better than existing methods.