Embeddings and similarity · Explore together

What counts as close?

Move a query vector and compare neighbors under distance and cosine similarity.

One person controls the experiment. The other predicts and questions. Swap roles after a trial.

cos⁡θ=q⋅v∥q∥∥v∥\cos\theta=\frac{q\cdot v}{\lVert q\rVert\lVert v\rVert}

Illustrative 2D vectors · labels are invented, not learned semantics

Scroll across the diagram to compare the vectors.

-4-4-2-2002244 xy Query
Move the query, then compare the two metrics.

    Find a disagreement

    Find a query whose nearest neighbor changes with the metric. Which metric ignores vector length? Explain using the drawing.

    What do the distances measure?

    Euclidean distance is the length of the difference vector. Cosine distance is 1 − (q · v)/(|q||v|): it compares direction and is undefined if either vector is zero.

    These invented positions demonstrate geometry. They do not show actual semantic relationships between these objects.

    Compare your evidence

    What can you explain now?

    Ask your partner to restate your reasoning. An experiment suggests a pattern; your explanation should say why it holds and when it applies.

    1. What does Euclidean distance care about that cosine similarity discards?
    2. What happens if the query has length zero?
    3. Which notion of closeness would fit a situation you care about?