liveBook · Manning

Embedding distance

As explained in Hidden Influences

A distance calculated between embedding vectors to quantify how close their represented entities are in the embedding space.

When a feed needs recommendations, it can compare a user’s embedding with item embeddings and serve items that are closest. This ranks content by distance, but fast searches can miss relevant items in favor of less relevant ones. section 2.7

Figure 2.11 When representing users and items with a single number, they can be thought of as points on a line. The recommendations will be ordered by their distance on the line. In this case, the User is represented with a 0.8; therefore, the items will be ordered as Item 3, Item 2, Item 1.

A line of points shows how distance orders recommendations when each user and item has a single number. section 2.7

Figure 2.12 Two-dimensional representation of users’ and items' embeddings. We represent users and items as two numbers: one for cat affinity and one for dog affinity. Such numbers can also be used as coordinates to represent them on the plane. User A has a high affinity for both animals, so they are in the top-right corner, while user B is neutral and close to the center. The items recommended for them are those that minimize the distance to their respective embeddings.

Cat and dog affinity coordinates show how the closest items can differ for users with different interests. section 2.7

How Hidden Influences covers it

How deep it goes
Explains distance-based recommendation with one- and two-dimensional diagrams, without giving a distance formula or implementation details.
Examples
Uses a one-number line and cat-and-dog affinity coordinates to show how distance orders recommendations.
What you can do after
Understand how distance ranks recommendations and how faster search can trade precision for speed.
How it connects
Connects embedding distance to embeddings and recommender systems.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hidden Influences. The section links point to the parts of the book it draws on.