Semantic Product Matching Using Retrieval-Rerank Architecture

delivery_hero · E-commerce · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: E-commerce product matching and assortment intelligence

Delivery Hero needed to identify similar or duplicate product titles across its own and competitor catalogs for pricing, assortment gap analysis, and duplicate detection.

Constraints:

Architecture

Delivery Hero evolved from lexical matching to an SBERT semantic encoder and then to a retrieval-rerank architecture: lexical matching and inverted indexes produce a fast candidate set, a transformer cross-encoder reranks the reduced set with pairwise context, and hard-negative sampling from close-but-not-matching pairs fine-tunes the reranker to distinguish subtle product-title differences.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  A["Input product title"] --> C["Lexical retrieval stage"]
  B["Candidate title set"] --> C
  C --> D["Candidate shortlist"]
  D --> E["Cross-encoder reranker"]
  B --> F["Hard-negative mining"]
  F --> G["Hard-negative training set"]
  G --> E
  E --> H["Matched product output"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Input product title Product title to be matched against a candidate set. Lexical retrieval stage
Candidate title set Inventory or competitor product titles searched for similar matches. Lexical retrieval stage, Hard-negative mining
Lexical retrieval stage Fast first-stage retrieval using word overlap, TF-IDF/BM25, and inverted indexes. Input product title, Candidate title set, Candidate shortlist
Candidate shortlist Reduced list of potential matches passed to the reranker. Lexical retrieval stage, Cross-encoder reranker
Cross-encoder reranker Transformer model that jointly scores product-title pairs for final matching accuracy. Candidate shortlist, Matched product output, Hard-negative training set
Hard-negative mining Finds nonmatching pairs with close embeddings for model fine-tuning. Candidate title set, Hard-negative training set
Hard-negative training set Difficult negative examples used to fine-tune cross-encoder models. Hard-negative mining, Cross-encoder reranker
Matched product output Final similar-product, duplicate, or assortment-gap result. Cross-encoder reranker

Data flow

A product title is matched against an unordered candidate set. Lexical retrieval rapidly narrows candidates using word overlap, TF-IDF/BM25, and inverted indexes. A transformer cross-encoder then jointly scores candidate pairs, and hard negatives mined from embedding-near nonmatches are used to fine-tune the cross-encoder.

3 supporting quotes
“our goal is to take a given product title, referred to as p, and find a corresponding product title within an unordered set”article, stated
“The Retrieval-Rerank approach is a well-established method to enhance accuracy in information retrieval tasks, effectively balancing speed and precision.”article, stated
“For the reranking stage, we employed a transformer-based cross-encoder model.”article, stated

Why this architecture

The final architecture keeps lexical retrieval for efficient candidate generation while reserving the cross-encoder's more expensive pairwise reasoning for a narrowed candidate set.

3 supporting quotes
“The primary objective of the first stage is to narrow down the field of potential matches, given that the second stage is more time-consuming.”article, stated
“This choice was driven by its cost-effectiveness and efficiency, making it well-suited for rapidly processing a large number of documents”article, stated
“the cross-encoder examines pairs of inputs together. This joint processing allows the model to capture the interactions between the texts”article, stated

Models used: SBERT · Transformers-based Large Language Model · transformer-based cross-encoder

Scale

Alternatives considered (roads not taken)

Lexical matching as the full solution

Rejected because: Lexical matching is efficient but fails when semantically equivalent product titles use different words, spellings, sizes, or missing descriptors.

“it assumes that for words in p and t to match, they must be identical. This assumption isn’t always accurate”article, stated

Semantic encoder alone

Rejected because: Encoding titles independently can miss pairwise context and important keywords needed for exact product matching.

“Since each title is encoded independently, these models might miss the nuanced interplay between two pieces of text”article, stated
“certain keywords such as brand names are important for matching and may be missed in the representation.”article, stated

Cross-encoder over the entire candidate set

Rejected because: The cross-encoder is computationally intensive, so it is reserved for a reduced set from retrieval.

“the cross-encoder’s increased computational intensity is precisely why it’s reserved for the second stage”article, stated

Patterns

retrieval-ranking (retrieval)

Delivery Hero uses a two-stage retrieval-rerank pipeline where fast retrieval narrows candidates and a cross-encoder reranks the shortlist.

“This method involves two distinct stages: an initial fast but less precise retrieval phase, followed by a slower, more accurate reranking phase.”article, stated

hybrid-search (retrieval)

The system combines lexical BM25-style retrieval with transformer semantic reranking.

“we opted for the first approach, leveraging Lexical Matching. This choice was driven by its cost-effectiveness and efficiency”article, stated
“For the reranking stage, we employed a transformer-based cross-encoder model. Unlike an encoder-only model, which processes inputs independently and generates embeddings for each, the cross-encoder examines pairs of inputs together.”article, stated

fine-tuning-adaptation (model-adaptation)

Delivery Hero fine-tuned SBERT and cross-encoder models on internal matched/not-matched product-pair data and hard negatives.

“we conducted this fine-tuning process using our own internal dataset. This dataset is composed of pairs of product titles”article, stated
“Once these hard negative samples were identified, we proceeded to fine-tune our cross-encoder models using the hard negative samples.”article, stated

Tradeoffs

Use lexical matching for retrieval.

Chose BM25/inverted-index lexical first stage over semantic cross-encoder scoring for every candidate.

Rationale: Lexical retrieval is fast and cost-effective for candidate generation, while cross-encoding is reserved for a smaller set.

“We can employ an inverted index for rapid searching of matching words. This makes the process highly efficient”article, stated

Use a cross-encoder only after retrieval.

Chose slower pairwise reranking on a reduced candidate set over faster independent embeddings alone.

Rationale: The cross-encoder captures text interactions that independent encoders miss, but its cost requires a narrowed candidate list.

“By combining these two stages, the Retrieval-Rerank approach strikes a balance between operational efficiency and accuracy.”article, stated

Gotchas (what bit them)

Lexical methods miss real matches with different wording.

Root cause: The same product may be represented with different units, spelling variants, or omitted descriptive words.

Resolution: Add semantic encoders and cross-encoder reranking to capture meaning and pairwise context.

“This assumption isn’t always accurate, as the same product can be described using different terms. Here are some examples to illustrate this point:”article, stated

Independent embeddings can lose important pairwise distinctions.

Root cause: Sentence encoders encode each title separately and compress details into a limited embedding.

Resolution: Use a cross-encoder reranker on a smaller candidate set for joint pair processing.

“Due to the limited size of embedding, the Encoder focuses on high-level semantic representation rather than certain keywords.”article, stated

Hard negatives can look semantically close without being true matches.

Root cause: Nonmatching product pairs can have embeddings above a similarity threshold.

Resolution: Mine those close nonmatches and use them to fine-tune the cross-encoder.

“These pairs are considered ‘hard negatives’ because, despite their lack of a direct match, their embeddings suggest a high degree of similarity”article, stated

Evaluation

Delivery Hero evaluates product matching by comparing lexical, semantic encoder, and retrieval-rerank approaches on labeled product-title pairs, including hard negatives mined from close embeddings.

Metrics: product-pair match labels · embedding similarity threshold · candidate retrieval quality · reranker accuracy

“This dataset is composed of pairs of product titles, each pair labelled as either ‘matched‘ or ‘not-matched‘.”article, stated
“finding pairs of data that are not matches (from the labels), yet possess embeddings that are surprisingly close to each other”article, stated

Outcomes

The article does not publish catalog size, latency, or offline accuracy numbers.

“This technology not only enables us to develop more informed pricing strategies but also helps us understand the differences in product variety”article, stated
“This comprehensive strategy, augmented by hard negative sampling, ensures our ability to effectively identify similar products”article, stated