Compatibility Challenges in Recommendation System

Moeka S17 Jan 2025

Problem

ManoMano sells DIY and home-improvement goods, where items must match on dimensions, voltage or fittings. Its "Often Bought Together" widget suggests complementary products from user behavior. A wrong suggestion sends the customer an item that does not fit, such as a mattress for another bed size. Co-purchase data cannot prevent this: it is missing for new or rare products, and some co-purchases are random.

Example from the article: a user buys an adult bed and a baby mattress together for personal reasons, so the pair looks "compatible" in the history although the sizes differ.

Solution in brief

Treat co-purchases as a noisy signal and learn compatibility from product text. Pairs bought together at least N times are positives. Negatives are random products from complementary categories, plus recommended items that were never clicked. A sentence-embedding model is fine-tuned on these pairs with a contrastive loss weighted by purchase counts. The resulting score filters wrong recommendations and proposes candidates for items with no history.

Questions this case answers
  • How to filter complementary-item recommendations that violate hard attribute constraints when co-purchase signals are noisy and absent for new items
  • How to train a pairwise compatibility scorer from implicit co-purchase data when true negatives are not observed
  • How to stop recommending complementary products that do not fit the item the customer is buying (wrong size, voltage, fitting)?
  • How to get compatible recommendations for new or rare products that have no purchase history?

Tools and methods

  • Association rules — find complementary category pairs and attribute rules such as "bed and mattress: same length and width".
  • Sentence Transformers — fine-tune a sentence-embedding model (sentence-camembert-base) on labeled product pairs.
  • Weighted contrastive loss — pulls compatible pairs together, pushes others apart, penalizes errors more on pairs bought by many users.
  • Hugging Face — library used for fine-tuning.
Continue reading — it's free

Google or a one-time email code. No password.