π€ AI Summary
This work addresses the keyword sparsity problem in e-commerce recommendation arising from lexical mismatches between usersβ natural language intents and item metadata. To this end, the authors formulate content-based recommendation as a dense retrieval task and propose an end-to-end reproducible, domain-adaptive dual-tower semantic matching architecture. The encoders are jointly fine-tuned via supervised contrastive learning and multi-negative ranking loss. For efficient CPU deployment, the system integrates FAISS HNSW indexing, ONNX Runtime, and INT8 dynamic quantization. Evaluated on a dataset comprising 826,402 items, the approach improves Recall@10 from 0.26 (BM25 baseline) to 0.66, reduces model size to one-quarter of the original, and achieves a median inference latency of only 6.1 milliseconds.
π Abstract
E-commerce recommendation and search commonly rely on sparse keyword matching (e.g., BM25), which breaks down under vocabulary mismatch when user intent has limited lexical overlap with product metadata. We cast content-based recommendation as recommendation-as-retrieval: given a natural-language intent signal (a query or review), retrieve the top-K most relevant items from a large catalog via semantic similarity. We present a scalable dense retrieval system based on a two-tower bi-encoder, fine-tuned on the Amazon Reviews 2023 (Fashion) subset using supervised contrastive learning with Multiple Negatives Ranking Loss. We construct training pairs from review text (as a query proxy) and item metadata (as the positive document) and fine-tune on 50,000 sampled interactions with a maximum sequence length of 500 tokens. For efficient serving, we combine FAISS HNSW indexing with an ONNX Runtime inference pipeline using INT8 dynamic quantization. On a review-to-title benchmark over 826,402 catalog items, our approach improves Recall@10 from 0.26 (BM25) to 0.66, while meeting practical latency and model-size constraints: 6.1 ms median CPU inference latency (batch size 1) and a 4x reduction in model size. Overall, we provide an end-to-end, reproducible blueprint for taking domain-adapted dense retrieval from offline training to CPU-efficient serving at catalog scale.