How we built a product matching system with transformers and LLMs

Viktoria Kosterina, Bogdan Tonanaisky10 Nov 2025

Problem

A retailer needs to know which competitor products correspond to its own, for correct pricing, assortment matrix and competitive position. Product names and card images differ across catalogs, so a competitor can look as if it has no equivalent when it does. There are hundreds of thousands of SKUs with different formats, typos and names that change over time, which makes manual labeling practically impossible.

Example from the article: "Coca-Cola Zero 330ml" and "Koka-Kola zero 0.33 zh/b" are the same product under different names.

Solution in brief

Normalize product titles, embed them with a language model, take the top 5 to 10 nearest competitor candidates per product and filter them by cosine similarity. A compact rubert-tiny2 model fine-tuned with contrastive learning and hard negatives separates look-alike products. The most disputed pairs go to an LLM that returns match, partial or non-match with a confidence and a short explanation.

Questions this case answers
  • How to link records of the same real-world item across two catalogs that use different naming, when the volume is too large for manual labeling and string distance fails
  • How to separate true matches from near-duplicates of a different item in embedding-based candidate search, when the nearest neighbours are all very similar
  • How to match a competitor's product names to our own catalog when the same product is named differently?
  • How to choose a similarity threshold that separates true matches from near-misses in embedding search?

Tools and methods

  • Levenshtein distance (fuzz ratio) — baseline string matching, HitRate@10 about 10%.
  • LaBSE, ruBERT — off-the-shelf embedding models for title vectors.
  • rubert-tiny2 with contrastive learning and hard negatives — the fine-tuned matcher.
  • DeepSeek, Qwen, YandexGPT — LLM validation of disputed pairs.
Continue reading — it's free

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