Map identifiers to coordinates
An embedding maps an object such as a token or document into a numeric vector. It may be implemented as a table lookup for token IDs or as a model that converts an entire text into one vector. Equal dimension does not imply a shared coordinate system. Mixing vectors from different models can make distances meaningless for the intended relationship. Record model version, input normalization, and pooling method, and identify which objects are being compared. The representation is useful only relative to the process and task that gave its coordinates their interpretation.
Compare dot product and cosine
Take q=(1,0), a=(2,0), and b=(1,1). Dot products are two and one, while cosine similarities are one and one over square root two. Multiplying a by ten preserves its direction and cosine but multiplies its dot product by ten. Dot-product ranking and cosine ranking are therefore not universally interchangeable. Use the metric intended for the embedding model and make query processing consistent with the index. A metric name alone does not explain what the model learned or guarantee that a numerically larger score corresponds to more useful evidence.
Understand unit normalization
If every nonzero vector is normalized to unit length, dot product equals cosine similarity. For two unit vectors, squared Euclidean distance equals two minus twice their dot product, so ascending distance and descending dot-product rankings correspond. These relationships depend on normalization. Zero vectors cannot be divided by their norm and require an explicit policy, particularly for empty or failed inputs. Check asymmetric processing too, such as normalizing only documents. Even when rankings coincide, score scales can differ, so a threshold from one metric should not be copied to another without transformation or fresh evaluation.
Treat similarity as a hypothesis
Similarity is evidence about a learned representation, not a guarantee of truth or complete relevance. Sentences saying a procedure is allowed and not allowed can share most words and may be close under some embeddings. Dates, numbers, negation, exceptions, and permissions require separate checks. Retrieval feeding a generator also needs relevance evaluation and access control. A similarity score is not automatically a calibrated probability that the final answer is correct. Evaluate whether retrieved passages support the actual question rather than treating geometric proximity as a substitute for evidence or authorization.
Keep index and query representations aligned
Updating an embedding model can change coordinates for the same text. Creating only new-model query vectors while searching old-model document vectors may be inconsistent even when dimensions match. Plan re-embedding, index identifiers, and a versioned switch. Use the same evaluation queries and relevance judgments when comparing versions, and separate approximate-index error from representation quality. A changed ranking can originate in the model, preprocessing, metric, or index settings. Recording those components makes the change diagnosable instead of attributing every difference vaguely to a better or worse embedding model.
Connect geometry to retrieval evaluation
Normalize the three example vectors and verify that dot products then equal cosine similarities. Construct a deliberately irrelevant candidate pointing close to the query and observe its high score. Completion means distinguishing geometric calculations from externally defined relevance judgments. The companion retrieval lab uses fixed small vectors to calculate recall as a controlled model. It does not benchmark a trained embedding model or establish general Japanese retrieval quality. Once the evaluation mechanism is understood, apply the same separation of representation, judgments, and metrics to a versioned real model and corpus.