arXiv(opens in a new tab)cs.IROct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.33435

PinGER: Token-Efficient Generative Retrieval with Semantic IDs

Xinyi Li, Sujan Reddy Ale, Yi-Ping Hsu, Zelun Wang, Yilin Chen, Hanyu Li, Hanlin Lu, Arkin Dharawat, Lulu Yao, Yaxin Li, Bella Huang, Xiangyi Chen, Jaewon Yang, Jiajing Xu, Charles Rosenberg

Xinyi Li

xinyi@pinterest.com

Pinterest

Palo Alto, CA, USA

Zelun Wang

zelunwang@pinterest.com

Pinterest

Palo Alto, CA, USA

Hanlin Lu

hanlinlu@pinterest.com

Pinterest

Palo Alto, CA, USA

Yaxin Li

yaxinli@pinterest.com

Pinterest

Palo Alto, CA, USA

Jaewon Yang

jaewonyang@pinterest.com

Pinterest

Palo Alto, CA, USA

Sujan Reddy Ale

sreddyale@pinterest.com

Pinterest

Palo Alto, CA, USA

Yilin Chen

yilinchen@pinterest.com

Pinterest

Palo Alto, CA, USA

Arkin Dharawat

adharawat@pinterest.com

Pinterest

Palo Alto, CA, USA

Bella Huang

shuang@pinterest.com

Pinterest

Palo Alto, CA, USA

Jiajing Xu

jiajing@pinterest.com

Pinterest

Palo Alto, CA, USA

Yi-Ping Hsu

yhsu@pinterest.com

Pinterest

Palo Alto, CA, USA

Hanyu Li

hanyuharryli@pinterest.com

Pinterest

Palo Alto, CA, USA

Lulu Yao

yyao@pinterest.com

Pinterest

Palo Alto, CA, USA

Xiangyi Chen

xiangyichen@pinterest.com

Pinterest

Palo Alto, CA, USA

Charles Rosenberg

crosenberg@pinterest.com

Pinterest

Palo Alto, CA, USA

Abstract

Generative retrieval replaces nearest-neighbor search with token-by-token decoding of an item's semantic ID (SID). But existing SID-based methods primarily use L levels of tokens sequentially to represent each item in the input history. As a result, a fixed context window holds L times fewer items than it would with one embedding per item. We present PinGER, a generative retriever deployed at Pinterest that retains SID outputs while making input histories compact, built on three ideas. (1) An asymmetric attention mask over interleaved SID and dense tokens lets later items attend only to the dense ones, so the model is supervised at every SID position in training yet serves one token per item while computing the same function. (2) Generation is controllable through goal-conditioned outputs, reinforcement learning, and a prefix-diversity penalty, which together steer retrieval toward surface-specific goals and diverse candidates. (3) A serving stack built for efficient wide-beam generation is paired with decoding constrained to valid identifiers and candidate resolution from a host-local index. Deployed in Related Pins, PinGER lifts saves of fresh Pins by 3.60% and overall saves by 0.62%, while reducing the surface's end-to-end latency by 0.7% and eliminating the cost of the nearest-neighbor search it replaces.

CCS Concepts

• Information systems → Recommender systems.

Keywords

Sequential Recommendation, Recommendation System

ACM Reference Format:

Xinyi Li, Sujan Reddy Ale, Yi-Ping Hsu, Zelun Wang, Yilin Chen, Hanyu Li, Hanlin Lu, Arkin Dharawat, Lulu Yao, Yaxin Li, Bella Huang, Xiangyi Chen, Jaewon Yang, Jiajing Xu, and Charles Rosenberg. 2018. PinGER: Token-Efficient Generative Retrieval with Semantic IDs. In Proceedings of XXX (Conference acronym 'XX). ACM, New York, NY, USA, 11 pages. https://doi.org/XXXXXXX.XXXXXXX

1 Introduction

Retrieval is the first stage of an industrial recommender: from a corpus of order 10910^{9} items, it selects the candidates a downstream ranker will score, under a tight latency budget. The dominant approach is two-tower retrieval with approximate nearest neighbor (ANN) search [6]: user and item towers embed both sides in a shared space and retrieval returns the items nearest the user vector, so the two interact only through a final dot product. Since sequential recommenders scale like language models [35], generative retrieval (GR) instead generates the next item as a language model generates the next token [25].

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

Conference acronym 'XX, Woodstock, NY

© 2018 Copyright held by the owner/author(s). Publication rights licensed to ACM. ACM ISBN 978-1-4503-XXXX-X/2018/06 https://doi.org/XXXXXXX.XXXXXXX

Li et al.

(a) Input vs supervision (L = 2)

Problem

(b) Serving cost

Figure

(c) Diversity

Our solution

Figure 1: Three obstacles to efficient SID retrieval (top) and our answers (bottom). s: SID token, e: dense token.

A GR model can represent items in one of two forms. Embedding GR, such as PinRec [3], reads and predicts one dense embedding per item, so a fixed context covers a long history, but it still retrieves through an ANN index. SID GR, introduced by TIGER [25], quantizes each item into a semantic ID (SID) of L discrete codes and generates it with beam search, so the output space can be decoded directly into items and steered during generation. As a result, no ANN index sits on the request path, and a new item is retrievable as soon as it has an SID. Its inputs are costly, however, since every history item takes L tokens, even though history matters: Recall grows by 10% as the training context grows from 1,024 to 6,144 tokens (Section 5.2.1). We ask whether one model can have both, reading history at one token per item while keeping SID outputs, their supervision, and the diversity their output space allows.

Three obstacles stand in the way (Figure 1). The first is that input and supervision pull in opposite directions. In a causal model, every token the model is trained on is also input for every later token. SID tokens give rich supervision, one label per code, but cost L input tokens per item, and compressing them removes the token-level supervision. Naive fixes pick one side: a separate dense encoder and SID decoder loses direct attention to distant history and gets one label per forward pass, while merging each item's SIDs into one token keeps the input short but trains on one label per item instead of L. The second is beam decoding cost. A KV cache avoids recomputing the history [16], but every beam still attends over all of it, so cost grows with beam width, and some beams lead to no matching item. The third is diversity. Because beam scores accumulate over levels, the beams collapse onto a few prefixes (11.9 distinct level-1 codes among 100 beams; Table 3), and temperature sampling, the usual remedy, lowers spread further and produces more SIDs that do not exist in the corpus.

Prior work leaves these obstacles open. On input and supervision, every prior design pays on one side. Deployed SID retrievers keep multi-token SIDs in the input and pay at serving [5, 8, 12, 25, 36], as do methods that restructure SIDs to cut decoding steps [13, 20, 30]; COBRA [33] and GPR [14] add a dense token or a second decoder on top and pay even more. SPARC [22] and ACERec [29] take the other side: they merge each item's SIDs into one input token, so they train on one label per item instead of L. On serving cost, speculative decoding [21, 28] and serving co-design [11] accelerate GR but keep full-model wide-beam decoding, and shared-prefix attention [15] has not been applied to SID beam search. On diversity, no GR work diversifies beam search, so the usual knob remains temperature. Finally, embedding GR and SID GR have never been compared head to head online; the only direct comparison, LIGER [32], is offline.

We address all three with PinGER (Pinterest GEnerative Recommender; Figure 1), which interleaves the two item forms in one causal backbone: in training, each history item contributes its L SID tokens followed by one dense token, and every SID token is a prediction target. An asymmetric attention mask lets SID tokens read the dense history and the shallower codes of their own item, while dense tokens read only earlier dense tokens. No later position ever reads a past SID token, so serving drops them and reads the history at one dense token per item, computing exactly the same function (Section 3.3). In training, sparsity-aware attention kernels compute only the entries the mask permits, so a history costs less attention than in TIGER while supplying the same supervision (Section 3.3.4). The model is thus trained with the full SID supervision of TIGER and served at the input cost of embedding GR. For diversity, a hierarchical prefix penalty selects beams one at a time, charging each candidate by the depth of the prefix it shares with beams already chosen (Section 3.5). For serving, cascade attention reads the shared history once per request rather than once per beam, constrained decoding keeps every beam on an SID that exists, and a host-local index resolves SIDs to items without a network call (Section 4).

We deploy PinGER at Pinterest and evaluate it offline and online. Offline, it matches TIGER's Recall@100 while serving 6× fewer tokens, and at equal serving tokens it exceeds TIGER by 9.5% and the production embedding retriever, PinRec, by 3.9× (Section 5.2). At the deployed penalty, the beams span 7.9× more distinct level-1 prefixes than under greedy decoding (Section 5.2.3). End to end, serving is 18 to 31 ms faster at the median than PinRec at matched load (Section 4.4). Online, replacing PinRec with PinGER on Related Pins raises saves by 0.62% and saves of fresh Pins by 3.60% (Section 5.3). A further analysis shows that PinGER surfaces previously undervalued Pins, breaking the engagement feedback loop of recommender systems.

Our contributions are:

• Decoupling input from supervision. The first role-dependent attention mask for GR: SID tokens are supervised in training but read by no later position, so they cost nothing at serving. Unlike TIGER, which pays L tokens per item, or merged-token models, which train on one label per item, PinGER matches

TIGER at 1/L the serving tokens. Role-dependent masks exist outside GR [10, 34].

• Hierarchy-aware beam diversity. The first diversified beam search for GR: a penalty that grows with shared-prefix depth, exact, with W additions per step in one fused kernel per level.

• Cascade decode for SID retrieval. The first use of shared-prefix attention for SID beam decoding, where reparenting a beam reduces to moving an L-token suffix: 10.9×10.9 \times faster than paged attention at W=30W=30 and 32×32 \times at W=400W=400, with 12.6×12.6 \times less KV memory.

• Online evidence. The first head-to-head online A/B between embedding GR and SID GR, deployed on Related Pins at Pinterest.

References (12)