TL;DR
Generative recommendation systems use language models to predict the next item as a sequence of discrete tokens, but the quantization process often distorts the original semantic relationships between items. This paper introduces TopoTok (Topology-Aware Tokenization), a hierarchical distillation framework that preserves item similarity structures from coarse to fine granularities across quantization layers. By maintaining these topological relationships, TopoTok significantly boosts recommendation accuracy, delivering up to a 9.42% improvement in Recall@5 over state-of-the-art baselines.
What Problem Does This Paper Address?
Generative recommendation is a powerful paradigm that treats sequential recommendation as an autoregressive text generation task. Instead of traditional embedding-based retrieval (like vector search via Approximate Nearest Neighbor search), a Large Language Model (LLM) directly generates the discrete identifier (Semantic ID) of the next item.
To create these Semantic IDs, continuous item embeddings are typically quantized using a Residual Quantized Variational Autoencoder (RQ-VAE), which maps items into a hierarchical tree of discrete tokens (e.g., a digital piano might be tokenized into <6, 3, 5>, corresponding to instruments, keyboards, and digital pianos).
However, the authors identify a major flaw in this workflow: topology distortion. As continuous embeddings are compressed into discrete codes, the geometric relationships (i.e., which items are neighbors) are severely disrupted. For instance, the authors found that during standard RQ-VAE tokenization, only 63% of top-20 neighbor relationships are preserved at the first layer, dropping to a dismal 27% by the third layer. This "topological noise" misleads the LLM into treating unrelated items as similar, bottlenecking recommendation performance.
Methods
To combat topology distortion, the authors propose Topology-Aware Tokenization (TopoTok). Instead of applying a single monolithic supervision signal at the end of tokenization (which causes deeper layers to overfit to compensate for early errors), TopoTok introduces a layer-aligned, multi-granularity topology distillation scheme. It breaks down topology preservation into three distinct levels mapped to the RQ-VAE hierarchy:
- Inter-Group Distillation (Early Layers): Aligns the global, coarse-grained relationships between semantic clusters (groups of items) in both the continuous and discrete spaces.
- Intra-Group Distillation (Intermediate Layers): Refines local structures by enforcing neighborhood rankings within each semantic group, ensuring the model captures fine-grained relationships among similar items.
- Inter-Item Distillation (Deep Layers): Enforces global point-to-point neighborhood consistency at the individual item level.
Crucially, this distillation is formulated as a similarity ranking alignment problem using row-wise softmax and KL divergence. It focuses on relative neighborhood structures rather than exact distance matching, which is ill-posed across heterogeneous spaces. TopoTok adds no computational overhead at inference time.
Datasets
The authors evaluated TopoTok on three standard benchmark subsets from the latest Amazon Review dataset:
- Industrial Scientific
- Musical Instruments
- Video Games
All datasets were preprocessed using a standard 5-core filter (retaining users and items with at least 5 interactions) and evaluated using a full-ranking, leave-one-out strategy.
Key Insights and Ideas
- Quantization is a Lossy Compression of Relationships: Standard reconstruction losses (like MSE) ensure an individual item can be reconstructed, but they completely ignore whether its relative position to other items is preserved.
- Monolithic Supervision Fails Hierarchies: Prior attempts at preserving neighborhood structures applied contrastive losses only at the final layer. TopoTok shows that supervision must match the semantic scale of the layer (coarse-to-fine) to prevent "supervision entanglement," where early layers are undertrained and deeper layers overfit.
- Codebook Utilization as a Granularity Guide: The authors note that codebook utilization rates typically increase with depth in RQ-VAE. This rate can serve as a practical proxy to dynamically determine whether a layer should focus on inter-group, intra-group, or inter-item distillation.
Key Results
- Significant Accuracy Gains: TopoTok consistently outperformed traditional sequential recommenders (SASRec, BERT4Rec) and state-of-the-art generative recommenders (TIGER, ETEGRec). On the Industrial Scientific dataset, it achieved a 9.42% improvement in Recall@5 and a 7.36% improvement in NDCG@10 over the TIGER baseline.
- Mitigating Distortion: In ablation studies, the full TopoTok framework dramatically increased the top-20 neighborhood overlap across all layers (e.g., boosting layer 3 overlap on the Scientific dataset from 27.55% to 36.75%).
- End-to-End Synergy: When integrated into the end-to-end learnable ETEGRec framework, TopoTok achieved new state-of-the-art results, demonstrating its robustness in both two-stage and joint training setups.
Limitations and Future Work
- Hyperparameter Sensitivity: The performance of TopoTok depends on balancing the topology distillation weight ($\alpha$) with the standard reconstruction objective. Setting $\alpha$ too high introduces excessive regularization that hampers semantic reconstruction during vector quantization.
- Scalability to Massive Codebooks: While highly parallelizable because it relies on batch-local computations, scaling to exceptionally large codebooks or extremely deep quantization hierarchies remains an area for further empirical validation.
- Future Directions: The authors suggest exploring more dynamic ways to automatically map distillation granularities to layers based on real-time training dynamics rather than fixed layer assignments.
Summary updated