arXiv:2611.06323cs.IRNov 2026

Manuscript Offprint

arXiv:2611.06323

Generative Retrieval under Real-Time Supply Constraints in Local Commerce

Shaopeng Liang, Biao Zhang, Hongzhen Ye, Zeyang Hou, Ma Jiang, Jintao Tu, yunxi. hz, Zhijia Fang, Jianqiang Cao, Junxue Rao, Jia Jia

Abstract

Generative retrieval predicts semantic identifiers for candidate entities, offering a learned alternative to conventional candidate lookup. In local retail and food delivery, those candidates must also be serviceable for a particular user at a particular time. Location, weather, and traffic reshape available merchant and product supply, so a catalog-valid identifier may be infeasible for the current request. Post-generation filtering removes such candidates after beam capacity and inference computation have already been spent. We study generative retrieval over an explicitly materialized, request-time supply snapshot. This setting puts constraint preparation on the online serving path, where short output sequences provide little opportunity to amortize compilation and transfer. We present a pipeline integrated into RTP-LLM that compiles eligible residual-quantization identifiers into a compressed sparse row prefix index, overlaps CPU compilation with model prefill, and shares the uploaded index across beams. Legal expansions retain original-model log probabilities, and constraint states follow selected beam parents. We formalize snapshot-relative identifier validity and distinguish it from entity-level eligibility and freshness. The examined implementation generates three-token merchant identifiers. We analyze historical evidence from daily catalog constraints and subsequent request-scoped serving evaluations. In a matched-beam daily-constraint case, merchant filtering falls from 170 of 299 candidates to 29 of 299, while residual distance filtering motivates request-specific supply constraints. Later records report approximately 3 ms for C++ sorting and 1 ms for CSR construction. A different-host historical comparison with 30,000 supplied entries reports a 0.6 ms service-side latency increment, but broader client measurements expose additional request costs. Captured Base64 requests from three geographic settings further characterize behavior across supply sizes and effective output widths. These observations establish a practical implementation and identify integration bottlenecks; they do not yet establish compute savings at matched retrieval quality. The resulting framework connects changing supply, constrained search, and the cost of producing useful eligible results.

1 Introduction

Generative retrieval is a developing direction in information retrieval and recommendation: a model retrieves an entity by generating its identifier. Work on autoregressive entity retrieval and semantic identifiers has established alternatives to conventional candidate lookup [1, 2]. This direction offers a way to learn candidate generation as a sequence prediction problem. In our setting, residual quantization produces a short semantic identifier (SID), and the retrieval model generates SID tokens using beam search. The opportunity is to apply this learned retrieval mechanism to merchant and product discovery while respecting the supply that is actually available.

A local-commerce retrieval system must answer two questions at once: what is relevant to the user, and what can actually be supplied to that user now? The second question is especially demanding in local retail and food delivery. The user's location determines which merchants can serve the request. Weather and traffic can change delivery feasibility, so the eligible supply may change even when the user, merchant, and product catalog remain unchanged. A retrieval decision that was valid for a nearby user or an earlier request may no longer be valid for the current one. A model trained over a global candidate space does not automatically track these request-time changes.

This mismatch creates two distinct errors. A model may generate an identifier that does not correspond to a catalog entity. It may also generate a valid identifier whose merchant or product cannot serve the current request. We call the latter a supply hallucination: the output refers to real supply, but incorrectly treats it as available in the request's context. This term concerns retrieval eligibility, not the factual accuracy of natural-language text. Preventing catalog-invalid identifiers alone does not prevent supply hallucinations.

Post-generation filtering can remove unavailable candidates before they reach the user. However, it cannot recover the beam slots already spent exploring them. If many high-scoring paths are ineligible, the final candidate set may be too small, prompting wider decoding, additional attempts, or fallback retrieval. These mechanisms consume resources without necessarily improving the set of usable results. The objective is therefore to direct decoding toward currently eligible supply and reduce the computation required to obtain a useful candidate set.

Request-scoped constraints introduce a systems challenge of their own. The eligible set can differ across consecutive requests and may contain tens of thousands of SIDs. Serializing this set, compiling it into a prefix structure, transferring it to an accelerator, and consulting it during beam search all add cost. For a short SID, there are only a few decoding steps over which to amortize preparation. A fast GPU membership test is insufficient if request preparation dominates latency. Moreover, filtering must preserve the intended ranking objective, and the constraint state must remain aligned with each beam as parents are selected, duplicated, or discarded.

We address these issues with a request-scoped constraint pipeline integrated into RTP-LLM. The upstream supply system materializes the eligible SID set. A background CPU task parses, sorts, and compiles that set while the model processes the prompt. Before the first constrained sampling step, the engine waits for the index and uploads it to the GPU. Beams share the immutable index but maintain separate prefix states. Every decoding step masks illegal continuations, compares legal candidates using original-model log probabilities, and propagates the selected parent mapping to both model and constraint state.

Our focus is generative retrieval over dynamically changing merchant and product supply. Constrained decoding is the mechanism that connects this retrieval objective to request-time feasibility. The system treats the changing supply set across request preparation, constrained search, and output resolution, rather than addressing a mask kernel in isolation. CSR storage and probability-preserving masking are established components on which this design builds. This paper makes three concrete contributions:

  1. A formulation of supply-constrained generative retrieval that distinguishes catalog validity, request eligibility, and freshness, and connects these properties to useful retrieval cost.

  2. An implementation of request-time constraint compilation and beam execution, including prefill overlap, shared accelerator indexes, and parent-aligned constraint states.

  3. An empirical account of daily-constraint retrieval cases, request-scoped serving measurements, and captured-request replay, accompanied by validity and score invariants and a cost decomposition that explains the observed bottlenecks.

The business problem includes both merchant and product supply. The implementation examined here uses three-token SIDs for merchant retrieval. The same finite-set formulation can express product eligibility when the corresponding mappings and eligible sets are available; the merchant implementation does not by itself establish a completed product-level deployment.