Source-linked AI summary
Differentiable Semantic ID for Generative Recommendation
Junchen Fu, Xuri Ge, Alexandros Karatzoglou, Ioannis Arapakis, Suzan Verberne, Joemon M. Jose, Zhaochun Ren
TL;DR
Generative recommenders use semantic IDs learned independently for reconstruction, creating a mismatch because recommendation loss cannot update the tokenizer. DIGER makes semantic IDs differentiable, using Gumbel-noise exploration and uncertainty decay to stabilize joint optimization; it reports improved code utilization and competitive public-benchmark results. The paper also identifies richer collaborative signals and extensions beyond item-side representations as future directions.
Problem
Independently learned and frozen semantic IDs are misaligned with recommendation objectives, while naive differentiable indexing can cause codebook collapse.
Method
DIGER jointly learns semantic IDs and a generative recommender using exploratory Gumbel-noise learning with two uncertainty-decay strategies.
Results
DIGER stabilizes training, prevents semantic ID collapse, improves codebook utilization, and achieves competitive results on public benchmarks.
Takeaways & Limitations
Differentiable semantic indexing can align semantic ID learning with generative recommendation while supporting exploration-to-exploitation training.
Takeaways & Limitations
The study leaves integrating differentiable semantic IDs with richer collaborative signals and large language model–based recommendation frameworks for future work.
Abstract
from arXiv · showhide
Generative recommendation provides a novel paradigm in which each item is represented by a discrete semantic ID (SID) learned from rich content. Most existing methods treat SIDs as predefined and train recommenders under static indexing. In practice, SIDs are typically optimized only for content reconstruction rather than recommendation accuracy. This leads to an objective mismatch: the system optimizes an indexing loss to learn the SID and a recommendation loss for interaction prediction, but because the tokenizer is trained independently, the recommendation loss cannot update it. A natural approach is to make semantic indexing differentiable so that recommendation gradients can directly influence SID learning, but this often causes codebook collapse, where only a few codes are used. We attribute this issue to early deterministic assignments that limit codebook exploration, resulting in imbalance and unstable optimization. In this paper, we propose DIGER (Differentiable Semantic ID for Generative Recommendation), a first step toward effective differentiable semantic IDs for generative recommendation. DIGER introduces Gumbel noise to explicitly encourage early-stage exploration over codes, mitigating codebook collapse and improving code utilization. To balance exploration and convergence, we further design two uncertainty decay strategies that gradually reduce the Gumbel noise, enabling a smooth transition from early exploration to exploitation of learned SIDs. Extensive experiments on multiple public datasets demonstrate consistent improvements from differentiable semantic IDs. These results confirm the effectiveness of aligning indexing and recommendation objectives through differentiable SIDs and highlight differentiable semantic indexing as a promising research direction. Our code is released under https://github.com/junchen-fu/DIGER.
1 Introduction
Generative recommendation uses discrete semantic IDs to support compact, interpretable next-item prediction, but independently trained tokenizers leave indexing misaligned with recommendation. DIGER addresses this mismatch through differentiable semantic IDs, Gumbel-noise exploration, and uncertainty decay.
- Motivation: Generative recommendation represents items with discrete semantic identifiers derived from rich content and predicts the next item as an SID sequence.This design offers compact indexing, semantic interpretability, and a natural interface to sequence modeling.
- Objective mismatch: Independent reconstruction and recommendation objectives leave semantic IDs frozen and misaligned with downstream ranking utility.Because recommendation gradients cannot reach the tokenizer, the indexing space remains optimized for content reconstruction rather than personalization.
- Challenge: Differentiable semantic indexing can jointly optimize the encoder and semantic IDs with the generative recommender, but straight-through assignments can trigger codebook collapse.The discrete nature of semantic IDs makes gradient propagation difficult, and deterministic early assignments can produce unstable optimization.
- DIGER: DIGER jointly learns semantic IDs and the generative recommender through a differentiable semantic indexing framework.Its design is presented as a pioneering effort to directly jointly optimize semantic IDs and generative recommenders.
- DIGER: Gumbel noise encourages early code exploration, while two uncertainty-decay strategies gradually reduce stochasticity to align exploration with the training objective.The framework is described as stable, with balanced code usage and steadily improving performance.
2 Related Work
Related work addresses representation–task mismatch by allowing recommendation gradients to update encoders, while tokenizer alignment methods may instead use alternating distillation. DIGER focuses on direct joint optimization through differentiable semantic IDs.
- Joint Optimization for Recommendation: Modality-based sequential recommenders jointly train item or user encoders with recommenders to align representations with sequential prediction.Examples include adapting visual backbones and fine-tuning language encoders such as BERT.
- Joint Optimization for Recommendation: Joint optimization explicitly allows recommendation gradients to flow into representation modules, while large encoders create practical optimization challenges.
- Tokenizer Alignment: ETEGRec aligns tokenizers with generative recommenders through alternating knowledge distillation rather than direct joint optimization via differentiable semantic IDs.Its indexing module is optimized through an indirect surrogate objective because recommendation loss cannot backpropagate through discrete indexing.
3 Preliminaries
Generative recommendation converts item content into fixed-length discrete semantic ID sequences and concatenates those sequences from a user’s history. A sequence model then autoregressively predicts the next item’s SID for recommendation.
- Semantic IDs: An RQ-VAE-based tokenizer maps each item to a length-m discrete code sequence called its semantic ID.Each code belongs to a vocabulary of size K and corresponds to an entry in a shared embedding or codebook.
- Semantic IDs: Each semantic-ID code is a discrete token fed into the generative model through the shared codebook.
- History Representation: A user’s interaction history is converted into a token sequence by concatenating the semantic IDs of previously interacted items chronologically.The concatenation operator joins the item-level SID sequences into the model input.
- Next-SID Prediction: The generative recommender learns the conditional distribution of the next-item SID from the history token sequence and predicts it autoregressively.Training minimizes the negative log-likelihood of the ground-truth next-item SID.
- Next-SID Prediction: At inference, the generated SID is mapped back to an item through the codebook or retrieval over items sharing that SID.This mapping enables efficient next-item recommendation.
4 Our Method: DIGER
DIGER jointly optimizes semantic IDs and generative recommendation by combining differentiable code selection, exploratory Gumbel noise, and uncertainty decay. Its design preserves exploration early while moving toward deterministic assignments and aligned inference-time behavior.
- Core framework: DIGER enables joint optimization of semantic IDs and a generative recommender through direct gradient flow.The framework is designed to address the objective mismatch between independently trained indexing and recommendation components.
- Core framework: Deterministic STE assignments can cause premature codebook collapse, imbalanced code usage, and unstable optimization.The problem is linked to highly concentrated, low-entropy selection distributions that limit codebook exploration.
- DRIL: Gumbel noise introduces stochastic code selection, encouraging early exploration while preserving differentiable end-to-end optimization.The method uses Gumbel rather than Gaussian noise to better match categorical code selection.
- DRIL: DIGER uses hard semantic IDs for forward indexing but soft Gumbel-Softmax probabilities for codebook updates during backpropagation.This allows gradients to reach weighted codebook entries while retaining discrete SID tokens for the recommender.
- Uncertainty decay: SDUD and FrqUD reduce uncertainty later in training, transitioning from exploration toward exploitation and improving training–inference objective alignment.SDUD links the learned noise scale to the generative loss, while FrqUD targets over-used codes to improve coverage.
- Uncertainty decay: DIGER keeps the Gumbel-Softmax temperature fixed and instead reduces uncertainty toward zero because the semantic ID is the required discrete inference output.The paper states that temperature variation has little empirical effect in this setting.
5 Experimental Setup
The experiments evaluate DIGER on three public generative-recommendation datasets using content-based item representations and next-interaction prediction. Performance is measured with Recall@10 and NDCG@10 under leave-one-out evaluation.
- Datasets: Experiments use three public datasets: B-Shop, I-Shop, and Yelp.The datasets cover two shopping domains and one food-review domain.
- Datasets: B-Shop and I-Shop use product descriptions for semantic encoding, while Yelp uses restaurant names and business categories.Review texts are reserved for constructing interaction records rather than item representations.
- Evaluation: Users’ interaction histories are inputs and their subsequent interactions are prediction targets after filtering users and items with fewer than five interactions.The preprocessing follows a standard generative-recommendation pipeline.
- Evaluation: Evaluation reports Recall@10 and NDCG@10 on test sets using a leave-one-out protocol.NDCG@10 is the normalized discounted cumulative gain metric.
6 Experimental results
Experiments across B-Shop, I-Shop, and Yelp show that DIGER improves over conventional two-stage training and remains competitive with state-of-the-art recommenders. Its gains arise from jointly optimizing semantic ID construction and generation objectives.
- RQ1: DIGER consistently improves over the conventional two-stage pipeline across all datasets and reported metrics.On B-Shop, R@10 rises from 0.0610 to 0.0657–0.0696 and N@10 from 0.0331 to 0.0361–0.0376.
- RQ1: Naive STE performs poorly across datasets, with B-Shop R@10 dropping to 0.0134 because straight-through discretization is unstable.The results align this instability with codebook collapse, which prevents effective joint learning.
- RQ1: DIGER’s improvements support jointly optimizing semantic ID construction and generation objectives through differentiable semantic IDs.The paper identifies this joint optimization as the source of additional gains over two-stage training.
- RQ2: DIGER achieves state-of-the-art or best performance on B-Shop and I-Shop, outperforming all listed baselines.On Yelp, it achieves the best R@10 at 0.0432, while its N@10 of 0.0227 is comparable to LETTER’s 0.0231.
- RQ2: DIGER consistently surpasses prior two-stage generative backbones such as TIGER across all three datasets.The comparison evaluates Recall@10 and NDCG@10 on the same three datasets.
7 Ablation Study (RQ3)
The ablation study finds that Gumbel noise, soft codebook updates, and uncertainty decay jointly support stable and effective differentiable semantic ID learning. Codebook capacity and semantic ID length create a tradeoff between expressivity and optimization stability.
- Core components: Removing uncertainty decay causes a clear performance drop, highlighting its role in transitioning from exploration to exploitation.The ablation is conducted on B-Shop, with similar trends reported on other datasets.
- Core components: Removing Gumbel noise significantly reduces performance, showing that stochastic exploration is important for differentiable semantic ID learning.The Gumbel-noise variant remains clearly better than STE, while removing soft updates causes a smaller additional degradation.
- Core components: Temperature annealing produces similar but slightly inferior results, whereas replacing Gumbel noise with Gaussian noise causes a more pronounced degradation.These comparisons support the specific role of the asymmetric Gumbel distribution in code selection.
- Capacity and length: Reducing semantic ID length m to 2 causes a substantial performance drop, while increasing m to 4 yields only marginal gains.The results indicate insufficient compositional capacity at m=2 and limited benefit from further increasing length.
- Capacity and length: K=256 and m=3 provide a favorable balance between representational capacity and stable training.The study reports that larger codebooks can lead to inferior results because of optimization instability.
8 Semantic ID Dynamics and Stability (RQ4)
DIGER produces more gradual semantic ID evolution than naive STE, while uncertainty decay enables controlled refinement and better training–inference behavior. These dynamics are associated with preventing abrupt drift and codebook collapse.
- SID drift: Naive STE exhibits much larger and more abrupt SID drift than DIGER, especially early in training.A large fraction of items changes SIDs within a single epoch under STE, consistent with unstable optimization and collapse.
- SID drift: DIGER with uncertainty decay keeps cumulative SID drift below 40%, preserving most semantic IDs while selectively refining them.Without uncertainty decay, cumulative drift remains below 15%, suggesting more limited adaptation.
- SID drift: Uncertainty-decay variants achieve better performance than DIGER without uncertainty decay, supporting controlled SID changes during later-stage exploitation.The reported behavior links decay with more effective semantic ID evolution rather than merely minimizing drift.
- Training–inference agreement: STE achieves perfect training–inference agreement by construction, but this rigid determinism coincides with unstable semantic ID learning and poor recommendation performance.DIGER without uncertainty decay instead shows persistently low agreement because training remains stochastic.
- Overall dynamics: Overall, uncertainty decay aligns training and inference assignments, prevents abrupt SID drift and code collapse, and promotes balanced code usage.The paper presents this as controlled refinement with reliable inference behavior.
9 Conclusions
DIGER addresses code collapse in differentiable semantic IDs by combining exploratory learning with uncertainty decay, stabilizing training and improving codebook utilization. The paper also identifies extensions to user-side and interaction-level discrete structures as future directions.
- 9 Conclusions: DIGER introduces DRIL with two uncertainty decay strategies to address code collapse in differentiable semantic indexing.The strategies support a gradual transition from exploration to exploitation.
- 9 Conclusions: Figure 6 compares SID drift and train–inference agreement across four assignment methods over training epochs.
- 9 Conclusions: Figure 7 visualizes usage probabilities for 256 codebook entries across three quantization layers and four methods.
- 9 Conclusions: Gumbel-noise exploration stabilizes training, prevents semantic ID collapse, and improves codebook utilization.
- 9 Conclusions: Future work includes user-side or interaction-level discrete structures, alternative estimators, richer collaborative signals, and large language model–based recommendation.
A Theoretical Analysis
The theoretical analysis formalizes why joint optimization can outperform two-stage training under objective mismatch and why entropy regularization improves effective code usage. It also shows that the gap between mismatched objectives can be arbitrarily large.
- A Theoretical Analysis: Two-stage training restricts indexing parameters to a subset, so its best recommendation objective cannot beat unrestricted end-to-end optimization.Under continuity and compactness conditions excluding global minimizers, the inequality is strict.
- A Theoretical Analysis: Objective mismatch can make two-stage training arbitrarily worse than joint optimization, even when both objectives are optimized exactly.The theorem constructs continuous losses whose gap can be scaled arbitrarily.
- A Theoretical Analysis: The effective number of used codes, Eff(q) = exp(H(q)), is maximized at the uniform code-usage distribution, where Eff(q) = K.This follows from the maximal-entropy property on the probability simplex.
- A Theoretical Analysis: The appendix includes an author-and-affiliation header unrelated to the theoretical claims.
- A Theoretical Analysis: Adding an entropy bonus formally pushes code assignments toward higher effective codebook utilization, independently of the optimizer.
B Derivation of the optimal 𝜎.
The derivation differentiates the noise-scale objective, imposes a stationary condition, and selects the positive root required by the logarithm domain and the practical constraint on σ.
- B Derivation of the optimal 𝜎.: Differentiating with respect to σ yields a stationary equation involving Lgen and σ + λ.
- B Derivation of the optimal 𝜎.: Setting the derivative to zero gives (σ + λ)^2 = Lgen.
- B Derivation of the optimal 𝜎.: The logarithm domain requires σ + λ > 0, so the positive root is selected.
- B Derivation of the optimal 𝜎.: The final closed-form solution additionally enforces the practical constraint σ ≥ 0.