An embedding model is refined so that two captions with the same meaning sit close together while captions with different meanings sit far apart. To evaluate this property directly, a team measures the angle between embedding vectors rather than their raw coordinate differences. Which similarity measure is most consistent with judging meaning by direction in the embedding space?
- AEuclidean distance, because it sums the squared coordinate differences and therefore reflects how far apart two vectors are in the space.
- BCosine similarity, because it depends only on the angle between the two vectors and is invariant to their magnitudes. Correct
- CManhattan distance, because summing absolute coordinate differences is more robust to outliers than the squared form used elsewhere.
- DJaccard similarity, because it compares the overlap between the active dimensions of the two vectors as sets.
Why A is wrong: Euclidean distance is a valid distance measure, but it grows with vector magnitude as well as direction, so two vectors pointing the same way but at different lengths register as dissimilar; the stem asks specifically for a measure that judges meaning by direction, which this does not isolate.
Why B is correct: Cosine similarity normalises out vector length and scores purely on the angle, so vectors pointing in the same direction score high regardless of magnitude; this matches the requirement to judge meaning by direction.
Why C is wrong: Manhattan distance is a real metric and its robustness claim is true, but like Euclidean distance it measures positional separation and is affected by magnitude, so it does not isolate the angular relationship the stem describes.
Why D is wrong: Jaccard similarity suits sparse set membership such as bag-of-words tokens and may tempt because retrieval is mentioned, but dense learned embeddings are continuous vectors with no natural set interpretation, so it does not apply here.