TL;DR
LQ-Rec introduces a "Late Quantization" paradigm for sequential recommendation, reversing the standard order of operations in generative retrieval. By confining discretization to the output side of the pipeline, it achieves monotonic performance scaling with ID length, enables "anytime" compression without retraining, and significantly outperforms existing baselines in both accuracy and inference speed.
What Problem Does This Paper Address?
Generative Retrieval (GR) is an emerging trend in recommendation systems. Instead of storing massive embedding tables for millions of items, GR compresses items into short semantic IDs (sequences of discrete codes). A model then learns to "generate" the next item's ID based on a user's history.
However, current GR methods suffer from a structural flaw called Early Quantization. They feed these discrete codes back into the sequence encoder. This creates several headaches:
- Scaling Limits: Longer semantic IDs should reduce error, but they actually make the autoregressive generation task harder, often degrading ranking quality.
- Computational Cost: Encoding a history of $N$ items with $M$ tokens each leads to $O((MN)^2)$ attention memory.
- Inference Bottlenecks: Autoregressive decoding (like beam search) requires multiple expensive passes through the transformer encoder.
- Coupling: The predictor and the quantizer are "locked" together, making it impossible to analyze or optimize them independently.
Methods
The authors propose Late Quantization (LQ). In this framework, the sequence encoder and scoring rules operate entirely in continuous space. Discretization only happens at the very end when matching the user vector against the item catalog.
The LQ-Rec Architecture
- Item Encoder: Uses a frozen text encoder (like BGE) and a learnable MLP to project item metadata into a continuous embedding space.
- Sequence Encoder: A standard transformer that processes a history of continuous item embeddings to produce a user vector $u$.
- Residual Quantizer (Q): Maps the continuous item embeddings to a tuple of discrete codes (the semantic ID).
Two-Stage Training
- Stage 1 (S2H-QA): Jointly trains the encoder and quantizer. It uses a "Soft-to-Hard" schedule, starting with continuous embeddings and gradually annealing toward quantized ones using Straight-Through Estimation (STE).
- Stage 2 (Prefix-MQA): Freezes the encoder and fine-tunes the codebook using a Matryoshka-style objective. This trains the model to be accurate at every prefix length (e.g., using just the first 4 codes vs. all 16), enabling anytime compression.
Datasets
The model was evaluated on four public benchmarks using a leave-one-out protocol:
- Amazon Reviews: Toys, Beauty, and Sports categories (5-core).
- Yelp: (5-core).
- MemGen Partition: A specific split designed to test "Memorization" (seen transitions) vs. "Generalization" (unseen transitions).
Key Insights and Ideas
- Additive Error Decomposition: This is the "aha moment." Because the encoder never sees quantized tokens, the total retrieval error is simply the sum of the model error and the quantization error. This allows the authors to prove a Pairwise Ordering Theorem, providing structural guarantees that prior methods lacked.
- Monotonic Scaling: Unlike autoregressive models that trip over their own feet with longer IDs, LQ-Rec’s performance improves consistently as you increase the number of code tokens ($M$).
- Anytime Compression: Because of the Stage 2 training, a single trained model can be "truncated" at inference time. You can use shorter IDs for speed or longer IDs for accuracy without ever retraining the model.
- Generalization over Memorization: By staying in continuous space, the encoder retains the rich semantic relationships from the text features. This makes LQ-Rec much better at recommending items in "cold" or "unseen" scenarios compared to discrete-token models like TIGER.
Key Results
- State-of-the-Art Performance: LQ-Rec outperforms baselines like TIGER, RPG, and VQ-Rec across all datasets. For example, on the Yelp dataset, it improved Recall@10 by +57% over RPG.
- Superior Generalization: On the "Gen" split of the MemGen benchmark, LQ-Rec dominated every dataset, proving it isn't just memorizing popular item sequences.
- Efficiency: LQ-Rec sits on the Pareto front for latency vs. accuracy. It is significantly faster than TIGER because it only requires a single encoder pass per query.
- Scalability: At a catalog size of 500,000 items, LQ-Rec is roughly 12x lighter in terms of memory usage than graph-based methods like RPG.
Limitations and Future Work
- Inner-Product Scoring: The current theoretical proofs and efficiency gains rely on inner-product scoring. Extending this to more complex, non-linear "deep interaction" scoring functions would break the additive error decomposition.
- Content Dependency: As a fully content-based model, its performance is tied to the quality of the item metadata. While this helps with cold-start, it might struggle in domains where text descriptions are poor or missing.
- Future Directions: The authors suggest exploring the adaptation of LQ to non-linear ranking models and further refining the content-encoder design to improve performance in extremely "cold" regimes.
Summary updated