--- title: Product embeddings and vectors slug: l9gg3565 canonical_url: https://docs.coveo.com/en/l9gg3565/ collection: coveo-for-commerce source_format: adoc --- # Product embeddings and vectors A _product embedding_ is a machine learning procedure where products are assigned positions in a space. Similar products are close to each other, while products that are different are far from each other. Each product's position in the space is called its [product vector](https://docs.coveo.com/en/nbla0256/). The [embedding](https://docs.coveo.com/en/ncc87383/) procedure can be utilized in many ways by [Coveo Personalization-as-you-go](https://docs.coveo.com/en/m5kd0347/) (PAYG) [models](https://docs.coveo.com/en/1012/), and the resulting relationships between products can be used to extract subtle information about products and provide personalization in search results. ## Traditional versus new approach to vectors Traditional grouping of similar products relies on manual assignment or tagging with categories, brands, sizes, or colors, then recommending based on these predefined dimensions. This method is limited in determining which products are similar and complementary to one another, and this is where [product embeddings](https://docs.coveo.com/en/laei9434/) are useful. The main reasoning behind [embeddings](https://docs.coveo.com/en/ncc87383/) is that products which are "related" tend to appear in the same browsing sessions. For example, when a [visitor](https://docs.coveo.com/en/nbub9475/) is training for a marathon, they might browse for running shoes and other related products in the same session. ![Simple browsing for running shoes online example](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/l9gg3565_images/vectors-running-shoe-simple-example.png) A digital commerce experience is made up of user sessions, which are made up of different products. Browsing can be a sequence of events, going from product A to B. A [user session vector](https://docs.coveo.com/en/nbla0227/) is a representation of the products a user has recently viewed. Comparing the user's session vector to product positions in the precomputed [embedding](https://docs.coveo.com/en/ncc87383/) space enables the prediction of short-term interests, leading to recommendations or boosted products in search results. ![Representation of a high dimensional product embedding](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/l9gg3565_images/dimensional-product-embedding-example.gif) The previous plot is a 3-dimensional representation of a high-dimensional product [embedding](https://docs.coveo.com/en/ncc87383/). When the plot image stabilizes, distinct clusters of products become easily identifiable. Machine learning product [embedding](https://docs.coveo.com/en/ncc87383/) algorithms are a form of a [deep learning](https://en.wikipedia.org/wiki/Deep_learning) [model](https://docs.coveo.com/en/1012/). They automatically capture subtle aspects of a product, such as the related sport, gender and style, based purely on user behavior, customer data, and product information, which can power many use cases in commerce at scale. In addition, the [Coveo Platform](https://docs.coveo.com/en/186/) uses [catalog data](https://docs.coveo.com/en/obcf0333/) to augment those vectors even further. ## Personalized search The offerings of [Coveo Personalization-as-you-go](https://docs.coveo.com/en/m5kd0347/) use product vectors as building blocks across all [models](https://docs.coveo.com/en/1012/). Once the product embeddings are computed, we can take a user's product preferences into account to provide personalized search results along the customer journey. Again, returning to the initial example when browsing for running shoes. When querying for `shoes` in the vanilla, non-personalized scenario, the results returned are good but completely removed from the "running shoe" theme mentioned before. ![Vanilla shoe search results example](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/l9gg3565_images/embeddings-shoes-vanilla-example.png) By introducing the session vector of a user specifically interested in sports into the ranking mix, results become much more relevant to running shoes. ![Personalized shoe search results example](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/l9gg3565_images/embeddings-shoes-personalized-example.png) Embeddings can also capture the intent of the user through queries not directly related to the products seen in the session. Continuing from the previous example, when a customer searches for `pants` after browsing for running shoes, the difference between a vanilla approach (showing various pant styles) and personalized one (displaying running-related pants) is impressive. It highlights the search engine's ability to capture the "running" theme. ![Vanilla versus personalized search results for pants in a running shoe context](https://docs.coveo.com/en/assets/images/coveo-for-commerce/images/l9gg3565_images/vanilla-vs-personalized-search-pants-example.png) Personalized search is a key component of the customer journey and of product deployments that work reliably at scale. Two sources of data are required to leverage personalized search: * Begin by [gathering your data and integrating your products into a catalog entity](https://docs.coveo.com/en/3448/). * [Log commerce events](https://docs.coveo.com/en/3188/) to get an exact account of a user's interaction with elements of your ecommerce site, by embedding user data within the products. Embeddings and vectors are utilized in the following [Coveo ML](https://docs.coveo.com/en/188/) models: [Predictive Query Suggestions (PQS)](https://docs.coveo.com/en/m1ol5526/), [Intent-Aware Product Ranking (IAPR)](https://docs.coveo.com/en/m61h0552/), and [Session-Based Product Recommendations (SBPR)](https://docs.coveo.com/en/m7db5404/). ## About the cold start feature With traditional algorithms, [product vectors](https://docs.coveo.com/en/nbla0256/) are generated based on customer interactions with the different products made available in your [catalog entity](https://docs.coveo.com/en/3143/). This means that the more interactions a product has, the more accurate its vector representation will be. But what if a product has none or few interactions? The vector generation process integrates a cold start feature to address this issue. This optimized process allows the usage of product's [metadata](https://docs.coveo.com/en/218/) to build its vector representation and place it accurately within the vector space. For more information, see [About the cold start feature](https://docs.coveo.com/en/na2a8306/).