Building Price Prediction and Similar Item Search Models for E-commerce

ebay · E-commerce · 2024 · source Agentic: no · promotional bias: low · summary-only (no fetched source) · extracted with prompt 0.5.5 (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 price guidance and similar-item retrieval

eBay needed to help sellers price second-hand and niche products, especially sports trading cards, where ordinary keyword search fails because titles contain abbreviations, slang, domain terminology, item condition, quantity, player, year, rarity, and grading details that strongly affect value.

Constraints:

Architecture

eBay built an embedding-based retrieval and price-guidance system rather than a generative LLM agent. Product titles are encoded with a custom BERT-style encoder into dense vectors. Historically sold items are stored in a vector database, and new seller listings run k-nearest-neighbor search to retrieve comparable sold items for pricing guidance. Training uses contrastive pairs mined from user search sessions and clicks, in-batch negatives, hard negatives based on similar-looking but different-priced items, and a multi-task architecture that alternates semantic-similarity and price-prediction objectives. A tunable alpha controls the position on the semantic-trust versus price-accuracy curve.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  seller-listing-form["Seller listing form"] --> title-embedding-service["Title embedding service"]
  historical-sold-listings["Historical sold listings"] --> vector-database["Vector database"]
  title-embedding-service --> vector-database
  vector-database --> knn-retrieval-service["KNN retrieval service"]
  knn-retrieval-service --> price-guidance-experience["Price guidance experience"]
  user-behavior-logs["User behavior logs"] --> training-pair-generator["Training-pair generator"]
  historical-sold-listings --> training-pair-generator
  training-pair-generator --> multi-task-training-pipeline["Multi-task training pipeline"]
  negative-sampler["Negative sampler"] --> multi-task-training-pipeline
  multi-task-training-pipeline --> title-embedding-service
  evaluation-set["Evaluation set"] --> trade-off-selector["Trade-off selector"]
  trade-off-selector --> title-embedding-service
  multi-task-training-pipeline --> trade-off-selector
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Seller listing form Entry point where sellers provide title, item specifics, and price information. Title embedding service
Title embedding service BERT-based encoder that converts product titles into dense vector representations. Vector database, Multi-task training pipeline
Historical sold listings Corpus of completed sales used both for retrieval candidates and training/evaluation. Vector database, Training-pair generator
Vector database Storage and search layer for vectors representing historically sold items. KNN retrieval service
KNN retrieval service Nearest-neighbor lookup used to find comparable sold products for a new listing. Price guidance experience
Price guidance experience Seller-facing guidance that can show comparable sales or a specific recommended price. —
User behavior logs Search sessions and click behavior used to infer positive training pairs. Training-pair generator
Training-pair generator Creates positive pairs from clicked items and validates them with price and structured-data checks. Multi-task training pipeline
Negative sampler Provides in-batch negatives and hard negatives to teach fine-grained distinctions. Multi-task training pipeline
Multi-task training pipeline Shared-weight model training that alternates semantic similarity and price prediction objectives. Title embedding service, Trade-off selector
Trade-off selector Alpha-controlled business choice between lower pricing error and better semantic/player matching. Title embedding service
Evaluation set Thousands of test samples used to measure MAE and semantic matching errors. Trade-off selector

Data flow

The pipeline starts with historical sold listings and user behavior data. Search sessions with specific queries and multiple clicked items generate positive item pairs; batch construction supplies in-batch negatives; hard negative mining finds items that appear similar but differ on price-relevant attributes. A BERT encoder is trained on semantic similarity and price prediction objectives. At serving time, a seller's listing title is embedded, KNN search retrieves similar sold items from the vector database, and the product experience can show comparable sales or a recommended price.

5 supporting quotes
“The system takes a product title, passes it through an embedding model to generate a dense vector representation”summary, stated
“product title, passes it through an embedding model to generate a dense vector representation, stores all historically-sold items as vectors in a vector database, and when a seller creates a new listing, performs a k-nearest neighbors (KNN) search to find similar previously-sold products.”summary, stated
“database, and when a seller creates a new listing, performs a k-nearest neighbors (KNN) search to find similar previously-sold products. These similar items are then shown to sellers as pricing guidance, either as a specific recommended price or as examples of comparable sales. The key advantage”summary, stated
“pairs (items that should have similar embeddings), the team leverages user behavior data: • They analyze user search sessions on eBay • They look for queries with at least 6 words (indicating specific intent) • When users click on multiple items from the”summary, stated
“When users click on multiple items from the same search, those items are treated as similar • Additional validation rules ensure similarity: similar prices, matching structured data (e.g., same player name) ### Negative Sampling Strategy For negative”summary, stated

Why this architecture

Dense embeddings were chosen because the domain contains abbreviations and semantic equivalences that keyword search cannot reliably match. Custom BERT training was preferred over off-the-shelf embeddings because eBay had domain data and compute. Multi-task learning was added because the team found that optimizing only semantic similarity preserved trust but hurt price accuracy, while optimizing only price improved MAE but could retrieve semantically confusing comparisons.

4 supporting quotes
“Traditional keyword search fails because collectors use abbreviated terms, slang, and domain-specific terminology”summary, stated
“off-the-shelf embedding models trained on general text perform significantly worse than domain-specific models trained on eBay's data”summary, stated
“## The Semantic Similarity vs. Pricing Accuracy Trade-off A central finding of this work is a fundamental tension between semantic similarity and pricing accuracy. The team experimented with two distinct approaches: Approach 1: Semantic Similarity (Siamese Networks) Training the model”summary, stated
“and downstream task performance (pricing accuracy) • Multi-task learning provides a principled way to navigate this trade-off and select a model appropriate for specific business needs • Trust and explainability matter: showing users semantically similar items, even if slightly less accurate”summary, stated

Models used: BERT-based transformer encoder · Siamese semantic similarity model · Title-to-price prediction transformer · Multi-task shared-weight model

Scale

Alternatives considered (roads not taken)

Traditional keyword search over listing titles.

Rejected because: It cannot handle sports-card abbreviations, slang, and domain-specific equivalences such as RC/Rookie Card or signed/auto.

3 supporting quotes
“Traditional keyword search fails because collectors use abbreviated terms, slang, and domain-specific terminology”summary, stated
“"RC" means "Rookie Card" - a semantic embedding model can learn these equivalences while keyword search fails. Similarly, "signed" and "auto" (for autograph) represent the same concept. ## Training the Embedding Model The team uses BERT-based transformer”summary, stated
“semantic embedding model can learn these equivalences while keyword search fails. Similarly, "signed" and "auto" (for autograph) represent the same concept. ## Training the Embedding Model The team uses BERT-based transformer models (specifically encoder-only architectures) for”summary, stated

Off-the-shelf general embedding models.

Rejected because: Domain-specific models trained on eBay data performed substantially better when training data and GPU resources were available.

“off-the-shelf embedding models trained on general text perform significantly worse than domain-specific models trained on eBay's data”summary, stated
“models trained on eBay's data. When you have the GPU resources and sufficient training data, custom training yields substantially better results. ### Generating Training Data The training approach uses contrastive learning with pairs of similar items. To generate positive”summary, stated

Soft random negatives only.

Rejected because: Random negatives did not teach pricing-relevant fine-grained distinctions, so hard negatives were mined from similar-looking but differently priced cards.

3 supporting quotes
“"soft negatives" (random negatives) aren't sufficient for learning fine-grained distinctions. They implemented hard negative mining: finding items that appear similar but have different prices. For example, cards featuring the same player from the same team”summary, stated
“They implemented hard negative mining: finding items that appear similar but have different prices. For example, cards featuring the same player from the same team but with different grades or conditions. This forces the model to learn the nuanced attributes”summary, stated
“same team but with different grades or conditions. This forces the model to learn the nuanced attributes that actually affect pricing. ## The Semantic Similarity vs. Pricing Accuracy Trade-off A central finding of this work is a fundamental tension between semantic similarity and pricing accuracy.”summary, stated

Pure semantic-similarity Siamese training.

Rejected because: It retrieved semantically similar items but missed pricing-relevant nuances such as quantity differences that strongly affect price.

3 supporting quotes
“Approach 1: Semantic Similarity (Siamese Networks) Training the model purely on semantic similarity using contrastive learning. This produces embeddings where semantically similar items cluster together. However, when evaluated, they found cases where very similar items had vastly different”summary, stated
“very similar items had vastly different prices because the model missed pricing-relevant nuances. For example, "lot of 12" boxes versus "lot of 3" boxes - semantically similar, but 4x different quantity significantly affects price. Approach 2: Title-to-Price”summary, stated
“"lot of 12" boxes versus "lot of 3" boxes - semantically similar, but 4x different quantity significantly affects price”summary, stated

Direct title-to-price prediction only.

Rejected because: It improved MAE but could recommend visually and semantically unrelated cards, harming seller trust.

3 supporting quotes
“embeddings from the CLS token of the final layer. This produces embeddings that cluster items by price regardless of semantic content. While this improved pricing accuracy (Mean Absolute Error of 29 vs 38 for semantic similarity), it created a trust problem: the model might recommend pricing a”summary, stated
“this improved pricing accuracy (Mean Absolute Error of 29 vs 38 for semantic similarity), it created a trust problem: the model might recommend pricing a LeBron James card based on a Stephen Curry card simply because they happened to sell”summary, stated
“recommend pricing a LeBron James card based on a Stephen Curry card simply because they happened to sell at similar prices”summary, stated

Patterns

rag-retrieval (retrieval)

eBay retrieves comparable historically sold items from a vector database to ground seller price guidance in actual sales.

3 supporting quotes
“stores all historically-sold items as vectors in a vector database”summary, stated
“performs a k-nearest neighbors (KNN) search to find similar previously-sold products”summary, stated
“These similar items are then shown to sellers as pricing guidance”summary, stated

retrieval-ranking (retrieval)

The system tunes embedding objectives so retrieved comparisons rank well for both semantic match and price relevance.

“A hyperparameter (alpha) controls the relative emphasis on each objective”summary, stated
“This allows choosing a model position along the trade-off curve based on business requirements”summary, stated

fine-tuning-adaptation (model_adaptation)

The team trains BERT-based domain-specific embeddings on eBay behavior and listing data instead of using generic encoders.

3 supporting quotes
“The team uses BERT-based transformer models (specifically encoder-only architectures) for generating embeddings”summary, stated
“A critical insight from their experience is that off-the-shelf embedding models trained on general text perform significantly worse than domain-specific models trained on eBay's data.”summary, stated
“When you have the GPU resources and sufficient training data, custom training yields substantially better results.”summary, stated

data-quality-loop (training_data)

User searches, clicks, price checks, structured-data checks, in-batch negatives, and hard negatives are used to convert marketplace behavior into training signal.

3 supporting quotes
“To generate positive pairs (items that should have similar embeddings), the team leverages user behavior data”summary, stated
“Additional validation rules ensure similarity: similar prices, matching structured data”summary, stated
“They implemented hard negative mining: finding items that appear similar but have different prices. For example, cards featuring the same player from the same team but with different grades or conditions.”summary, stated

eval-driven-development (evaluation)

The team compares semantic similarity and title-to-price objectives on thousands of samples using MAE and semantic error behavior.

3 supporting quotes
“The team conducted rigorous evaluation on thousands of test samples”summary, stated
“• Title-to-Price approach: MAE of $29 • Semantic Similarity approach: MAE of $38 • However, semantic similarity had far fewer errors in identifying the correct player, maintaining user trust ## Multi-Task Learning Solution To address this trade-off, the team developed a multi-task learning archit”summary, stated
“The team conducted rigorous evaluation on thousands of test samples: • Title-to-Price approach: MAE of $29 • Semantic Similarity approach: MAE of $38 • However, semantic similarity had far fewer errors in identifying the correct player, maintaining user trust ## Multi-Task Learning Solution To”summary, stated

Tradeoffs

Use dense embedding retrieval for seller price guidance.

Chose Custom vector retrieval over historical sales over Keyword search over listing titles.

Rationale: Dense embeddings can learn domain equivalences and retrieve comparable sold items even when sellers use abbreviations or slang.

3 supporting quotes
“The key advantage of dense embeddings over traditional text search is handling domain-specific variations”summary, stated
“For example, in sports cards, "RC" means "Rookie Card" - a semantic embedding model can learn these equivalences while keyword search fails.”summary, stated
“Similarly, "signed" and "auto" (for autograph) represent the same concept. ## Training the Embedding Model The team uses BERT-based transformer models (specifically encoder-only architectures) for generating embeddings.”summary, stated

Train eBay-domain embeddings.

Chose Custom BERT-based encoders trained on marketplace data over Off-the-shelf general embeddings.

Rationale: eBay's domain-specific language and available behavior data made custom training more effective.

3 supporting quotes
“off-the-shelf embedding models trained on general text perform significantly worse”summary, stated
“A critical insight from their experience is that off-the-shelf embedding models trained on general text perform significantly worse than domain-specific models trained on eBay's data.”summary, stated
“When you have the GPU resources and sufficient training data, custom training yields substantially better results.”summary, stated

Use click behavior as training-pair signal.

Chose Search-session click pairs with validation rules over Manually labeled item similarity pairs only.

Rationale: User behavior supplies scalable weak supervision, while price and structured-data checks filter the pairs for real similarity.

3 supporting quotes
“learning with pairs of similar items. To generate positive pairs (items that should have similar embeddings), the team leverages user behavior data: • They analyze user search sessions on eBay • They look for queries with at least 6 words (indicating specific intent) • When users click on”summary, stated
“When users click on multiple items from the same search, those items are treated as similar”summary, stated
“Additional validation rules ensure similarity: similar prices, matching structured data”summary, stated

Add hard negative mining.

Chose Similar-looking but differently priced negatives over In-batch random negatives alone.

Rationale: Hard negatives teach the model the nuanced pricing attributes that random negatives do not expose.

3 supporting quotes
“With batch sizes of 64, each positive pair gets 63 implicit negative examples "for free."”summary, stated
“"soft negatives" (random negatives) aren't sufficient for learning fine-grained distinctions”summary, stated
“This forces the model to learn the nuanced attributes that actually affect pricing”summary, stated

Use multi-task learning to navigate trust versus price accuracy.

Chose Shared model with semantic and price objectives plus alpha tuning over A single semantic-only or price-only objective.

Rationale: Multi-task learning allows stakeholders to decide how much MAE improvement is worth versus semantic matching errors.

3 supporting quotes
“• Shared weights across the network • Alternating between semantic similarity and price prediction during training • A hyperparameter (alpha) controls the relative emphasis on each objective • This allows choosing a model position along the trade-off curve based on business requirements The exp”summary, stated
“Alternating between semantic similarity and price prediction during training”summary, stated
“A hyperparameter (alpha) controls the relative emphasis on each objective”summary, stated

Gotchas (what bit them)

Semantic similarity alone can miss price-changing attributes.

Root cause: Two listings can look textually similar while differing in quantity, grade, rarity, or condition enough to change price substantially.

Resolution: Introduce hard negatives and multi-task price prediction so the embedding space learns pricing-relevant distinctions.

3 supporting quotes
“However, when evaluated, they found cases where very similar items had vastly different prices because the model missed pricing-relevant nuances.”summary, stated
“"lot of 12" boxes versus "lot of 3" boxes - semantically similar, but 4x different quantity significantly affects price”summary, stated
“hard negative mining: finding items that appear similar but have different prices”summary, stated

Price prediction alone can create untrusted recommendations.

Root cause: Embeddings optimized for price can cluster unrelated items that sold for similar amounts.

Resolution: Keep semantic-matching quality in the objective and tune the alpha trade-off rather than optimizing MAE alone.

3 supporting quotes
“This produces embeddings that cluster items by price regardless of semantic content. While this improved pricing accuracy (Mean Absolute Error of 29 vs 38 for semantic similarity), it created a trust problem:”summary, stated
“semantic content. While this improved pricing accuracy (Mean Absolute Error of 29 vs 38 for semantic similarity), it created a trust problem: the model might recommend pricing a LeBron James card based on a Stephen Curry card simply because they happened to sell at similar prices - visually and”summary, stated
“The multi-task learning approach allows business stakeholders to choose the appropriate trade-off point based on user trust requirements”summary, stated

General embeddings underperform on domain-specific marketplace language.

Root cause: Sports-card titles use abbreviations, slang, and domain-specific terminology not captured well by general text encoders.

Resolution: Train custom BERT-based embeddings on eBay domain data when sufficient data and compute are available.

3 supporting quotes
“domain is filled with specialized terminology, abbreviations, and slang that make text search ineffective”summary, stated
“off-the-shelf embedding models trained on general text perform significantly worse”summary, stated
“When you have the GPU resources and sufficient training data, custom training yields substantially better results”summary, stated

Random negatives are too easy for fine-grained pricing distinctions.

Root cause: Random in-batch negatives are usually unrelated, so they do not force the model to learn subtle attributes that separate similar cards.

Resolution: Mine hard negatives that appear similar but differ in price-relevant attributes such as grade or condition.

3 supporting quotes
“With batch sizes of 64, each positive pair gets 63 implicit negative examples "for free." This approach is computationally efficient and generally effective since random items are unlikely to be similar.”summary, stated
“"soft negatives" (random negatives) aren't sufficient for learning fine-grained distinctions”summary, stated
“cards featuring the same player from the same team but with different grades or conditions”summary, stated

Evaluation

The team evaluates semantic similarity and title-to-price approaches on thousands of test samples, using MAE for pricing accuracy and semantic/player matching errors for seller trust. It then studies how alpha shifts the multi-task model along the trade-off curve.

Metrics: Mean Absolute Error for title-to-price prediction · Mean Absolute Error for semantic similarity retrieval · Correct-player or semantic matching errors · Trade-off curve as alpha moves between objectives · KNN retrieval quality over comparable sold items

5 supporting quotes
“The team conducted rigorous evaluation on thousands of test samples”summary, stated
“• Title-to-Price approach: MAE of $29 • Semantic Similarity approach: MAE of $38 • However, semantic similarity had far fewer errors in identifying the correct player, maintaining user trust ## Multi-Task Learning Solution To address this trade-off, the team developed a multi-task learning archit”summary, stated
“The team conducted rigorous evaluation on thousands of test samples: • Title-to-Price approach: MAE of $29 • Semantic Similarity approach: MAE of $38 • However, semantic similarity had far fewer errors in identifying the correct player, maintaining user trust ## Multi-Task Learning Solution To”summary, stated
“semantic similarity had far fewer errors in identifying the correct player”summary, stated
“as alpha shifts toward price prediction, MAE decreases but semantic matching errors (wrong player identification) increase”summary, stated

Outcomes

The summary reports eBay scale at about 2 billion listings, more than 130 million active buyers, and 190 marketplace sites. The retrieval path must encode millions of historical listings and support efficient KNN search; the training/evaluation path uses thousands of test samples, batches of 64 with 63 in-batch negatives, and MAE comparisons of 29 versus 38.

5 supporting quotes
“helping sellers determine appropriate prices for their items using machine learning and embedding-based retrieval systems”summary, stated
“A critical insight from their experience is that off-the-shelf embedding models trained on general text perform significantly worse than domain-specific models trained on eBay's data.”summary, stated
“Hard negative mining significantly improves model sensitivity to pricing-relevant features”summary, stated
“While this improved pricing accuracy (Mean Absolute Error of 29 vs 38 for semantic similarity), it created a trust problem:”summary, stated
“developed a multi-task learning architecture that trains on both objectives simultaneously”summary, stated