TL;DR
Search engines usually fetch a fixed number of items (say, the top 1,500) for every query, whether it's a broad term like "gift" or a hyper-specific one like "iPhone 16." This one-size-fits-all cutoff leaves broad queries missing relevant items and specific queries cluttered with junk. pEBR (probabilistic Embedding-Based Retrieval) solves this by replacing standard frequentist training losses with a probabilistic framework that learns a custom item distribution for each query, allowing the system to dynamically set the optimal similarity threshold.
What Problem Does This Paper Address?
In modern e-commerce search and recommendation, two-tower models (like DSSM) embed queries and items into a shared vector space and retrieve matches using cosine similarity. In practice, systems rely on heuristic cutoffs: either a fixed number of items ($k$) or a fixed similarity score threshold.
Both approaches are flawed because queries have wildly different "semantic scopes":
- Head queries (e.g., "phone" or "gift") are broad and have thousands of relevant items. A fixed $k$ cuts off good matches, hurting recall.
- Tail queries (e.g., "Huawei mate50pro" or "iPhone 16") are narrow and have only a few relevant items. A fixed $k$ forces the system to pad the results with irrelevant items, tanking precision.
The root cause is that traditional point-wise and pair-wise loss functions are frequentist—they optimize relative rankings or binary classifications without learning an underlying probability distribution, leaving no principled way to choose a query-specific cutoff.
Methods
The authors propose pEBR, which models the probability of retrieving an item $d$ given a query $q$ as a query-dependent distribution.
- What's standard: The two-tower architecture (a query tower and an item tower) and the InfoNCE contrastive loss framework.
- What's new: Instead of a fixed temperature or frequentist score, pEBR parameterizes the ratio of positive-to-background item distributions using two specific probability distributions:
- ExpNCE: Uses a truncated exponential distribution with a query-dependent temperature $\tau_q$.
- BetaNCE: Maps cosine similarity from $[-1, 1]$ to $[0, 1]$ and models it with a compactly supported Beta distribution, where $\tau_q$ is learned from the query representation.
- Dynamic Cutoff: Once trained, the model uses the Cumulative Distribution Function (CDF) of the learned distribution to set a dynamic cosine similarity threshold for each query.
Datasets
- Offline Training & Evaluation: A randomly sampled dataset of 87 million user click logs collected over 60 days from an e-commerce search engine.
- Online A/B Testing: Deployed in a real-world e-commerce search engine serving hundreds of millions of users and billions of products over a week-long controlled experiment.
Key Insights and Ideas
- Semantic scope is geometric: Projecting relevant items onto a 3D sphere shows that head queries ("phone") scatter widely across the surface, while tail queries ("Huawei mate50pro") cluster tightly. A fixed cutoff ignores this geometry.
- Dynamic retrieval adapts naturally: With a fixed CDF threshold (e.g., 0.985), pEBR automatically retrieves more items for head queries (mostly 500–1,500) and far fewer for tail queries (mostly 0–500), matching their true relevance distributions.
- Model-agnostic: Because pEBR only modifies the loss function, it can be plugged into any two-tower architecture (the authors verify compatibility with both DSSM and transformer-based BGE backbones).
Key Results
- Offline Evaluation: On a stratified evaluation at $k=1500$, pEBR (using BetaNCE) outperformed both
DSSM-topk(fixed number) andDSSM-score(fixed similarity threshold) across all query types. Overall,P@1500jumped from 0.327% (DSSM-topk) and 0.435% (DSSM-score) to 0.583%, whileR@1500improved from 93.29% and 93.64% to 94.08%. - Tail Query Boost: Precision on tail queries saw the biggest relative leap, jumping from 0.126% (
DSSM-topk) to 0.450% (pEBR).
- Online A/B Test: In live production, pEBR delivered a +0.190% relative improvement in User Conversion Rate (UCVR, $p = 0.0183$) and +0.093% in User Click-Through Rate (UCTR, $p = 0.0213$).
Limitations and Future Work
- Architectural constraints: pEBR is inherently tied to two-tower and late-interaction paradigms (like DSSM). It does not address the emerging paradigm of generative retrieval powered by Large Language Models (LLMs).
- Future directions: The authors suggest (1) building hybrid architectures that combine pEBR's probabilistic dynamic cutoffs with the semantic flexibility of generative retrieval, and (2) using adaptive distribution modeling for constrained generation to mitigate LLM hallucinations.
Summary updated