Generative recommendation (GR) represents items as semantic identifiers (SIDs) and autoregressively generates the next item's SID from interaction history. However, most methods assign the same SID length to all items despite highly unequal interaction frequencies. This uniform design repeatedly incurs the cost of fine-grained codes for popular items, while shortening codes to reduce this cost also compresses the semantic representations of long-tail items. Inspired by the compact forms of frequent expressions in natural language, we propose JevRec to encode items as variable-length words and generate the next item from interaction context. Linguistic encoding retains frequency-dependent semantic prefixes from shared codebooks, producing shorter SIDs for popular items and richer descriptions for long-tail items. Yet predicting a sequence-level length and generating token-level content impose different optimization requirements that may conflict under a shared output head. Our Jev-like decision modeling component therefore predicts a length distribution with a dedicated head and generates content conditioned on length through a separate head while sharing the interaction-history representation. Experiments on three public datasets show that JevRec outperforms all compared baselines across the evaluated recommendation metrics. Further analyses show lower training and inference time than TIGER and reduced gradient conflict between length and content prediction.
Figures & tables
Figure 1. Motivation for frequency-aware SID lengths. (a) Fixed-length codes impose equal representation lengths despite unequal interaction frequencies. (b) The natural-language analogy motivates shorter codes for popular items and richer descriptions for long-tail items. The distribution and code examples are illustrative. Two panels illustrate the motivation. The left panel shows a conceptual long-tailed interaction-frequency curve and equal-length codes for frequent and rare items. The right panel compares short frequent words with longer expressions, then shows item codes whose semantic part grows from popular to long-tail items while retaining an identity token.
Figure 2. Overview of JevRec. (a) Linguistic encoding constructs frequency-dependent SIDs with shared codebooks. (b) Jev-like decision modeling separates length and content prediction, followed by conditional decoding, quota-based selection, and cross-length ranking. The blue blocks in (b) represent complete SIDs; item examples are illustrative. The upper panel encodes item text with shared semantic codebooks, truncates codes by item frequency, and appends a collision token. The lower panel encodes an interaction history and uses separate length and content heads. Length-conditioned branches generate complete SIDs, which map to candidate items before quota-based selection and cross-length ranking.
Instrument
Scientific
Game
Users
57,439
50,985
94,762
Items
24,587
25,848
25,612
Interactions
511,836
412,947
814,586
Sparsity
99.964%
99.969%
99.966%
AvgLen
8.91
8.10
8.60
Table 1. Adopted Amazon Reviews benchmark statistics. AvgLen is the average interaction sequence length.
Methods
Instrument
Scientific
Game
R@5
R@10
N@5
N@10
R@5
R@10
N@5
N@10
R@5
R@10
N@5
N@10
Caser
0.0241
0.0386
0.0151
0.0197
0.0159
0.0257
0.0101
0.0132
0.0330
0.0553
0.0209
0.0281
HGN
0.0321
0.0517
0.0202
0.0265
0.0212
0.0351
0.0131
0.0176
0.0424
0.0687
0.0281
0.0356
GRU4Rec
0.0324
0.0501
0.0209
0.0266
0.0202
0.0338
0.0129
0.0173
0.0499
0.0799
0.0320
0.0416
BERT4Rec
0.0307
0.0485
0.0195
0.0252
0.0186
0.0296
0.0119
0.0155
0.0460
0.0735
0.0298
0.0386
SASRec
0.0333
0.0523
0.0213
0.0274
0.0259
0.0412
0.0150
0.0199
0.0535
0.0847
0.0331
0.0438
Table 2. Comparison of JevRec with existing methods on three datasets. Best results are bold and second-best results are underlined . R@K and N@K denote Recall@K and NDCG@K, respectively. Improvements are relative to the best baseline in each column. “ ∗ ” denotes statistically significant improvements ( p<0.05 ) over the best baseline according to a paired t-test.
Variant
Instrument
Scientific
Game
R@5
R@10
N@5
N@10
R@5
R@10
N@5
N@10
R@5
R@10
N@5
N@10
Linguistic Encoding
(1.1) Fixed-length
0.0370
0.0564
0.0244
0.0306
0.0264
0.0422
0.0175
0.0226
0.0559
0.0868
0.0366
0.0467
(1.2) Random lengths
0.0374
0.0591
0.0239
0.0311
0.0278
0.0445
0.0178
0.0230
0.0567
0.0898
0.0369
0.0476
(1.3) Reversed frequency
0.0358
0.0579
0.0229
0.0300
0.0270
0.0437
0.0171
0.0225
0.0552
0.0885
0.0356
0.0462
Jev-like Decision Modeling
Table 3. Ablation study of JevRec on three datasets. R@K and N@K denote Recall@K and NDCG@K.
Figure 3. Length and content gradient alignment. (a) Shared-head batch mean with standard deviation. (b) Pooled cosine densities; dotted lines mark means. The left panel shows the batch-mean gradient cosine for the shared LM head across epochs 5 to 135, with one standard deviation shading. The mean stays negative at every recorded checkpoint. The right panel compares pooled cosine densities for the shared head and our method; our distribution moves closer to zero but retains negative samples.
Figure 4. Runtime and validation progress. (a) Training and inference time with baseline-to-ours ratios. (b) Instrument validation NDCG@10; stars mark the best checkpoints. Panel a compares mean training seconds per epoch and total inference seconds on each full test set for Instrument, Scientific, and Game. Our method uses less time in all six comparisons. Panel b shows validation NDCG at 10 on Instrument, with the best recorded checkpoints at epoch 95 for our method and epoch 115 for TIGER.
Figure 5. SID length sensitivity. (a) Vary N at M=3 . (b) Vary M at N=3 . Shading marks the default value. NDCG at 10 on Instrument, Scientific, and Game for separate sweeps of N and M from 2 to 5. The left panel varies N at fixed M=3; the right panel varies M at fixed N=3. The shaded bands indicate the default value 3, not necessarily the best score.
Figure 6. Frequency-aware SID lengths for three game items. Each card shows the item’s interaction count and complete SID, including its final collision token. Three game items with different interaction counts and SID lengths. Grand Theft Auto V has 2,142 interactions and SID (36, 352, 1028), of length 3. Warcraft III: The Frozen Throne has 25 interactions and SID (77, 412, 558, 1026), of length 4. Sekiro: Shadows Die Twice has 7 interactions and SID (23, 463, 514, 789, 1026), of length 5.
Generative recommendation models user histories and item catalogs to generate personalized items, lists, or queries rather than only scoring candidates.
Generative recommendation reformulates recommendation as next-token prediction over discrete semantic identifiers (IDs). A fundamental yet unexplored design choice is that existing methods employ fixed-length tokenization for all items, implicitly assuming uniform encoding capacity regardless of item characteristics. Through systematic experiments across four datasets, we discover the Popularity-Length Paradox: popular items achieve optimal performance with short IDs, while tail items require substantially longer codes to capture discriminative semantics. This reveals a critical mismatch where popular items benefit from abundant collaborative signals and require minimal semantic detail, whereas tail items must rely on fine-grained content features due to sparse interaction data. To address this, we propose VarLenRec, a framework for learning variable-length tokenization. We develop Popularity-Weighted Information Budget Allocation (PIBA), an information-theoretic framework proving that optimal ID length should scale as a negative power of popularity. Directly implementing variable-length allocation faces two technical challenges: standard Euclidean residual quantization lacks geometric capacity to support diverse code lengths without distortion, and discrete length decisions are non-differentiable. We address these through Hyperbolic Residual Quantization, which leverages the exponential volume growth of the Poincaré ball to naturally stratify encoding capacity, and a Soft Length Controller, which enables differentiable length prediction via continuous layer retention probabilities regularized by PIBA-derived priors. Extensive experiments demonstrate that VarLenRec achieves significant improvements over state-of-the-art methods in recommendation accuracy and training/inference efficiency, revealing the importance of adaptive encoding capacity in generative recommendation.
Minhao Wang, Bowen Wu, Wei Zhang
East China Normal University · Shanghai, China · & Shanghai Innovation Institute
Generative recommendation commonly represents items using fixed-length semantic identifiers (SIDs) constructed through clustering and quantization. However, these artificial codes may overcompress item semantics, remain misaligned with pretrained LLM vocabularies, and require costly autoregressive decoding. In light of this, we propose VaLiDRec, a generative recommendation framework based on variable-length, LLM-aligned semantic identifiers. VaLiDRec constructs SIDs directly from informative native LLM vocabulary tokens via token importance estimation, semantic-quality-aware pruning, and collision-aware refinement, allowing identifier lengths to adapt to item semantic complexity. To model user preferences, VaLiDRec incorporates graph-aware soft prompts and reformulates recommendation as token-set prediction with token-level item scoring, eliminating autoregressive SID generation and beam search. Experiments on four real-world datasets show that VaLiDRec consistently outperforms strong sequential and generative recommendation baselines across all evaluation metrics. It further achieves superior zero-shot item cold-start performance and 87.49× faster inference than LC-Rec. These results demonstrate that LLM-native variable-length semantic identifiers provide a more expressive and efficient paradigm for generative recommendation.
Shutong Qiao, Wei Yuan, Tong Chen +3
University of Queensland Brisbane, Australia · Computer Network Information Center, Chinese Academy of Sciences Beijing, China · Griffith University Gold Coast, Australia
Generative Retrieval (GR) offers a promising paradigm for recommendation through next-token prediction (NTP). However, scaling it to large-scale industrial systems introduces three challenges: (i) within a single request, the identical model inputs may produce inconsistent outputs due to the pagination request mechanism; (ii) the prohibitive cost of encoding long user behavior sequences with multi-token item representations based on semantic IDs, and (iii) aligning the generative policy with nuanced user preference signals. We present GenRec, a preference-oriented generative framework deployed on the JD App that addresses above challenges within a single decoder-only architecture. For training objective, we propose Page-wise NTP task, which supervises over an entire interaction page rather than each interacted item individually, providing denser gradient signal and resolving the one-to-many ambiguity of point-wise training. On the prefilling side, an asymmetric linear Token Merger compresses multi-token Semantic IDs in the prompt while preserving full-resolution decoding, reducing input length by ~2X with negligible accuracy loss. To further align outputs with user satisfaction, we introduce GRPO-SR, a reinforcement learning method that pairs Group Relative Policy Optimization with NLL regularization for training stability, and employs Hybrid Rewards combining a dense reward model with a relevance gate to mitigate reward hacking. In month-long online A/B tests serving production traffic, GenRec achieves 9.5% improvement in click count and 8.7% in transaction count over the existing pipeline.
Yanyan Zou, Junbo Qi, Lunsong Huang +7
JD.com Beijing, China · Waseda University Tokyo, Japan