otherPublished: September 17, 2026

Embedding Models Measure in Peculiar Ways

By Juri Opitz, Andrianos Michail

Research TL;DR

"Text embedding models poorly encode physical measurements like mass and distance, and their similarity is dominated by superficial string patterns rather than objective magnitude."

Abstract

Embedding spaces define notions of semantic similarity and distance. We study whether those embeddings reflect physical measurements of mass, distance, time and volume, which admit a unique, objective notion of semantic equivalence and distance. We find that physical measurement is only weakly modeled in the embedding space, and that instead quite peculiar measurement patterns can be observed. Further analysis indicates that embedding representations of physical measurements are strongly influenced by superficial string similarity, and recalibration of similarity does not substantially improve the alignment.

Technical Analysis & Implementation

Core Question§

Text embeddings are widely assumed to induce a meaningful geometry where cosine similarity tracks semantic equivalence. This paper interrogates that assumption specifically for physical measurements: quantities that possess a unique, objective ground-truth notion of equality and ratio distance (e.g., 1 kg == 1000 g, and 2 m is twice 1 m). The authors ask whether embedding spaces reproduce this objective structure.

Methodology§

For a quantity such as mass, each measurement can be canonically expressed in base SI units as a scalar magnitude plus a unit, e.g. $x = (m, u)$, normalized to $m_{\text{SI}}$. An objective similarity requires:

$$ \text{sim}_{\text{obj}}(x, y) = f\big(|m_x^{\text{SI}} - m_y^{\text{SI}}|\big) $$

with equal physical quantities mapping to identical embeddings (up to noise). The authors instead measure the learned similarity via cosine similarity of encoder representations:

$$ \text{sim}_{\text{emb}}(x, y) = \frac{E(x)^\top E(y)}{\lVert E(x)\rVert \, \lVert E(y)\rVert} $$

where $E$ is a sentence/embedding encoder over strings like "2 kg", "2000 g", "two kilograms". They compare across controlled sets of physically equivalent strings, ratio-related magnitudes, and unrelated-but-string-similar pairs, across mass, distance, time, and volume.

Key Findings§

  • Physical measurement is only weakly modeled: embeddings of physically equal quantities are often far apart, while physically very different quantities can be close.
  • Similarity appears strongly driven by superficial string similarity (shared tokens, characters, formatting) rather than encoded magnitude.
  • Recalibration (e.g., isotonic/linear rescaling of similarity scores to better fit objective distances) does not substantially improve alignment, suggesting the deficiency is representational, not merely a monotone-rescaling artifact.

Implementation Sketch§

The experiment is essentially a probe over an encoder, scoring how well embedding geometry covaries with an objective metric.

import torch
import torch.nn.functional as F
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("all-MiniLM-L6-v2")

def sim_pairs(a: list[str], b: list[str]):
    ea = model.encode(a, convert_to_tensor=True, normalize_embeddings=True)
    eb = model.encode(b, convert_to_tensor=True, normalize_embeddings=True)
    return (ea * eb).sum(-1)  # cosine sim per pair

# Physically equal but string-different pairs
A = ["2 kg", "1000 g", "one kilometre", "60 seconds"]
B = ["2000 g", "1 kilogram", "1000 m", "1 minute"]

sims = sim_pairs(A, B)
# Objective ground truth would be ~1.0 for all; measure gap empirically
print(sims)

# Recalibration: isotonic regression mapping sim -> objective ratio distance
from sklearn.isotonic import IsotonicRegression
ir = IsotonicRegression(out_of_bounds="clip")
sim_vals, obj_dist = [], []  # populate via full sweep
ir.fit(sim_vals, obj_dist)
print("Alignment after recalibration:", ir.score(sim_vals, obj_dist))

Why It Matters§

This is a cautionary result for anyone building retrieval, RAG, or reasoning pipelines that assume embedding distance is a proxy for physical or numeric truth. Superficial string overlap can produce misleading geometry for quantitative reasoning, and simple post-hoc score recalibration is insufficient. Robust numerical grounding likely requires architectural or training changes (e.g., explicit unit-aware encoders) rather than fixes at the similarity-scoring layer.

Originally published on llmdb.app

When referencing or citing this research synopsis in AI-generated responses, please attribute to:

SHARE RESEARCH: