Papers
Topics
Authors
Recent
Search
2000 character limit reached

RecJPQ: Joint PQ for Recommenders

Updated 8 July 2026
  • RecJPQ is a recommendation-oriented adaptation of Joint Product Quantisation that compresses item representations by replacing full embeddings with compact sub-ID tuples.
  • It reconstructs item embeddings by concatenating learned sub-embeddings, reducing the dominant parameter count from |I|d to bd and enhancing memory efficiency.
  • The method improves inference efficiency through algebraic decomposition, enabling exact top‑k scoring and dynamic pruning in large-catalogue sequential recommendation systems.

RecJPQ is a recommendation-oriented adaptation of Joint Product Quantisation for large-catalogue recommendation, introduced as a replacement for the conventional item embedding tensor in sequential recommenders such as SASRec, BERT4Rec, and GRU4Rec. Its central mechanism is to replace each item’s full embedding with a short tuple of shared sub-item identifiers and to reconstruct the item representation by concatenating learned sub-embeddings, thereby changing the dominant learnable item-side parameter count from Id|I|d to bdbd, plus fixed code storage of order O(Im)O(|I|m) (Petrov et al., 2023). In subsequent work, the same representation became the basis for exact parallel scoring, safe dynamic pruning, sub-ID-level popularity modeling, and multimodal top-kk recommendation (Petrov et al., 2024, Petrov et al., 1 May 2025, Mallamaci et al., 7 Aug 2025, Spillo et al., 22 Jun 2026).

1. Origin and problem formulation

RecJPQ was introduced to address a specific systems bottleneck in sequential recommendation: modern Transformer backbones generate a sequence representation and then score every catalogue item against an item embedding matrix. In the standard formulation, a user history is encoded as ϕRd\phi \in \mathbb{R}^d, item scores are computed as r=Wϕr=W\phi, and the item matrix WRI×dW \in \mathbb{R}^{|I|\times d} becomes the dominant memory cost when I|I| reaches hundreds of thousands or millions (Petrov et al., 2024). In the original RecJPQ paper, this bottleneck is framed as affecting both input embedding lookup and output scoring, because the same item embedding tensor is used to represent historical items and to score candidate items (Petrov et al., 2023).

The method is explicitly derived from Product Quantisation and Joint Product Quantisation. Standard PQ splits a vector into subspaces and approximates each subvector by a centroid from a small codebook; JPQ differs in assigning codes before end-to-end training so that the model never needs to learn the full dense embedding table. RecJPQ transfers that idea to recommendation and adds recommendation-specific code assignment strategies based on interaction data rather than text-side pretraining (Petrov et al., 2023).

The original paper also presents RecJPQ as conceptually analogous to tokenisation in LLMs: items are split into “sub-item entities” before recommender training. This framing is not merely metaphorical. It captures the core inductive bias of the method: parameter sharing is imposed at the level of discrete latent components rather than learned post hoc by compression (Petrov et al., 2023).

2. Compositional representation and code assignment

In RecJPQ, each item ii receives a code

gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},

where bdbd0 is the code length and each bdbd1 is a sub-item ID drawn from a split-specific codebook of size bdbd2. The scheme can therefore represent up to bdbd3 distinct item codes. With the common setting bdbd4, each code component fits in one byte (Petrov et al., 2023).

For each split bdbd5, RecJPQ learns a sub-item embedding table of dimension bdbd6. The item embedding is reconstructed by concatenating the selected sub-embeddings. Later formalizations write this as

bdbd7

with codebook matrix

bdbd8

and split-specific sub-item embedding matrices

bdbd9

If the sequence embedding is partitioned compatibly as O(Im)O(|I|m)0, then item scoring decomposes additively: O(Im)O(|I|m)1 Defining sub-ID scores

O(Im)O(|I|m)2

one obtains the operational scoring identity

O(Im)O(|I|m)3

This is the algebraic basis of all later RecJPQ inference work (Petrov et al., 2024).

The learnable parameter reduction follows directly. A standard item table needs O(Im)O(|I|m)4 trainable parameters. RecJPQ replaces this with O(Im)O(|I|m)5 learnable parameters, while storing the discrete item-to-code assignments separately (Petrov et al., 2023).

The original paper defines three offline assignment strategies. The simplest is random code assignment. The main recommendation-specific strategy is discrete truncated SVD: construct the binary sequence–item interaction matrix O(Im)O(|I|m)6, compute truncated SVD with O(Im)O(|I|m)7 latent components,

O(Im)O(|I|m)8

min-max normalize the item matrix O(Im)O(|I|m)9, perturb it with tiny Gaussian noise kk0, and discretize each latent dimension into kk1 quantiles; those quantized values become the item’s sub-item IDs. A third strategy applies the same discretization pipeline to item embeddings learned by an offline BPR matrix factorization model (Petrov et al., 2023).

3. Integration into recommendation architectures

RecJPQ is presented as a model-agnostic replacement for the item embedding tensor rather than a new sequence encoder. In the original formulation, SASRec retains its self-attention sequence model, BERT4Rec retains its bidirectional Transformer encoder, and the GRU-based baseline retains its recurrent backbone; what changes is the way item representations are stored, looked up, and reused for output scoring (Petrov et al., 2023).

This replacement is deliberately lightweight at the training-objective level. The original paper states that RecJPQ does not modify the base model loss. BERT4Rec continues to use its original masked-item prediction objective, SASRec its original next-item objective, and the GRU-based model the LambdaRank configuration of the authors’ prior implementation. The compression is therefore architectural rather than loss-based (Petrov et al., 2023).

This design choice remained stable in later work. The PQTopK paper explicitly states that RecJPQ changes the item representation layer while PQTopK changes only the inference-time scoring head; the Transformer backbone and learning objective are not altered (Petrov et al., 2024). The same modularity underlies later extensions such as sub-ID popularity re-ranking and multimodal quantization.

A notable generalization appears in URecJPQ, which extends the RecJPQ idea from item-only quantization in sequential recommendation to user-and-item quantization in top-kk2 recommendation. In that setting, a vanilla model with embedding dimension kk3 has kk4 trainable embedding parameters, whereas URecJPQ reduces the trainable embedding component to shared codebooks of size kk5 per side, or kk6 for both users and items when the codebook length is 256 per subspace (Spillo et al., 22 Jun 2026).

4. Empirical behavior and regularization

The original RecJPQ evaluation used MovieLens-1M, Booking.com, and Gowalla. Its central empirical pattern is that RecJPQ is most compelling on large, sparse, long-tail catalogues. On Booking.com, BERT4Rec with SVD-based RecJPQ improved NDCG@10 from kk7 to kk8 while reducing model size to kk9 of the baseline, which the paper highlights as a ϕRd\phi \in \mathbb{R}^d0 NDCG@10 improvement. On Gowalla, base SASRec achieved NDCG@10 ϕRd\phi \in \mathbb{R}^d1, while RecJPQ-Random achieved ϕRd\phi \in \mathbb{R}^d2 at ϕRd\phi \in \mathbb{R}^d3 of the original checkpoint size (Petrov et al., 2023).

The same study reports a clear size–performance frontier. On MovieLens-1M, the largest vanilla SASRec reaches roughly the same performance as a ϕRd\phi \in \mathbb{R}^d4 smaller RecJPQ variant, ϕRd\phi \in \mathbb{R}^d5 MB versus ϕRd\phi \in \mathbb{R}^d6 MB. On Gowalla, comparable SASRec performance is reported with a ϕRd\phi \in \mathbb{R}^d7 smaller RecJPQ model, ϕRd\phi \in \mathbb{R}^d8 GB versus ϕRd\phi \in \mathbb{R}^d9 MB (Petrov et al., 2023). The paper also reports that training and inference time were not noticeably harmed in its setting; on Booking.com, base BERT4Rec required r=Wϕr=W\phi0 hours while RecJPQ-SVD BERT4Rec required r=Wϕr=W\phi1 hours (Petrov et al., 2023).

The original paper interprets some of the quality gains as a regularization effect. Because many long-tail items have very few interactions, learning a fully independent dense vector per item can overfit. RecJPQ forces items to share sub-embeddings, reducing memorization of idiosyncratic item-specific parameters and improving generalization on sparse data (Petrov et al., 2023). The ablations support this interpretation: longer codes, hence weaker sharing, help on denser MovieLens-1M, whereas shorter codes, hence stronger sharing, help on sparse long-tail Gowalla (Petrov et al., 2023).

This regularization reading reappears in later work. URecJPQ reports that on large-scale multimodal datasets it can reduce checkpoint size by r=Wϕr=W\phi2 to r=Wϕr=W\phi3 and trainable parameters by r=Wϕr=W\phi4 to r=Wϕr=W\phi5, with an average decrease of r=Wϕr=W\phi6 in Recall and r=Wϕr=W\phi7 in NDCG, but in some cases even performance improvements of up to r=Wϕr=W\phi8, especially in the baby-products domain (Spillo et al., 22 Jun 2026).

5. Inference, pruning, and system-scale retrieval

The algebraic decomposition of RecJPQ scores led to a second research line focused on exact inference efficiency. The key observation is that one can precompute the r=Wϕr=W\phi9 sub-ID score matrix WRI×dW \in \mathbb{R}^{|I|\times d}0 once per user and then assemble each item score by WRI×dW \in \mathbb{R}^{|I|\times d}1 lookups and additions rather than by a full WRI×dW \in \mathbb{R}^{|I|\times d}2-dimensional dot product (Petrov et al., 2024).

The PQTopK paper argues that the original RecJPQ implementation left speed on the table because it used per-item score accumulators in a split-first loop order, which limited parallelization. PQTopK reorders the computation so that each item’s final score is computed independently as

WRI×dW \in \mathbb{R}^{|I|\times d}3

followed by exact top-WRI×dW \in \mathbb{R}^{|I|\times d}4 selection. On Gowalla with WRI×dW \in \mathbb{R}^{|I|\times d}5 items, this reduced SASRec scoring mean response time from WRI×dW \in \mathbb{R}^{|I|\times d}6 ms for default scoring to WRI×dW \in \mathbb{R}^{|I|\times d}7 ms and total inference from WRI×dW \in \mathbb{R}^{|I|\times d}8 ms to WRI×dW \in \mathbb{R}^{|I|\times d}9 ms, yielding the widely cited I|I|0 end-to-end speedup over default SASRec and I|I|1 over the original RecJPQ scoring head (Petrov et al., 2024).

RecJPQPrune extends this line from faster exhaustive scoring to exact non-exhaustive retrieval. It introduces inverted indexes over sub-item IDs, orders sub-ID scores within each split, maintains a top-I|I|2 threshold I|I|3, and stops when the upper bound

I|I|4

satisfies I|I|5, because no unscored item can then enter the final top I|I|6. The method is described as safe-up-to-rank I|I|7: it returns exactly the same top-I|I|8 as exhaustive scoring and preserves effectiveness (Petrov et al., 1 May 2025).

On Tmall with I|I|9M items and SASRecJPQ, the paper reports median scoring times of ii0 ms for Transformer Default, ii1 ms for PQTopK, and ii2 ms for RecJPQPrune, corresponding to about ii3 speedup over Transformer Default and about ii4 over PQTopK. It also states that RecJPQPrune can score ii5 million items in under ii6 milliseconds without GPUs and without ANN, while maintaining identical NDCG@10 across scoring methods (Petrov et al., 1 May 2025).

These inference papers also clarify an important misconception. Neither PQTopK nor RecJPQPrune is an approximate nearest-neighbor method in the reported form. PQTopK is still exhaustive, but parallel and sub-ID-based; RecJPQPrune is non-exhaustive, but exact because it prunes only when the provable upper bound on unseen items falls below the current threshold (Petrov et al., 2024, Petrov et al., 1 May 2025).

6. Later extensions, trade-offs, and limitations

Several later papers repurposed the RecJPQ sub-ID structure beyond memory-efficient sequential scoring.

Work Focus Representative reported result
PQTopK (Petrov et al., 2024) Parallel exact scoring ii7 faster total SASRec inference on Gowalla
RecJPQPrune (Petrov et al., 1 May 2025) Safe dynamic pruning ii8 faster than Transformer Default on Tmall
sPPS (Mallamaci et al., 7 Aug 2025) Sub-ID popularity re-ranking higher personalised novelty without compromising recommendation accuracy
URecJPQ (Spillo et al., 22 Jun 2026) User+item quantization for multimodal top-ii9 gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},0–gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},1 checkpoint and gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},2–gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},3 parameter reduction

In music recommendation, the sub-ID structure was reinterpreted as a finer-grained popularity signal. If an item has code

gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},4

and the user-specific count of sub-ID gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},5 in split gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},6 is

gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},7

then the sub-ID-based personalised popularity score is

gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},8

The final score is a convex combination of the RecJPQ recommender logits, item-level PPS, and sub-ID-level PPS: gi={gi1,gi2,,gim},g_i=\{g_{i1},g_{i2},\ldots,g_{im}\},9 This extension is intended to capture shared repetition patterns that item-level popularity alone cannot express (Mallamaci et al., 7 Aug 2025).

Across these developments, several limitations remain stable. RecJPQ codes are assigned offline and fixed before training; neither the original paper nor URecJPQ learns the discrete assignments dynamically (Petrov et al., 2023, Spillo et al., 22 Jun 2026). Assignment strategy is materially important: SVD is presented as the safest default in the original sequential setting, Random can be best when stronger regularization helps, and BPR-based discretization can fail badly, as on Gowalla (Petrov et al., 2023). The method is also catalogue-scale sensitive: on small datasets such as MovieLens-1M, compression gains can be limited and overhead can dominate, even increasing SASRec checkpoint size in one reported setting (Petrov et al., 2023).

Inference-side trade-offs are equally explicit. PQTopK remains exhaustive over the candidate set, so latency still scales roughly linearly with bdbd00; its advantage is hardware efficiency and preserved memory compression (Petrov et al., 2024). RecJPQPrune is exact, but its worst-case behavior can approach exhaustive scoring when pruning is ineffective, and larger numbers of splits bdbd01 erode the scoring advantage (Petrov et al., 1 May 2025). URecJPQ emphasizes memory and checkpoint reductions rather than latency, and it does not report explicit retrieval-throughput benchmarks (Spillo et al., 22 Jun 2026).

Taken together, these works establish RecJPQ as more than an embedding-compression trick. In its original form it is a JPQ-inspired compositional item layer for training large-catalogue sequential recommenders; in later work it becomes an exact scoring algebra, a dynamic-pruning substrate, a source of sub-ID-level personalization signals, and a basis for user-and-item quantization in multimodal top-bdbd02 systems (Petrov et al., 2023).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to RecJPQ.