Search is one of the most important features in e-commerce, directly driving customer engagement and business growth. A good product search system must show both relevant and desirable results. However, retail search presents unique challenges. User intent can range from exact matches to open-ended discovery. Search systems must also balance multiple goals, such as relevance, revenue, and profit, while keeping response times low. Traditional keyword-based methods often fall short in handling natural language or semantic queries. Vector search helps alleviate these issues, but it can miss key intent signals or return low-precision results. In this paper, we present the design of a hybrid search system at Target that combines lexical and vector search. We describe our approach to data processing, embedding training, precision control for the final result set, multi-channel result fusion (where we compared fusion strategies and adopted weighted interleaving), and the performance optimizations used to maintain low latency for production deployment. Our method improves offline evaluation metrics, and in online A/B testing it raised click-through rate by 0.97%, order conversion by 0.98%, and demand per visitor by 1.10% over lexical-only search, while roughly halving zero-result searches. The resulting system is deployed at scale and serves millions of guests daily.
Figures & tables
Figure 1. Hybrid search architecture. The indexing pipeline (left) embeds catalog items and builds the vector index. At query time, lexical and vector retrieval run in parallel, and precision control filters the vector results (center). Both result sets then go to ranking (right). Block diagram. Queries enter a search service, which calls three components in parallel: the embedding service, vector precision control, and lexical search parameters. The query embedding and precision filters are applied to an AlloyDB vector index to produce the semantic result set. The lexical parameters query a Solr index to produce the lexical result set. Both result sets return to the search service, which calls the ranking service. On the left, an indexing pipeline embeds items from the item database and builds the ANN index in AlloyDB.
Model
Average NDCG
bert-base
0.6298
msmarco-distilbert-cos-v5
0.7510
msmarco-bert-base-dot-v5
0.7626
all-MiniLM-L6-v2
0.7703
all-mpnet-base-v2
0.7707
e5-small-v2
0.7757
Table 1. Zero-shot NDCG of pretrained encoders on the human-labeled benchmark (5,000 queries, 200 candidates each), averaged over queries. We selected e5-small-v2 for fine-tuning.
Figure 2. Architecture of the real-time embedding service. A front-end application server (left) receives queries from the load balancer, performs preprocessing, and manages business logic. It communicates with a back-end model server (right) running the embedding model (via TorchServe). A caching layer intermediates between the two to store and retrieve frequently used embeddings. The model server supports standard inference protocols and can adaptively batch requests to optimize throughput. System architecture diagram showing a front-end application server connected to a back-end embedding model server through a caching layer. The front-end receives queries from a load balancer, performs preprocessing and business logic, and sends requests for embeddings. The back-end runs the model through TorchServe and supports inference and adaptive batching. The cache stores and retrieves frequently used embeddings between the two servers.
Data Variant
NDCG @1
NDCG @5
NDCG @8
NDCG @24
MRR
7M Data
0.8005
0.8200
0.8290
0.8720
0.9473
20M Data
0.8465
0.8661
0.8744
0.9071
0.9760
20M Data +
Stratified Sampling
0.8459
0.8664
0.8752
0.9077
0.9761
20M Data +
Stratified Sampling +
Table 2. Ablation over training data. Each row adds one change to the data pipeline. All rows use the improved contrastive loss and the four base product fields. Bold marks the best value in each column.
Model Variant
NDCG @1
NDCG @5
NDCG @8
NDCG @24
MRR
InfoNCE Loss
(1 epoch)
0.7503
0.7621
0.7815
0.8628
0.9201
Improved Contrastive Loss
(1 epoch)
0.7870
0.7957
0.8123
0.8825
0.9469
Improved Contrastive Loss
+ Field Tokens
0.8528
0.8718
0.8799
0.9113
0.9786
Table 3. Ablation over the training objective and product representation. Rows 1 and 2 compare losses after one epoch. Rows 3 and 4 use full training and add changes cumulatively. Row 4 is the configuration deployed as Finetuned v2. Bold marks the best value in each column.
Filter Setting
P@1
P@3
P@5
P@8
P@10
No Filters
0.890
0.878
0.863
0.847
0.836
NER Filters
0.914
0.896
0.882
0.866
0.857
NER + Behavior Filters
0.929
0.920
0.904
0.890
0.885
Table 4. Effect of precision control filters on the precision of vector retrieval. NER filters enforce attributes stated in the query (gender, size, brand). Behavior filters add constraints predicted by the query classifier (item type, category). Bold marks the best value in each column.
Model Variant
CTR (%)
ATC/ Visitor (%)
Order Conv. (%)
Demand/ Visitor (%)
Relevancy (%)
Pretrained
−4.20
−6.20
−6.57
−7.14
−3.81
Finetuned v1 (RRF)
−0.85
+1.25
−1.20
+0.49
−0.67
Finetuned v1 (Interleaving)
+0.40
+0.44
+0.74
+1.11
+0.13
Finetuned v2 (Interleaving)
+0.97
+0.89
+0.98
+1.10
+0.21
Table 5. Online A/B test results as relative lift (%) over the lexical search baseline. Each experiment ran for 4 weeks on live traffic. All results are statistically significant at p<0.05 . Bold marks the deployed variant.
Performance Plus Oversized Bath Towel Tan – Threshold™: 100% Cotton
something to keep my feet warm during winter
Costway Foot & Calf Massager – Deep Kneading Shiatsu Massager Machine with Heat
easy meals to make in an air fryer
Frozen Chicken and Vegetable Potstickers – 12oz – Good & Gather™
yoge mat
Yoga Mat 3mm Teal – All In Motion™: Non-Slip PVC, Solid Pattern
Table 6. Top retrieved item for example queries covering synonyms ( spice , big towels ), natural-language queries ( keep my feet warm , easy meals ), and a misspelling ( yoge ).
Traditional search systems are optimized to retrieve items that strictly match a query, often prioritizing precision over recall. In e-commerce marketplaces and particularly grocery, this paradigm is limiting, as user satisfaction and commercial outcomes depend heavily on the discoverability of substitute, complementary, and thematically related items. In this paper, we present a scalable system for discovery-augmented search that leverages intent-conditioned recall expansion. Our approach generates implicit user intents to expand candidate recall while maintaining relevance. The system addresses the cost-quality tradeoff of generative retrieval through a two-stage hybrid architecture. First, we leverage closed-weight large language models (LLMs) to maximize discoverability for head queries. To extend these benefits to tail queries, we then introduce a finetuned small language model (SLM), trained via LoRA adapters and teacher-student distillation. We evaluate the system using a rigorous dual framework: (a) LLM-as-a-judge metrics validated against human preferences for semantic quality, and (b) end-to-end session-level purchase analysis. Results demonstrate that our approach improves both intent generation quality and downstream retrieval effectiveness, extending discovery coverage from approximately 60% to 80% of query traffic at roughly 30% of the teacher model's inference cost, offering a viable path for deployment in large-scale marketplaces. Beyond relevance gains, discovery-augmented search may serve as a marketplace-balancing mechanism, giving long-tail and emerging supply an opportunity for query-conditioned exposure.
Ji Xin, Xiao Xiao, Ishan Bhatt +6
Instacart Toronto, Canada · Instacart San Diego, USA · Instacart San Francisco, USA +1
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.
Multi-merchant e-commerce catalogs contain equivalent and related products under different merchant-scoped identifiers, fragmenting behavioral evidence across merchants. Expert-defined taxonomies, meanwhile, are often too coarse for fine-grained discovery. We investigate whether a single hierarchical Semantic ID (\sid{}) representation can support personalized ranking and query reformulation. Learned once from product-content embeddings, the hierarchy defines product concepts at multiple granularities that each application combines with its own behavioral and serving context. For ranking, we aggregate consumer affinity and product performance over \sid{} prefixes and derive sequence features for candidate products and consumer histories. Controlled ablations show improved offline relevance, while online evaluation of the full ranking treatment shows stronger top-slot add-to-cart engagement and broader exposure for less-popular products. For query reformulation, we ground queries and session transitions in \sid{} concepts, use the hierarchy for navigation and refinement, and filter suggestions against the merchant's assortment. Offline evaluation shows finer intent preservation than taxonomy and higher-quality suggestions than raw query-string transitions; online evaluation shows reduced search effort and earlier access to purchasable products. These results show that a shared semantic product hierarchy can support both recommendation and search while preserving the task-specific context required by each application.