Generative models are increasingly used in recommender systems, both for modeling user behavior as event sequences and for integrating large language models into recommendation pipelines. A key challenge in this setting is the extremely large cardinality of item spaces, which makes training generative models difficult and introduces a vocabulary gap between natural language and item identifiers. Semantic identifiers (semantic IDs), which represent items as sequences of low-cardinality tokens, have recently emerged as an effective solution to this problem. However, existing approaches generate semantic identifiers of fixed length, assigning the same description length to all items. This is inefficient, misaligned with natural language, and ignores the highly skewed frequency structure of real-world catalogs, where popular items and rare long-tail items exhibit fundamentally different information requirements. In parallel, the emergent communication literature studies how agents develop discrete communication protocols, often producing variable-length messages in which frequent concepts receive shorter descriptions. Despite the conceptual similarity, these ideas have not been systematically adopted in recommender systems. In this work, we bridge recommender systems and emergent communication by introducing variable-length semantic identifiers for recommendation. We propose a discrete variational autoencoder with Gumbel-Softmax reparameterization that learns item representations of adaptive length under a principled probabilistic framework, avoiding the instability of REINFORCE-based training and the fixed-length constraints of prior semantic ID methods.
Figures & tables
Dataset
#Items
#Events
Emb. dim
Head share
Yambda
268K
82M
128
0.747
VK-LSVD
900K
95M
64
0.276
Amazon T&G
305K
12M
128
0.597
Table 1. Dataset statistics after preprocessing. Head share denotes the fraction of interactions attributed to the top-30k most popular items.
Yambda
VK-LSVD
Amazon Toys&Games
Method
Lrecon
Lreconcold
Epdata[L]
PPL
Lrecon
Lreconcold
Epdata[L]
PPL
Lrecon
Lreconcold
Epdata[L]
PPL
R-KMeans
0.038
0.063
5
3721
0.102
0.149
5
4010
0.094
0.138
5
3288
dVAE (fixed-length)
0.025
0.054
5
3557
0.123
0.147
5
3959
0.076
0.170
5
3797
dVAE (varlen, λ=λ1 )
0.025
0.057
3.62
3574
0.146
0.160
4.06
3913
0.068
0.167
4.63
3800
dVAE (varlen, λ=λ2 )
0.026
0.061
2.96
3609
0.155
0.176
3.45
3879
0.071
0.167
3.01
3623
dVAE (varlen, λ=λ3 )
0.029
0.076
2.29
3564
0.173
0.193
2.94
3839
0.076
0.182
2.38
3339
Table 2. Semantic ID reconstruction quality and efficiency. Epdata[L] denotes average semantic ID length under pdata distribution.
Yambda
VK-LSVD
Amazon Toys&Games
Semantic ID length
Mean Pop.
Max Pop.
# Items
Mean Pop.
Max Pop.
# Items
Mean Pop.
Max Pop.
# Items
1
2248.9
82097
7562
165.2
12319
18572
392.0
18275
5020
2
1154.1
23034
12485
151.3
6222
59305
99.8
2705
31384
3
292.2
10082
28421
115.0
3600
94966
39.2
724
31412
4
214.1
10037
80505
104.8
3079
159327
28.7
632
54192
5
125.4
7027
112276
89.4
2695
477542
18.6
575
152429
Table 3. Item popularity statistics by semantic ID length on the training data
Train
Cold
Dataset
Epcatalog[L]
Epdata[L]
Epcatalog[L]
Epdata[L]
Yambda
4.15
2.96
4.53
4.40
VK-LSVD
3.66
3.45
4.16
3.94
Amazon T&G
4.16
3.01
4.49
4.49
Table 4. Average semantic ID length under catalog and data distributions
Method
Yambda
VK-LSVD
Recall@100
Tokens
Events
Lcand
Cov@100
Recall@100
Tokens
Events
Lcand
Cov@100
R-KMeans
0.1637 (+0.0%)
364.8
61.49
6.00
18.2 (+0.0%)
0.0363 (+0.0%)
326.7
55.87
6.00
5.1 (+0.0%)
dVAE (fixed-length)
0.1645 (+0.5%)
364.8
61.49
6.00
20.8 (+14.3%)
0.0410 (+12.9%)
326.7
55.87
6.00
6.6 (+29.4%)
dVAE (varlen, λ=1 )
0.1676 (+2.4%)
331.2
71.72
4.47
20.9 (+14.8%)
0.0415 (+14.3%)
308.5
66.60
4.25
8.2 (+60.8%)
dVAE (varlen, λ=2 )
0.1794 (+9.6%)
287.7
88.93
3.05
25.1 (+37.9%)
0.0418 (+15.2%)
302.6
70.49
3.96
9.0 (+76.5%)
dVAE (varlen, λ=3 )
0.1820 (+11.2%)
277.8
93.13
2.86
25.8 (+41.8%)
0.0459 (+26.5%)
291.7
78.24
3.50
10.3 (+102.0%)
Table 5. Sequential recommendation performance under a fixed token budget. Tokens and Events denote the number of historical tokens and interaction events for the test users. Lcand denotes the average length of semantic IDs generated for candidate items during evaluation
Method
Lrecon
Lreconcold
Epdata[L]
PPL
dVAE (fixed-length)
0.0246
0.0536
5.00
3558
dVAE (varlen)
0.0294
0.0763
2.29
3564
REINFORCE (fixed-length)
0.0259
0.0607
5.00
2720
REINFORCE (varlen)
0.0528
0.1499
2.65
316
Table 6. Comparison of dVAE and REINFORCE-based training on Yambda
T
∣V∣
Lrecon
Lreconcold
Epdata[L]
PPL
5
4096
0.0254
0.0567
3.62
3575
20
4096
0.0177
0.0300
8.33
2733
5
32768
0.0150
0.0544
2.79
21350
Table 7. Scaling behavior of variable-length dVAE on Yambda. T denotes the maximum semantic ID length, and ∣V∣ denotes the vocabulary size.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Method
Lrecon @1
Lrecon @2
Lrecon @3
Lrecon @4
Lrecon @5
R-KMeans
0.1644
0.0959
0.0665
0.0494
0.0384
dVAE (fixed-length)
0.1400
0.0678
0.0512
0.0355
0.0246
dVAE (varlen)
0.1344
0.0606
0.0404
0.0313
0.0270
Appendix
Table 8. Reconstruction loss from semantic ID prefixes on Yambda
Method
PPL@1
PPL@2
PPL@3
PPL@4
PPL@5
R-KMeans
3895
3674
3489
3414
3393
dVAE (fixed-length)
1959
3366
3315
3284
3135
dVAE (varlen)
2168
3383
3215
3167
3175
REINFORCE (fixed-length)
1340
2146
2689
3035
3232
Appendix
Table 9. Position-wise token perplexity on Yambda (higher means more diverse token usage)
Figure 1. Position-wise token perplexity for varlen dVAE with maxlen=20 on Yambda
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 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.