Embedding neighborhoods
Embeddings turn tokens or phrases into points. Nearby points are often used as a proxy for related meaning, and directions can carry rough relationships. This page uses a hand-built 2D toy dataset so the geometry is visible.
Click a point to inspect its neighborhood.
What is closest to king?
Distance is ordinary 2D Euclidean distance here. Real embedding search commonly uses cosine or dot-product similarity in a much higher-dimensional space.
- 1. princed=11.0
royal term aligned near man
- 2. monarchd=15.2
close to king and queen because it names the shared role
- 3. crownd=17.5
near royalty because it is part of the same concept neighborhood
- 4. warrantyd=18.4
adjacent business concept, not identical to refund
- 5. return policyd=27.6
business rule phrase related to refund decisions
Directions can encode a relationship.
The classic intuition is king - man + woman. In this toy space, that arithmetic lands near queen because the points were arranged to make the relationship legible.
Predicted point: (63, 59). Expected neighbor: queen. Distance: 0.0.
Take the royalty direction from man to king, then apply it to woman.