Problem
Mastercard links records from datasets with no common identifier. The hardest case is merchant enrichment: matching a raw card-transaction descriptor to a merchant in a reference database. The legacy engine used handcrafted rules plus normalized Levenshtein distance. It breaks on aliases (KFC), service-provider prefixes (SQ*), dynamic IDs and truncated store numbers, so coverage is low and false positives are high. A false match is costly: the engine also feeds loyalty and fraud products.
Example from the article: the query "Walmart store" is closer by string similarity to "Walters store" (64.3%) than to the correct "WM Supercenter" (21.4%).
Solution in brief
GAIME (Generative AI Merchant Enrichment) asks whether two strings are the same merchant, not how similar they are. A fine-tuned large language model (LLM) parses the descriptor, vector search plus a LightGBM reranker produce 20 candidates, and an open LLM judge returns a match or "no match". Per-module benchmarks and human review keep false positives low.
Questions this case answers
- How to match noisy text descriptors to canonical reference entities by having an LLM decide same-or-not on retrieved candidates instead of using string similarity
- How to keep false positives low in an LLM-as-a-judge matching pipeline and test changes safely
- How to match noisy transaction descriptors to canonical merchant entities with retrieval and an LLM judge
- How to replace fuzzy string matching for entity resolution when descriptors contain aliases, truncations and payment-facilitator prefixes
Tools and methods
- Entity recognition — Llama 3.1 8B fine-tuned on labeled descriptors; outputs JSON with entity labels
- Candidate retrieval — bge-small-en-v1.5 embeddings, vector search index over the merchant database
- Reranking — LightGBM score model on custom features; 160 candidates cut to the top 20
- LLM-as-a-judge — GPT OSS 120B on a private serving endpoint decides match or no match
- Databricks — Apps, serving endpoints, shared Unity Catalog
Google or a one-time email code. No password.