Elamur Research

Query2Prod2Vec: Grounded Word Embeddings for eCommerce

Paper · 2021 · Federico Bianchi, Jacopo Tagliabue and Bingqing Yu

Summary

A shopper can name a product category, a brand, or an activity in a very short search. The shop still has to work out which part of its inventory the shopper means. Query2Prod2Vec addresses a problem that comes before ranking the results: how can a shop represent the meaning of a search term when its customers leave relatively little text behind? The authors build representations of products from browsing sessions, then use the products clicked after a query to represent the query itself. Terms become comparable through the parts of the shop’s inventory they point to. The resulting numerical representations are word embeddings.

The method starts with patterns of product browsing. Items viewed in similar shopping contexts can acquire similar vectors, even when their catalog descriptions use different language. To represent a term, the method takes a weighted average of the vectors for products most frequently clicked after that term. If a shop already has enough browsing data but lacks search logs, it can approximate the second stage. A simple catalog search supplies candidate products, and a popularity distribution guides the sampling of artificial clicks. The same averaging procedure works with these simulated events.

The authors evaluate the representations on Italian data from a sports apparel shop and a home improvement shop. Merchandising labels supply the answers to analogies about relationships such as brand and sport. Using real clicks, Query2Prod2Vec has the highest analogy hit rate at both reported cutoffs in both shops. Its Hit Rate at a cutoff of 10 is 0.468 in the sports shop and 0.376 in the home improvement shop. It also leads a small human-judged similarity test in the sports shop, with an accuracy of 0.88. On that shop’s analogies, using only 1/3 of the original data or using simulated search clicks still yields higher hit rates than the full-data baselines.

Together, these experiments show that product interactions can support useful representations of retail vocabulary, including when search-specific evidence is scarce. The simulated setting still needs a product space learned from browsing and a way to find candidate products in the catalog. The evaluation measures how well the vectors recover catalog relationships and agree with judgments of word similarity. Whether they improve the ranked results that shoppers see is a separate question left open by the study.

Deep dive: Query2Prod2Vec: Grounded Word Embeddings for eCommerce

Query2Prod2Vec learns what shopping queries mean from the products people browse and click, and tests the resulting word vectors on analogies. · about 33 minutes to read

The problem and its context

A short query can carry a specific intention

A product search begins with a linguistic expression and ends with a choice among objects. Someone who types “sneakers” gives the shop a category name. The search engine returns products it considers relevant, possibly taking other context into account. The shopper might explore some of those products, make a purchase, or leave. This is a familiar sequence, but it contains an important division of information. The query tells the shop how the shopper described the target. Subsequent interactions offer clues about what the shopper was willing to consider. Query2Prod2Vec uses those clues to learn how the shop’s search vocabulary relates to its inventory.

The paper looks at a part of information retrieval and search that matters when a system represents queries and other inputs as vectors. A vector gives a term a numerical location, so an application can compare it with other terms by examining their positions. The difficulty is giving that position a useful interpretation. A term can be associated with a brand, a sport, or a product category because of the way shoppers encounter those concepts together. Its uses in ordinary prose or in a manufacturer’s description may supply some of the same information, alongside different associations. The authors ask how well the store’s own activity can supply the relevant relationships.

The queries themselves offer little room for surrounding words to clarify meaning. In the authors’ data, 60% of queries contain a single word and > 80% contain at most two. This is the reason for focusing on individual lexical representations. A longer piece of text can provide wording that helps determine what an ambiguous expression means on that occasion. In many of the searches studied here, the system has very little surrounding wording to use. The paper treats the quality of a term’s vector as a problem worth measuring independently. It mentions averaging or summing word vectors as ways to represent a longer query and leaves a systematic examination of composition for future work.

The vocabulary is also local in ways that matter. A shop can carry specialized terms associated with its line of business. Search traffic tends to include a long tail of expressions with relatively few observations each. The authors add that a retailer with substantial traffic in an English-language storefront may still operate smaller storefronts in languages for which resources are limited. A general representation can bring useful information to those stores, but there is still a question of whether it captures the meanings expressed in their catalogs and customer searches. Both experimental shops use Italian. Their different inventories let the authors study how the same technique handles two domains while keeping the language fixed.

Search traffic is only part of the evidence a shop collects

Query logs give a direct record of what visitors type, but a great deal of shopping can occur without a query. In Shop X, the sports apparel store, only 9% of sessions contain a search interaction. In Shop Y, the home improvement store, the proportion is around 29%. The authors also report that 30% was the highest proportion of sessions containing search among the dozens of stores in their network. These figures motivate a distinction between a shop’s overall traffic and the amount of evidence available for learning embeddings directly from its searches. A retailer can have a substantial record of browsing and still have little information about any particular query.

That distinction gives browsing an independent role. Visitors who navigate a store without typing anything still move among products. Their sessions supply evidence about which products occur in similar activity. A query with a few associated clicks can link to products whose vectors were informed by many such sessions. There is no need for all the evidence about the relationships among those products to come from people who searched for that term. The paper’s proposal depends on reusing the evidence that is more readily available to help interpret the evidence that is scarce.

Cost matters alongside availability. The authors consider shops that have to budget for training, deployment, and upkeep, including smaller retailers and companies that provide search services for multiple tenants. A provider deploying to a new store repeatedly faces the problem of learning from limited local history. A retailer can encounter a similar problem when it launches a storefront in another country or language. The paper calls this a cold start. Its experiments give the term a particular meaning: a shop can have an inventory and some browsing records while lacking useful records of actual searches. That intermediate state is where the proposed simulation can help.

What earlier approaches use as context

The authors place the study within work on learning lexical representations from distributional evidence. In this tradition, a representation can reflect which contexts a word tends to occur in. Count-based and predictive methods differ in how they use those observations, a distinction the paper introduces through a systematic comparison of the two families. The common question is how much useful information about word meaning can be recovered from the company words keep. Search adds another candidate source of context because a term is followed by interactions with items people can inspect. This puts the work in conversation with distributional semantics.

Contextual encoders put greater emphasis on the particular text in which a word appears. The paper cites earlier work on contextualized representations and discusses their success on semantic tasks and on search over documents. In document search, the retrieved objects can themselves be long passages of text. In a storefront, the retrieved objects are products, and the input query can be little more than a name. The contrast motivates a different use of context in the retail setting: treating product activity as a source of evidence alongside language. The paper cites Deep Contextualized Word Representations and BERT as examples of the contextual line of work.

Earlier retrieval methods had already used behavioral signals. Search2Vec uses interactions with ads and pages as contexts in which to learn about a search expression. QueryNGram2Vec adds representations of smaller units that make up a query, which gives it a way to represent expressions with little direct history. The authors also cite work that used image-derived product vectors to help represent queries in a personalization setting. That work motivates the idea that an object representation can contribute to a linguistic one. Query2Prod2Vec makes the connection explicit by first defining a space of products and then deriving each search term’s location in that space.

The paper connects this design to prior discussions of how language relates to the situations and objects speakers encounter. In the shopping case, the relevant objects belong to a defined inventory, and a record of interaction is available. A visit following a search is still only an indirect signal of meaning. It gives the authors an operational way to associate expressions with likely referents without manually annotating what every shopper intended. The evaluation then asks whether these representations preserve recognizable lexical relationships, using criteria that can be applied to the other approaches as well. The authors relate the broader motivation to Experience Grounds Language and Climbing towards NLU.

The method, step by step

Learn how products relate before learning what queries refer to

Imagine someone entering “shoes” and looking through the results. Some returned products may be plausible matches. Others may have appeared because of decisions made by the search engine. A click offers some evidence that a product belongs to what the shopper was looking for, although a shopper can click out of curiosity or overlook a relevant result. Query2Prod2Vec treats these actions as noisy feedback. When it sees multiple sessions, it uses the relative frequency of those actions to give some products more influence over the representation of a query.

A click would be a less useful signal if each product were represented only by an unrelated catalog identifier. The method first gives products vectors that carry information about shopping activity. If products are encountered in similar contexts, they can end up near one another in this space. The click stage can then take advantage of that structure. A term whose clicks are scattered over closely related products can still receive a coherent representation. Two terms can also end up close when they lead shoppers toward similar products, even if their individual lists of clicked items do not coincide.

The method separates two kinds of learning. The first concerns how products are related, with shopping sessions as evidence. The second concerns where to place an expression in that domain, with clicks after the expression as evidence. The authors refer to the second operation as denotation. In this setting, a denotation is implemented as a point in the product space associated with the query. The term “grounded” describes where the vector gets its meaning for the application: through a connection to represented products in the shop.

How Query2Prod2Vec places search terms in product space

The steps in order.

How Query2Prod2Vec places search terms in product spaceStep 1: Collect anonymized shopping sessions1. Collect anonymized shopping sessionsStep 2: Learn product vectors from browsing sequences2. Learn product vectors from browsing sequencesStep 3: Collect real clicks or simulate catalog clicks3. Collect real clicks or simulate catalog clicksStep 4: Count clicks for each query and product4. Count clicks for each query and productStep 5: Keep the products with the most clicks5. Keep the products with the most clicksStep 6: Average their vectors using click frequencies6. Average their vectors using click frequencies

Build the product space with prod2vec

Prod2vec adapts the training setup of word2vec. A word2vec system sees words in a textual context and learns representations through a prediction problem involving those contexts. Prod2vec substitutes products for words and shopping sessions for sentences. Product views give the learner the sequences from which to infer relationships. The paper describes the optimization as the same as in classical word2vec, with the interpretation of the sequence elements changed. It refers readers to prior work for the training framework. Efficient Estimation of Word Representations in Vector Space

The training signal comes from the way people browse. A product need never be named in a search to contribute a view to a session. Conversely, a product with few clicks after a particular query can have a vector informed by browsing that took place before, after, or entirely outside searches for that query. The aim is to give each available product a position reflecting its behavioral context. The paper does not assign a merchandising label to each dimension. The useful information is in the relationships among vectors learned from the sequences.

The authors follow a previously published procedure for choosing prod2vec settings. They use dimension 50, a context window setting of 10, and 30 training iterations. The negative-sampling exponent is 0.75. The dimension gives the length of each vector. The window setting governs which nearby positions in the session can supply context, and the exponent shapes the sampling of products used as negative examples in training. After this stage, there are 26,057 product embeddings available for Shop X and 84,575 for Shop Y. These counts describe the learned product spaces used downstream.

The product space is learned for the shop whose vocabulary will be represented. A brand or category can occupy different surroundings across stores because the inventory and browsing activity differ. The method and evaluation procedure can be repeated in each shop while leaving those local relationships intact. A result that holds for both shops therefore shows that the same construction can produce useful local spaces in two settings. The experiments do not require the coordinates learned in one shop to line up with the coordinates learned in the other.

Turn each query’s clicks into a weighted average

Once the product vectors are ready, the authors count how often a product was clicked after a given query. More frequent clicks give a product greater weight. The parameter called rank limits the number of product vectors in the average. The paper expresses the setting as follows.

rank = k

Here rank is the cap on how many products can contribute to the representation of a query, k is the chosen size of that cap, and = assigns the cap its value. Products are selected in order of click frequency for the query. In the main comparison the authors set rank to 5. They leave the effect of changing this parameter open.

The averaging operation described in the paper can be written as follows.

v(q) = (Σₚ∈P(q) c(q,p) v(p)) / (Σₚ∈P(q) c(q,p))

Here q is the query and p is a product. P(q) is the set selected for q by the click-frequency ranking and the rank cap. c(q,p) is the number of clicks associated with that query and product. v(p) is the product’s vector, and v(q) is the resulting query vector. Each Σ sums over products p belonging to the indicated set, as denoted by ∈. In the numerator, a click count multiplies its product vector. The / divides the vector sum by the total selected click count in the denominator, and = defines the query vector from that weighted average.

The denominator is what makes this an average. It lets click frequency determine how much of the result each product contributes. A product seen much more often than the other selected products pulls the average more strongly toward its own position. When the selected products occupy similar parts of the space and their click counts are more evenly spread, the result expresses more of what they have in common. The operation places the query vector in the same space as the products, with a vector length inherited from them.

There are two useful ways to read this construction. As a geometric operation, it summarizes a set of points by moving toward those given the most weight. As a statement about evidence, it gives repeated shopper selections more influence than isolated ones. The first interpretation explains how the query acquires a location. The second explains why the location depends on the search and click history of the shop. The learned vector can reflect similarities already present in the product space even when the searches themselves are too short to establish those similarities from language alone.

The paper’s main concern is the quality of vocabulary representations. The aggregation procedure can accept a longer string if there are product events associated with that exact string. That is distinct from asking whether the vector for a new phrase can be assembled from the vectors for its words. In the first case, the complete query has its own evidence from retrieval and clicks. In the second, the system would need a way to combine constituent meanings. The paper mentions the first as a possible use of the procedure and sets the second aside for future investigation.

Generate artificial clicks when search logs are scarce

The simulated variant changes the source of the events used by the averaging step. It starts with a list of words to represent, a fixed number of simulations for each word, and a distribution expressing product popularity. The procedure searches for a word and obtains a list of candidate products. It repeatedly draws a product from that list using the supplied distribution, recording each draw as an artificial event pairing the word with the selected product. The same word can therefore produce several events involving a popular candidate. The experiment uses N = 500 simulated search events per query.

Two sources of evidence serve different purposes here. The search step determines which products can be selected for a word. The popularity distribution influences how frequently eligible products are drawn. The distribution makes the simulator a source of frequency-weighted events. A catalog match establishes eligibility, and sampling supplies the counts that the aggregation procedure uses. The authors note that retailers can obtain information about product popularity from marketing analytics.

The paper describes how a shop could use its existing search engine for the candidate step. The experiments use a custom catalog index, so that the synthetic condition does not depend on the production search service being especially capable. The index connects words from product metadata to the products containing them. On top of it the authors use Boolean search and a simple term-weighting method. The Boolean component helps determine which entries match, and the term weights draw on how a word occurs in a document and how common it is across the collection. These are the roles of the inverted index and TF-IDF.

The sampling stage can be expressed in the order used by the paper’s algorithm.

product_list ← Search(w)

Here w is a word from the input vocabulary W, Search is the operation that finds candidate products for that word, and product_list is the resulting list. The left arrow ← stores the result on its left. Each word gets its own candidate list before its sampling repetitions begin.

p ← Sample(product_list, D)

Here p is the selected product, Sample denotes a draw from the candidate list, and D is the supplied distribution over products. product_list restricts the draw to candidates returned for the current word, and ← assigns the sampled product to p. The procedure repeats the draw N times for w, with N specifying the chosen simulation count per word.

(w, p) → E

Here (w, p) is the artificial click event linking the current word and sampled product. E is the initially empty collection of such events. The arrow → denotes appending the event to that collection. The algorithm returns E after processing the input vocabulary. This notation summarizes the append operation in the paper’s pseudocode.

Once the simulator has generated the events, the method counts them and constructs query vectors in the product space. The observed and artificial versions both operate on pairs linking a query to a product. That shared input format is why the product representation and aggregation can be reused. The simulation changes how a term is associated with products. The product vectors still come from the shop’s browsing evidence. The authors released their Query2Prod2Vec implementation to support replication in other stores.

Experiments and results

Two stores with different inventories and traffic

The data combine catalogs, search logs, and anonymized shopping sessions for two partner retailers. Shop X sells sports apparel and has an approximate Alexa rank of 200k. Shop Y sells home improvement products and has an approximate Alexa rank of 10k. The authors use those ranks to characterize the shops’ different positions in the retail landscape. In both cases, the text is Italian. The comparison therefore changes retail domain, catalog, and traffic conditions while keeping the language the same.

Training sessions were randomly sampled from June-October 2019. The authors preprocessed the data and discarded sessions that looked like bot activity, leaving 722,479 sessions for Shop X and 1,986,452 for Shop Y. These are retained shopping sessions, including browsing. They should be read separately from the sizes of the product spaces and the numbers of test items. The authors report that the event and session identifiers in the training data are anonymous UUIDs.

The comparison uses the same session data where systems learn from sessions. The systems still draw on different types of evidence by design. A catalog baseline uses product descriptions, the contextual baseline uses an Italian pretrained encoder, and the behavioral systems use the interactions that their training objectives call for. The authors follow the settings of the cited approaches for the baselines. Query vectors generally have dimension 50. UmBERTo supplies its pretrained vectors with dimension 768. The comparison is between the resulting representations on a common lexical task, with methods allowed their respective sources of information.

How the baselines represent a query

The catalog-text baselines are Word2Vec and FastText. For Word2Vec, the authors train a continuous bag-of-words system, typically called CBOW, on the catalog’s product descriptions. Its training problem predicts a word from the surrounding words. FastText is also trained on the descriptions, with sub-word information contributing to the representation. These approaches ask what the catalog’s wording can teach about the vocabulary. They provide a reference point for judging what the product associations add. Enriching Word Vectors with Subword Information

Query2Vec represents queries through a prediction task. Starting from a query, it learns to predict an item that was clicked or purchased. The query representations come from that learning procedure. It is a pertinent comparison because it also connects search language to products. Query2Prod2Vec makes the product space an explicit intermediate representation learned from browsing and obtains the query vector by averaging product vectors. The systems therefore give a way to compare different uses of the query-to-product connection.

Search2Vec learns from sessions containing queries and clicks by adapting a skip-gram setup. In skip-gram training, an observed item is used to predict items in its context. The authors also evaluate a time-sensitive Search2Vec variant, which changes how query-click pairs are weighted according to the time between the actions. QueryNGram2Vec combines this general kind of training with embeddings for individual words so that a query can be represented when there is no vector learned for the whole expression. These approaches test whether query and interaction sequences can recover the relationships used in the evaluation. Distributed Representations of Words and Phrases and their Compositionality

UmBERTo is a RoBERTa encoder pretrained on Italian. The paper obtains the query vector from the designated output of its final layer. This provides a language-specific contextual baseline that can represent terms beyond the directly observed behavioral vocabulary. Its output is compared using the same tests as the vectors learned from the shops. Its broad coverage and its scores on the analogies are reported separately, which matters when an encoder can return a vector for a term without having learned the shop-specific relationship that an item asks about.

How merchandising labels become test questions

An analogy tests whether a relationship between terms can be applied to another term. Give the system a brand and its characteristic sport, for instance, and ask for the sport that goes with another brand. A good retail analogy needs a reasonably determinate answer. The fact that a brand sells a product does not imply that there is an obvious corresponding product for a different brand. Asking for Nike’s counterpart to one particular Adidas product can leave several reasonable possibilities. The benchmark construction aims to reduce this ambiguity before the representations are evaluated.

The authors start with labels assigned for merchandising purposes such as navigation and inventory management. Product type, brand, and sporting activity are the three attributes they focus on for Shop X. The attributes they use for Shop Y are product type, brand, and area of the house. The fields are among those most often encountered in search logs for the respective shops. Because merchandisers assigned the labels for the catalog, the test can draw on relationships defined independently of the embeddings being evaluated.

Consider the direction from brand to sport. The authors take a brand and count how frequently each sport label appears among its products. For Wilson, tennis is the illustrative concentrated association. A brand distributed across several sports supplies a less decisive label. The authors calculate a Gini coefficient for each distribution. The coefficient is used here to capture how unevenly the products are distributed across the labels. They set the filtering threshold at the 75th percentile. A qualifying brand is associated with its most frequent sport label. The filter is meant to produce test items where the target association has a strong basis in the catalog.

The authors then select another qualifying brand and pair it with its own most frequent sport. In the paper’s worked example, Wilson goes with tennis and Atomic goes with skiing. The pairing is sampled repeatedly, with K = 10 specifying the number of repetitions in this construction. A pair of brand–sport associations supplies two questions, one in each direction. The paper’s analogy pattern can be written this way.

b₁ : s₁ = b₂ : ?

Here b₁ is the first brand, s₁ is its associated sport, and b₂ is the second brand. The colon : reads as “is to,” and = asks for the same kind of relationship on either side. The question mark ? is the missing label, with s₂, the sport associated with b₂, as the target. The subscripts distinguish the members of the two pairs. They describe positions in an analogy, not numerical values to substitute for brands or sports.

b₂ : s₂ = b₁ : ?

Here the same two brands b₁ and b₂ and their sport labels s₁ and s₂ exchange roles. The colons again mark the relationship and = asks for it to carry across the pairs. The question mark ? now stands for s₁. Giving the relationship in both directions lets each qualifying association serve as a source and as a target.

The same general procedure can ask about other kinds of merchandising relationships. One example pairs Garmin with watches and Arena with bathing caps. Another associates a racket with tennis and a bathing cap with indoor swimming. The first tests a brand and its characteristic kind of product. The second tests products and the activities in which they are used. What makes a response correct is the corresponding catalog label selected by the test procedure. It is not necessary to know which particular item a shopper clicked in order to score the answer.

Hit rate and vocabulary coverage

The analogy task contains 1208 test analogies for Shop X and 606 for Shop Y. Hit Rate records whether the expected answer is in the leading candidates at a specified cutoff. HR@5 uses a cutoff of 5 and HR@10 uses a cutoff of 10. A system can therefore succeed at the larger cutoff after missing at the smaller one. The authors also computed HR@20 and report that it followed the general pattern. They do not give those scores in the main results.

Coverage asks whether the relevant vectors exist in the system’s vocabulary. An analogy is covered when embeddings are available for all its terms, including the target. This quantity is reported separately from hit rate because being able to represent every term and being able to recover the intended relationship are two different properties. The paper describes coverage as a ratio, which can be written as follows.

CV = |Acovered| / |A|

Here CV is coverage, A is the set of test analogies in a shop, and Acovered is the subset for which all required embeddings are available. The vertical bars | | count the members of a set, / divides the covered count by the test-set count, and = identifies the resulting ratio as coverage. A high value shows that missing vectors affect few questions. It leaves open how well the available vectors answer them.

The analogy results in each shop

With real search clicks, Query2Prod2Vec records HR@5 of 0.332 and HR@10 of 0.468 on Shop X. Word2Vec is the closest baseline there at both reported cutoffs, with HR@5 of 0.206 and HR@10 of 0.242. The result is informative because the strongest catalog-text baseline has a clear advantage over other alternatives in that store. The grounded method improves on a comparison that includes a relatively strong text-based option, even in the shop with the smaller share of sessions containing searches.

Shop X analogy test Hit Rate at cutoff 10

Query2Prod2Vec using real clicks leads the comparison, with Word2Vec the strongest baseline.

Shop X analogy test Hit Rate at cutoff 10Query2Prod2Vec with real clicks (this paper): 0.468Query2Prod2Vec with real clicks (thispaper)0.468Word2Vec: 0.242Word2Vec0.242QueryNGram2Vec: 0.122QueryNGram2Vec0.122FastText: 0.116FastText0.116Query2Vec: 0.113Query2Vec0.113UmBERTo: 0.042UmBERTo0.042Search2Vec time-sensitive: 0.025Search2Vec time-sensitive0.025Search2Vec: 0.024Search2Vec0.024
The numbers
System or settingHR@10
Query2Prod2Vec with real clicks (this paper)0.468
Word2Vec0.242
QueryNGram2Vec0.122
FastText0.116
Query2Vec0.113
UmBERTo0.042
Search2Vec time-sensitive0.025
Search2Vec0.024

The smaller cutoff on Shop X gives a slightly different ordering among the baselines below Word2Vec. Query2Vec has HR@5 of 0.077, QueryNGram2Vec has 0.071, and FastText has 0.068. The corresponding scores for UmBERTo, time-sensitive Search2Vec, and Search2Vec are 0.019, 0.018, and 0.016. Comparing these with the larger cutoff shows why the paper names the cutoff with the result. A representation that puts a target in the wider set of leading answers can still have difficulty moving it higher.

On Shop Y, Query2Prod2Vec reaches HR@5 of 0.277 and HR@10 of 0.376. The strongest baseline is time-sensitive Search2Vec, at 0.232 for HR@5 and 0.329 for HR@10. QueryNGram2Vec reaches 0.148 at HR@5, followed by Search2Vec at 0.095 and Query2Vec at 0.065. The remaining Shop Y scores at that cutoff are 0.030 for UmBERTo, 0.010 for FastText, and 0.005 for Word2Vec. The baseline that led on the sports catalog is near the bottom on the home improvement task, while weighting interactions by time is far more competitive there.

Shop Y analogy test Hit Rate at cutoff 10

Query2Prod2Vec using real clicks leads, and time-sensitive Search2Vec is the closest alternative.

Shop Y analogy test Hit Rate at cutoff 10Query2Prod2Vec with real clicks (this paper): 0.376Query2Prod2Vec with real clicks (thispaper)0.376Search2Vec time-sensitive: 0.329Search2Vec time-sensitive0.329QueryNGram2Vec: 0.216QueryNGram2Vec0.216Search2Vec: 0.150Search2Vec0.150Query2Vec: 0.120Query2Vec0.120UmBERTo: 0.103UmBERTo0.103FastText: 0.012FastText0.012Word2Vec: 0.009Word2Vec0.009
The numbers
System or settingHR@10
Query2Prod2Vec with real clicks (this paper)0.376
Search2Vec time-sensitive0.329
QueryNGram2Vec0.216
Search2Vec0.150
Query2Vec0.120
UmBERTo0.103
FastText0.012
Word2Vec0.009

Coverage helps explain what is being compared. Query2Prod2Vec covers 0.965 of the Shop X analogies and 0.924 of the Shop Y analogies. Query2Vec has coverage of 0.97 and 0.93 respectively. QueryNGram2Vec reaches 0.99 on Shop X and 0.92 on Shop Y, while UmBERTo reaches 0.99 and 1.00. These systems can supply embeddings for many of the same benchmark questions while differing in how well they rank the target answers. In particular, the broad availability of UmBERTo’s vectors does not carry over to the highest hit rates.

The two catalog baselines have much narrower coverage in Shop Y. Word2Vec covers 0.47 of Shop X’s analogies and 0.03 of Shop Y’s. FastText covers 0.52 and 0.03 respectively. Each Search2Vec variant covers 0.23 on Shop X and 0.90 on Shop Y. The Search2Vec comparison is especially useful because both variants have the same reported coverage in each shop. Their differences in hit rate show that systems can make quite different use of a vocabulary of the same reported breadth.

The combined results support the authors’ emphasis on comparing stores. Looking at Shop X alone would give Word2Vec a prominent place among the alternatives. Looking at Shop Y alone would favor a conclusion about the strength of time-sensitive search contexts. Query2Prod2Vec leads in both settings, despite the change in its closest competitor. Since the stores also have different analogy sets, the cross-shop pattern concerns performance relative to the alternatives on each local task. The scores do not isolate the influence of traffic or inventory size.

A similarity test with human judgments

The paper supplements the catalog analogies with a semantic similarity task in Shop X. Two native speakers answer 46 manually curated questions. In each question, they choose which of two terms is more similar to an anchor term. The paper’s example asks the reader to compare Adidas and Wilson with Nike. The task asks for a relative judgment and does not require the speakers to assign a numerical similarity score. Shop X was selected because the authors found it easier to recruit speakers familiar with sports apparel than with home improvement items. Semantic similarity

To answer a question, a system compares the anchor vector with each option using cosine similarity. This comparison is based on the direction of the vectors. The answer is the option with higher similarity to the anchor, and accuracy is measured against the human ratings. The reported Cohen Kappa score for agreement between the speakers is 0.67, which the authors characterize as substantial. Kappa accounts for expected chance agreement and concerns the raters’ consistency. It measures a different aspect of the experiment from a system’s accuracy.

Query2Prod2Vec scores 0.88 on the Shop X similarity task, followed by QueryNGram2Vec at 0.82 and Word2Vec at 0.68. FastText and UmBERTo each score 0.57. Query2Vec scores 0.54, and both variants of Search2Vec score 0.17. The baseline ordering differs from the analogy result in Shop X, where Word2Vec has the highest baseline hit rates. Both tasks concern lexical relationships, but the analogy asks the system to carry a catalog relation over to another pair, while the similarity question asks it to choose the closer of two specified terms. Leading on both gives the paper complementary evidence about the learned representations.

What the ablations show

Reducing the data in both stages

The paper reports comparisons that change the amount of data and the source of clicks. It leaves the overall construction in place. The first comparison gives Query2Prod2Vec only 1/3 of the original data on Shop X. The reduction applies both to the learning of product vectors and to the click evidence used to associate queries with those vectors. This matters because the product space is itself learned from behavior. Restricting the click data alone would leave the reduced-data system able to rely on product vectors learned from all the browsing sessions.

The smaller-data condition reaches HR@5 of 0.276 and HR@10 of 0.380 on the Shop X analogy task. Those values are below the real-click condition trained with the original data, which reaches 0.332 and 0.468 on the same metrics. They are above the corresponding scores of every full-data baseline in that shop. The comparison shows that the method can remain competitive after a joint reduction in the evidence available to its two stages. It also shows that the extra evidence in the original setting is of practical value on the task.

Because both stages receive less data, the comparison cannot locate the loss in one stage. One possibility is that fewer sessions weaken the relationships reflected in the product space. Another is that fewer query clicks make the weighted averages less representative. The two effects can also interact, since a vector estimated from thin click evidence may depend heavily on the position of a particular product. The paper’s joint reduction tests whether the pipeline still works when both inputs are scarce. It does not provide separate estimates of how much each kind of data contributes.

Replacing real search clicks with artificial events

The simulated condition goes further with the search-specific input. It uses no real search events for the association between queries and products. The custom catalog search supplies eligible products, popularity guides the draws, and the artificial events are aggregated over the browsing-based product vectors. With this setup, the paper reports 0.259 for HR@5 and 0.363 for HR@10 on the Shop X analogies. Both are below the reduced-data results that still use actual searches, and both exceed the full-data baseline scores on the same shop and cutoffs.

Shop X analogy test Hit Rate at cutoff 10 by training condition

Full real-click training leads, and reduced-data and simulated-click training both score above the strongest baseline.

Shop X analogy test Hit Rate at cutoff 10 by training conditionQuery2Prod2Vec with full real-click data (this paper): 0.468Query2Prod2Vec with full real-click data(this paper)0.468Query2Prod2Vec with reduced real-click data: 0.380Query2Prod2Vec with reduced real-clickdata0.380Query2Prod2Vec with simulated clicks: 0.363Query2Prod2Vec with simulated clicks0.363Word2Vec baseline: 0.242Word2Vec baseline0.242
The numbers
System or settingHR@10
Query2Prod2Vec with full real-click data (this paper)0.468
Query2Prod2Vec with reduced real-click data0.380
Query2Prod2Vec with simulated clicks0.363
Word2Vec baseline0.242

The result makes the cold-start claim concrete. A shop can sometimes recover useful associations without waiting to observe how visitors use search. Text in the catalog gives the simulator something to retrieve, and the learned product space supplies information about how the retrieved products sit among their neighbors. At the same time, the simulator and shoppers provide different evidence. When visitors search, their clicks can reveal choices among items displayed in that event. The simulator’s choices are constrained by catalog matching and popularity. Its lower hit rates are consistent with the two sources producing different quality of association. The comparison does not identify which part of that difference matters most.

The authors mention a similar simulated result on Shop Y but omit its scores. The reported numbers therefore support a detailed comparison among data conditions in Shop X. They establish that the simulation can work with the particular index, product space, and vocabulary used there. The paper does not vary the candidate search, popularity weighting, and simulation count independently. It cannot attribute the synthetic result to any one of those design choices.

Checking whether the finding depends on one benchmark

The human similarity task changes the way correctness is decided. Analogy answers come from merchandising annotations and from a rule intended to choose concentrated catalog associations. Similarity answers come from people selecting the closer term. The same approach leads the comparisons under both criteria. This helps address the possibility that the analogy scores reflect a particularly narrow fit to the test construction. A system can also agree with choices made by speakers about relative similarity. Since the test is small and comes from the sports shop, it offers a check on the analogy result in that setting.

Another controlled comparison concerns the time weighting in Search2Vec. The two variants use the same kind of session evidence and achieve the same coverage in each shop, but the variant that accounts for elapsed time does much better on Shop Y’s analogies. That difference is much smaller on Shop X. It shows how a modeling choice about the relationship between a query and nearby actions can matter differently across shops. It also puts the Query2Prod2Vec comparison in context: the proposed method’s lead on Shop Y is over a behavioral baseline that makes effective use of the local interaction signal.

Training time under the reported setup

For Shop Y, the authors report that the best-performing Query2Prod2Vec run completes in 30 minutes using only a CPU. They give a training time of 2 to 4 hours for competitive alternatives such as time-sensitive Search2Vec and QueryNGram2Vec, with a Tesla V100 16GB GPU cited for that training. The reported times show a difference in the practical setup required for these runs. They do not establish a speed ratio on identical hardware or measure resource use at deployment.

The paper also gives an illustrative cloud cost estimate. On the cited cloud instance, the QueryNGram2Vec training setup costs about 12 USD, while the Query2Prod2Vec CPU container costs under 1 USD. The authors use these estimates to explain why training time and hardware requirements matter when a team needs to generate embeddings for many stores or repeat training during development. This is a comparison of particular configurations. The paper connects the broader concern about computational cost with Energy and Policy Considerations for Deep Learning in NLP.

Limitations

Limits identified by the authors

The paper studies lexical representations and reserves direct retrieval experiments for future work. Hit Rate in the analogy setup records how frequently a target word appears among candidate answers. It does not measure the usefulness of a ranked set of products presented to a shopper. The semantic similarity result is also at the level of terms, with agreement against the judgments elicited for those items. The authors propose evaluating specific retrieval tasks with a dual encoder, an approach in which the inputs to be matched are encoded separately. That proposed evaluation would address a different outcome from the ones reported here. The cited example of the retrieval approach is Dense Passage Retrieval for Open-Domain Question Answering.

The authors also leave composition open. An embedding for a familiar search expression can be learned through interactions attached to that expression. A system confronted with an unfamiliar combination would need to infer how the meanings of its parts fit together. Averages of word vectors are mentioned as a way to build query representations, but the paper does not run a systematic composition experiment. Its analogy results therefore concern relationships among represented terms. They do not establish that a composed vector will retain the fine distinctions necessary for a longer search.

Rank is another explicit open question. The main comparison fixes the number of contributing product vectors at 5. Including more products could bring in useful variants, or give more weight to peripheral matches. Including fewer would concentrate the average on the most frequently clicked items. The results do not say how that balance varies with query frequency, product type, or shop. Similarly, the synthetic experiments use N = 500 events per query without a comparison across different simulation counts. The study establishes the performance of these settings as used, rather than the sensitivity of performance to either choice.

The authors present the human study as a partial measure of alignment with speakers’ lexical intuitions. It uses the sports shop, where the authors could more readily find raters familiar with the subject matter. Its evidence comes from relative similarity choices among the selected terms. The paper’s own description of the task supports reading it as a supplement to catalog-based evaluation, with a narrower population and vocabulary than would be needed to make claims about typical shoppers across stores.

Limits that follow from the setup

Clicks reflect both what shoppers do and what a search engine gives them the opportunity to do. A product has to be encountered before it can receive a click, and an existing engine influences what is encountered after a query. Query2Prod2Vec uses frequency to estimate the importance of a product to the representation. That frequency may combine relevance, exposure, and other reasons for exploring a result. The experiments show that this mixture yields useful vectors for the benchmarks. They do not isolate a shopper’s underlying intent or estimate how the same person would have acted with a different list of products.

The synthetic variant has a related dependence on what the catalog search retrieves. If the index cannot connect an expression to a product’s metadata, that product will be absent from the candidates for simulated clicks. Sampling can give more or less influence to candidates that are present, but it cannot give an omitted item a chance of being drawn. The browsing space can provide useful similarities among products after retrieval has supplied anchors. The study does not show how often catalog terms with weak initial matches acquire good representations, or how much of the outcome comes from the metadata as distinct from the geometry of browsing.

The cold-start evidence also has an important boundary. The artificial events replace real search interactions. Prod2vec still needs browsing sessions, the index needs product metadata, and the simulation uses popularity information. A newly opened shop with a catalog and little behavioral evidence faces a different version of the cold-start problem. The reported experiments say how the method works with a browsing-based product space already available. They do not show that this space can be learned in a store without that history or transferred successfully from a different inventory.

The analogy construction intentionally favors cases with concentrated labels. This makes an answer easier to defend, which is important in a store where broad brands may sell many unrelated kinds of products. It also shapes the sample. The reported hit rates chiefly tell us about relations for which the catalog supplies a strong favored association. They say less about searches that are ambiguous, about brands distributed across several categories, or about relations for which there is no clear catalog label. Since sampled pairings can share source terms or reverse the direction of the same relation, the item count should also be read as the number of test questions instead of a count of distinct kinds of relationship.

There is some overlap in the shop’s sources of structure. The benchmark draws answers from merchandising metadata. Textual baselines learn from catalog descriptions, the simulator retrieves from catalog metadata, and customers browse products arranged in the same retail environment. The evaluation asks whether the representations recover distinctions meaningful in that environment. It cannot disentangle all the ways those distinctions enter the systems. In particular, the evidence does not establish that the advantage comes exclusively from the referential averaging design, independently of the type and volume of behavioral data available to it.

Finally, the comparisons cover two shops and one language. They establish that the method can perform well in both of the observed retail domains and across their different traffic conditions. The setup does not isolate which difference between shops matters most. The traffic level, product inventory, and relations included in the analogy test vary together. The sample-efficiency scores are detailed for the sports shop, and the human similarity questions are drawn from that shop alone. Broader claims about new languages, inventory structures, or customer populations would need evidence from settings where those factors can be examined separately.

What came after

There is no documented follow-up study to describe here. The paper closes with two directions that clarify where its results could be extended. The first is an evaluation on specific retrieval tasks using a dual encoder. Such an experiment would take the word representations into a setting in which the quality of candidate retrieval or ranking can be measured directly. The analogy results supply evidence that the vectors encode relationships from the shop. A retrieval study would examine whether those relationships help when a system has to return products for an actual search.

The second direction is to study composition systematically. The authors propose following up on earlier work in which image-derived product vectors helped with personalization during query entry. Their own method establishes a way to derive a term’s representation from product evidence. A composition study would ask how far such representations can be combined when the meaning of a query depends on several words together. The paper leaves both lines of work as research questions. Its demonstrated contribution is the construction and evaluation of retail vocabulary embeddings that draw on browsing, observed clicks, and simulated search events.

Cite

Cite as Federico Bianchi, Jacopo Tagliabue and Bingqing Yu. 2021. Query2Prod2Vec: Grounded Word Embeddings for eCommerce. Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Industry Papers.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2021.naacl-industry.20

@inproceedings{bianchi2021query2prod2vec,
  title = {{Query2Prod2Vec: Grounded Word Embeddings for eCommerce}},
  author = {Federico Bianchi, Jacopo Tagliabue and Bingqing Yu},
  booktitle = {Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: Industry Papers},
  year = {2021},
  doi = {10.18653/v1/2021.naacl-industry.20},
  url = {https://doi.org/10.18653/v1/2021.naacl-industry.20}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bianchi-2021-query2prod2vec-grounded-word-embeddings-ecommerce/