Semantic retrieval in e-commerce must handle short, noisy, and colloquial queries over large product catalogs with fine-grained attribute distinctions. We present a Siamese LLM dual-encoder trained through a two-stage pipeline: contrastive learning with a false-negative margin mask to prevent penalization of near-duplicate products, followed by Relative Odds Alignment for Retrieval (ROAR), a preference optimization objective that extends Bradley-Terry to variable-sized graded relevance groups via consecutive odds-ratio margins. The training corpus mirrors this progression - substitute query-product pairs provide coarse semantic supervision in Stage 1 and graded relevance annotations drive fine-grained ranking in Stage 2. The resulting system accurately retrieves exact matches while correctly ordering substitutes and complementary products, with gains confirmed across query-frequency strata and business verticals, and statistical significance validated through live A/B deployment at scale.
翻译:电子商务中的语义检索需处理短文本、含噪声及口语化的查询,并在包含细粒度属性区分的大规模产品目录中进行。我们提出了一种孪生大语言模型双编码器,通过两阶段流水线进行训练:第一阶段采用对比学习与假负例间隔掩码,以避免对近重复产品的惩罚;第二阶段引入检索相对优势对齐(ROAR),这是一种偏好优化目标,通过连续比值比间隔将Bradley-Terry模型扩展至可变规模的分级相关性分组。训练语料库与此流水线演进保持一致——替代查询-产品对在第一阶段提供粗粒度语义监督,分级相关性标注在第二阶段驱动细粒度排序。该系统能准确检索精确匹配项,同时正确排序替代品与互补产品,其优势在不同查询频率分层及业务垂直领域均得到验证,并通过大规模在线A/B部署验证了统计显著性。