Everything Is A Math Wrapper, Part II: Metric Spaces And AI/LLM Search

Metric.
If you’ve worked in search/marketing this is a term that you should be familiar with and likely use everyday (and, perhaps, are exhausted by it).
Metrics are literally everywhere in our world – traffic, positioning, clicks, views, bookings, sales, et. al. Used in those contexts, they’re a relative measure or indicator of something, often used to track progress or some quantitative performance.
For years I’ve seen folks use this term and often wondered if they really understood the deeper meaning (and, perhaps, origin) of this word from the Mathematics world.
In last week’s post on topology and topological spaces, I briefly touched on metric spaces and in this post I’d like to dig a little deeper to give a brief introduction to this structure within those topological spaces.
Then I’ll try to connect some dots for you between metric spaces in AI/LLM search spaces and SEO.
An Informal View Of Metric Spaces
As mentioned above, you likely already have some intuition into metrics and metric spaces.
Informally a metric is used as a measure of a distance between things – that’s it really.
Those “things” can be anything — collectively they form a space. A metric on that space are the rules that define the distance between things in that space. A space that has a well defined metric (or metrics), then, is a metric space.
With metrics we can discuss how “close” or “far” apart things are in that space (or even angles between them).
If you know you had 20 clicks on a site one day and the next you had 22 clicks, that metric tells you that those two days are “close” to each other in the click metric space (more or less – this is the informal section, remember).
If you know that two people share an interest in cheetahs, then those two users may be close together in an “interest” metric space – and so on.
Metrics, as you can see, aren’t just “numbers” or points on a graph — they’re actually a much more general concept that can be customized and used to measure just about anything between elements of different spaces.
A (Semi) Formal View Of Metric Spaces
Going into a more formal view of metric spaces – like topological spaces (more on the connection between these below), have a basis in Set Theory (collections of objects).
Take some set, let’s call it “S”. Let “d” be some function that takes two inputs (elements of set “S”) and produces a single output – a number (a Real number, to be exact).
If that function “d” has the following properties, then it is said to be a metric or distance function:
d from a point to itself is always zero: d(x,x) = 0
d is always positive: if x ≠ y, then d(x,y) > 0
d is symmetric: d(x,y) = d(y,x)
d satisfies the triangle inequality: d(x,z) ≤ d(x,y) + d(y,z)
These must hold for all x, y, z ∈ S – if so, then the pair (S, d) form a metric space and d(x,y) is the distance between x and y.
While these properties may seem trivial to some, there are some spaces that don’t adhere to all of them ( see semimetric spaces and quasimetric spaces for more ), but for purposes of this post, we’ll be strictly reviewing proper metric spaces as defined above.
Even with the strict definition above, the versatility of metrics on a space is virtually endless – that’s why we can define so many across so many applications.
The real fun begins in the creation of the set (and associated elements) that the metric is defined across – be that clicks, traffic, views… even words and vectors.
Metric Spaces, Manifolds And Topology
In last week’s brief intro to topology (you may want to review that quick here before proceeding), I mentioned how a topology on a set describes how elements of that set relate to each other and are organized based on closeness or proximity – and how that relationship is preserved during twisting, stretching and other deformation of the larger topological space.
If a metric is properly defined on that space, we can have a measure of that closeness or proximity.
This also gives us a nice, intuitive result – any metric space is also a topological space and has a topology determined by the distance function. (The inverse of this doesn’t hold – not all topological spaces are metric spaces.)
Manifolds are also topological spaces (as mentioned, again, in last week’s post) – they are complex, multi-dimensional spaces, but locally look Euclidean (like our 3 dimensional world like we live, but can be extended to much higher dimensions).
As manifolds look like familiar Euclidean spaces when looking locally, they naturally hold a sense of measurement or distance – a metric – we’re familiar with (like taking two points on a map or globe and measuring the distance between them).
When viewed like this (somewhat loosely – there are some exceptions here that go beyond this post’s purpose), you can say that manifolds, then, are metrizable, that is, a metric can be equipped for them to become metric spaces.
This means we can have a sense of distance and proximity on manifolds, even when the dimension of the manifold is arbitrarily large and its structure and shape complex.
This is important.
Connection To AI/LLM Search Spaces
The mental model of your words, passages, content and other entities online existing on a surface that is manifold-like within AI/LLM search spaces, together with fact that all manifolds are metric spaces means we can begin to get a feel for distances and proximity within those spaces.
When elements of those spaces are vectors, matrices and tensors – how these AI/LLMs largely ingest content – we have other fun ways to measure things using angles and other metrics.
Final Takeaway For SEOs And Marketers
Your content, website and other online entities don’t exist in isolation – and neither does anyone else’s content where you might be mentioned.
As they ultimately land on surfaces that exhibit manifold-like properties – that then, can have a metric associated with them – they will always have a sense of proximity to other items on those surfaces, depending on context, of course.
Every choice of words, every passage crafted, almost everything you add to the space (and those items added by others) that is related to you, your business, your clients’ business and other entities could change your position within those spaces and over time – moving you closer (or further away) from an intended position. Knowing this, it’s important that you’re careful with context maintenance and managing a high fidelity representation of those items.
And as those words, passages and content carry an intended meaning associated to an entity, website, etc – proximity and closeness of those items in these spaces can describe how similar they are in meaning.
More on similarity metrics and other important topics in the coming weeks.



