On the Consistency of Average Embeddings for Item Recommendation

Walid Bendada, Guillaume Salha-Galvan, Romain Hennequin, Thomas Bouabça, Tristan Cazenave

Introduction

In modern recommendation engines, items such as songs, movies, or products are typically represented as high-dimensional vectors known as embeddings. To represent higher-level concepts—such as a user’s long-term taste or a specific music playlist—engineers frequently employ a mathematical shortcut: taking the average of the embeddings of the items involved.

This practice rests on the intuitive assumption that the "average vector" will reside in a region of the vector space close to its constituents. However, if the average of items A and B ends up being spatially closer to an unrelated item C, the recommendation engine may suggest irrelevant content. This paper investigates the consistency of this ubiquitous practice, questioning to what extent an average vector actually remains similar to the specific items it is meant to represent.

Defining the Consistency Score

To quantify this phenomenon, the authors introduce the Consistency Score, denoted as $Consistency_k(\mathcal{X})$. This metric is defined as the "expected precision" of the averaging operation. Specifically, if one averages $k$ items, the score measures what percentage of those original $k$ items are actually among the $k$ nearest neighbors of the resulting average vector in the total item catalog.

  • A score of 1.0 indicates a perfect representation, where the average vector is closer to its source items than to any other items in the dataset.
  • A score of 0.0 indicates a total drift, where the average vector has moved entirely away from its sources into an unrelated region of the embedding space.

Theoretical Framework vs. Real-World Reality

The researchers approached the problem through a dual lens of theoretical modeling and empirical validation. Using the Central Limit Theorem, they derived a closed-form mathematical expression to predict consistency based on the embedding dimension ($d$), the total number of items ($N$), and the statistical moments—specifically variance and kurtosis—of the embedding distribution.

The "I.I.D." Optimism

In a theoretical environment where embedding dimensions are independent and identically distributed (i.i.d.), the math suggests that averaging should work remarkably well. Even within a massive catalog of a million items, the theory predicts that the average of a small set of items should remain highly consistent with its sources. This theoretical optimism explains why averaging became a standard industry practice.

The Reality Gap

When the authors tested their formulas against real-world production embeddings from the music streaming service Deezer, they discovered a startling discrepancy. Real-world embeddings are not i.i.d.; they contain complex clusters, semantic hierarchies, and outliers. Because of this inherent structure, real-world consistency is significantly lower than theoretical models suggest.

Key Findings

1. The "Two-Item" Failure

One of the most striking results involves a production dataset of 2 million track embeddings (2M-TT-SVD). For a set size of $k=2$, the consistency score was a mere 6%. This implies that if a system averages just two songs to create a mini-profile, there is a 94% chance that neither of those two songs will be among the two closest neighbors of the resulting average vector.

2. The Role of Kurtosis and Dimensionality

The research highlights that kurtosis (the "tailedness" of a distribution) is a primary driver of inconsistency. Distributions with heavy tails are prone to outliers that pull the average vector away from its constituents. Conversely, increasing the embedding dimension ($d$) generally improves consistency, as higher-dimensional spaces provide "more room" for the average to remain distinct from unrelated items.

3. Algorithmic Sensitivity

The method used to generate embeddings significantly impacts their consistency:

  • SVD-based embeddings (Singular Value Decomposition) show a rapid decay in consistency as more items are averaged.
  • ALS-based embeddings (Alternating Least Squares) exhibit poor consistency (~2%) regardless of the number of items averaged, suggesting they are fundamentally less suited for centroid-based representations.

Conclusion and Future Directions

The study reveals that the common practice of averaging embeddings is mathematically fragile in real-world applications. The primary limitation of current theory is the assumption of independence between embedding dimensions, which rarely holds true for vectors learned from human behavior.

The authors propose a shift toward Consistency-Aware Embedding Learning. Rather than training embeddings solely to predict the next item in a sequence, researchers could introduce regularization terms (such as KL-divergence) to force embeddings into distributions that are more "average-friendly." Such an approach would ensure that common operations like profile averaging remain mathematically faithful to a user's actual history, leading to more reliable and interpretable recommendations.

Summary updated

BibTeX
@inproceedings{bendada2023consistency,
  author = {Walid Bendada and Guillaume Salha-Galvan and Romain Hennequin and Thomas Bouabça and Tristan Cazenave},
  title = {{On the Consistency of Average Embeddings for Item Recommendation}},
  booktitle = {RecSys},
  year = {2023},
  doi = {10.1145/3604915.3608837},
}
Figure