TopoGR: Revealing and Preserving Latent Structure of Semantic ID in Generative Recommendation

Ziyu Zheng, Zhengshun Du, Yaming Yang, Bin Tong, Guan Wang, Meng Yan, Ziyu Guan, Wei ZhaoarXiv 2026

TL;DR

Generative recommendation models typically tokenize items into discrete semantic IDs (SIDs) but treat these IDs as independent categorical tokens, discarding the rich semantic relationships learned during tokenization. To fix this "structural mismatch," TopoGR introduces Bit-decomposable Semantic IDs (Binary SIDs) that explicitly preserve the latent topology of the item space using Hamming geometry. By integrating this topology across the entire generation pipeline, TopoGR significantly boosts recommendation accuracy, particularly for sparse and cold-start items.

What Problem Does This Paper Address?

Generative Recommendation (GR) is an exciting new paradigm where items are represented as sequences of discrete tokens (Semantic IDs, or SIDs), turning next-item recommendation into a sequence generation task. This pipeline usually happens in two stages: tokenization (compressing continuous item embeddings into discrete SIDs) and generation (predicting the next SID sequence autoregressively or in parallel).

However, the authors identify a critical flaw: a structural mismatch between these two stages.

Figure 1: Structural mismatch between SID tokenization and generation. While the tokenizer preserves latent proximity among SID codes (e.g., 38 is closer to 36 than 72), integer SID lookup maps non-identical codes to independent categorical embeddings, treating both 38 and 72 as mismatches to 36 and discarding their relative proximity.

During tokenization, the model learns a structured code space where certain IDs are semantically close to one another (e.g., code 38 is closer to 36 than to 72). But when these IDs enter the generator, they are passed through a standard embedding lookup table. This treats every integer ID as an independent, orthogonal categorical symbol. As a result, the model only recognizes exact ID matches; if two items are highly similar but assigned slightly different SIDs, the generator treats them as completely unrelated mismatches.

Figure 2: Codeword similarity heatmaps for the tokenization and generation stages by OPQ tokenizer. Additional analyses for RQ-KMeans and RQ-VAE are provided in the Appendix.

Methods

To bridge this gap, the authors propose TopoGR (Topology-preserving Generative Recommendation), which replaces opaque integer tokens with Bit-decomposable Semantic IDs (Binary SIDs).

Overview of the TopoGR framework

The framework consists of four core components:

  1. Bit-Decomposable Quantizer (BDQ): Instead of quantizing item embeddings into arbitrary integers, BDQ decomposes each token into a deterministic binary code. Crucially, it uses a bit-compositional reconstruction mechanism where the representation of an ID is the sum of learnable bit-level bases. This ensures that a small Hamming distance between two binary codes directly translates to high semantic similarity.
  2. Binary Feature Input: Instead of using an embedding lookup table for integer tokens, historical items are fed directly into the sequence model (a causal Transformer decoder) as flattened binary vectors. This makes the Hamming topology visible to the model right from the input layer.
  3. Hamming Soft Targets: Standard cross-entropy loss penalizes all incorrect token predictions equally. TopoGR introduces a soft target distribution based on pre-computed Hamming distances, assigning softer penalties to predicted codes that are structurally close to the true target in the binary space.
  4. Hamming-Consistent Reranking: During inference, TopoGR predicts all SID positions in parallel to generate a candidate pool. It then refines these scores by constructing a soft "predicted binary prototype" and reranking candidates based on how well their Binary SIDs align with this prototype using sign similarity.

Datasets

The authors evaluated TopoGR on four standard product categories from the Amazon Review dataset:

  • Sports & Outdoors (Sports)
  • Beauty
  • Toys & Games (Toys)
  • CDs & Vinyl (CDs)

Interactions were ordered chronologically per user, and item metadata (title, brand, category, description) was encoded using Sentence-T5 to generate the initial semantic representations.

Key Insights and Ideas

  • The Power of Additive Bit-Bases: By forcing the quantizer to reconstruct item embeddings by summing up bit-level bases, Hamming distance naturally becomes a meaningful proxy for semantic distance.
  • Beyond Exact Matching: The authors proved that even when items have zero exact integer SID overlap, those that are Hamming-close still exhibit significantly higher content similarity and relevance. TopoGR successfully exploits this hidden relationship.
  • Lightweight Alternative to Complex Architectures: While recent state-of-the-art models rely on heavy diffusion processes or complex masked reconstruction objectives to improve generative recommendation, TopoGR achieves superior results simply by fixing the representation space, making it a highly efficient alternative.

Key Results

TopoGR consistently outperformed both traditional item ID-based models (like SASRec) and state-of-the-art semantic ID-based generative recommenders (including RPG, MHL, and DiffGRM) across all datasets.

  • Substantial Accuracy Gains: Compared to its direct parallel-generation baseline (RPG), TopoGR improved NDCG@5 by approximately 24% on the Toys dataset and 19% on the Sports dataset.
  • Cold-Start Resilience: In zero- or low-frequency item scenarios (where item-specific interaction data is sparse), TopoGR showed its largest performance leaps, demonstrating that the model successfully transfers knowledge from semantically related neighbors in the binary SID space.
  • High Efficiency: Because TopoGR predicts SID positions in parallel and uses a vectorized full-corpus gather operation for scoring, it avoids the serial decoding bottlenecks of autoregressive models, maintaining low inference latency and high throughput.

Limitations and Future Work

While highly effective, TopoGR requires tuning the SID length ($M$) and the number of bits per position ($r$). Increasing these parameters expands representational capacity and improves recommendation accuracy, but it also enlarges the input dimension and increases computational costs.

Additionally, the current framework is tailored to parallel multi-token prediction; exploring how to adapt topology-preserving binary SIDs to autoregressive or diffusion-based generation models remains an open direction for future research.

Summary updated

BibTeX
@misc{zheng2026topogr,
  author = {Ziyu Zheng and Zhengshun Du and Yaming Yang and Bin Tong and Guan Wang and Meng Yan and Ziyu Guan and Wei Zhao},
  title = {{TopoGR: Revealing and Preserving Latent Structure of Semantic ID in Generative Recommendation}},
  year = {2026},
  eprint = {2607.25216},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.25216},
}
Figure