arXiv(opens in a new tab)cs.LGAug 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2608.24207

PRQ-KMeans: Projection Residual Quantization for Semantic ID Tokenization

Yunxiao Luo, Siyuan Wang, Ben Chen, Chenyi Lei

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Semantic identifiers (SIDs) represent entities as hierarchical token sequences for generative retrieval and recommendation. Residual-quantization tokenizers construct these sequences by selecting a codeword at each level and passing a residual to the next. We view this process as progressive commonality removal: each token captures a component shared within its group, while later tokens should model the remaining differences. This view reveals three limitations: a corpus-wide shared component can consume first-level capacity, hard assignment ignores graded similarities to nearby codewords, and full-codeword subtraction can leave variation along the selected-codeword direction in the next residual. We therefore develop our solution in the post-hoc setting, where residual construction is not constrained by input reconstruction. Specifically, we propose PRQ-KMeans, which removes the global-mean component, refines centroids with Top-k similarity-weighted updates, and replaces full-codeword subtraction with a projection residual that removes each representation's selected-centroid component. Experiments on a large-scale industrial search dataset and four public recommendation benchmarks show that PRQ-KMeans achieves the strongest overall performance among the evaluated tokenizers, including gains of up to 7.4% in HitRate and 11.8% in MRR on the industrial dataset.

1 Introduction

Semantic identifiers (SIDs) replace atomic entity identifiers with short token sequences for generative retrieval (Tay et al. 2022; Wang et al. 2022; Sun et al. 2023) and recommendation (Rajput et al. 2023; Singh et al. 2024). Hierarchical SIDs organize these tokens from coarse to fine: related entities can share early tokens, while later tokens distinguish entities that remain under the same prefix. Constructing such an identifier involves two coupled decisions at each level: which token represents the entity at the current position, and what representation is passed forward to construct the next token.

Residual quantization provides a common framework for making these decisions. At each level, it selects a codeword for the current token, subtracts that codeword from the current representation, and passes the resulting residual to the

Figure

Figure 1: Full-centroid subtraction and projection residuals. Full-centroid subtraction may leave positive or negative residual carryover along the selected-centroid direction, whereas projection removes this component and yields a residual orthogonal to that centroid.

next level. Two major tokenizer paradigms use this recursion. VAE-based methods (Lee et al. 2022; Rajput et al. 2023; Wan et al. 2026) learn hierarchical SIDs through a residual-quantization autoencoder. Post-hoc methods (e.g., RQ-KMeans and RQ-GMM) (Luo et al. 2025; Deng et al. 2025; Tong et al. 2026) instead fit hierarchical codebooks directly over existing embeddings. In both paradigms, the residual becomes the representation processed at the next level. We refer to the component that remains along the selected-codeword direction after subtraction as residual carryover.

Since each later token uses the preceding residual, residual construction determines what information passes across levels. We therefore view residual quantization as progressive commonality removal: the selected codeword represents a component shared within the current group, while the residual should retain the differences that remain for later tokens. This view reveals three challenges. First, commonality can exist before any cluster-level token is formed. A component shared across the embedding collection may dominate the initial representations. Because it is broadly shared, this component contributes little to distinguishing entities, yet the first codebook may spend part of its capacity modeling this global background rather than coarse differences among entities.

∗^{*}Equal contribution.

†^{\dagger}Equal contribution.

∗^{*}Corresponding author.

Second, hard assignment limits how accurately a codeword can summarize its group. Each representation updates only its selected codeword, even when it is also similar to nearby candidates, discarding graded similarity around assignment boundaries. Third, full-codeword subtraction does not generally remove the selected-codeword component accurately from every representation. As Figure 1 illustrates, representations assigned to the same codeword may contain different amounts of this component, although the same codeword is subtracted from all of them. This mismatch can leave a positive or negative component along the selected direction, causing the next codebook to revisit variation already represented by the current token. Our preliminary study finds this component measurable in industrial RQ-KMeans residuals and shows that retaining more of it monotonically reduces next-level SID-prefix utilization (Section 3).

VAE-based tokenizers can reshape their latent representations and codebooks through reconstruction and auxiliary SID objectives (Wang et al. 2024; Zhu et al. 2024; Wan et al. 2026). Their residuals, however, are constrained by additive reconstruction: everything left after subtracting the current codeword is passed to later codewords, even a component along the same direction. Discarding that component independently would alter the codeword sum used for reconstruction. Post-hoc tokenizers instead operate on existing embeddings without requiring the codewords to reconstruct the input, allowing the residual to preserve only the differences needed by later SID levels. We develop our solution in this post-hoc setting using RQ-KMeans.

To address these challenges, we propose PRQ-KMeans, a post-hoc hierarchical SID tokenizer built around projection residuals. To keep the corpus-wide component from consuming first-level capacity, PRQ-KMeans removes each input representation's projection onto the global mean before fitting the first codebook. To better estimate the component shared within each cluster, Top-k soft refinement lets every representation contribute to several nearby centroids in proportion to their cosine similarities, rather than updating only its most similar centroid. To prevent the selected-centroid component from being passed to the next level, PRQ-KMeans removes each representation's own projection onto its selected centroid after hard assignment, rather than subtracting the full centroid vector. The resulting residual is orthogonal to that centroid and is passed forward to fit the next codebook. Together, these operations implement progressive commonality removal from global to local.

Our main contributions are threefold. (1) We introduce the view of hierarchical SID construction as progressive commonality removal and identify three challenges in determining what is passed between successive token levels. (2) We propose PRQ-KMeans, which combines global component removal and Top-k soft centroid refinement with a projection residual that removes this component separately for each representation. (3) We demonstrate the effectiveness of PRQ-KMeans through extensive evaluation on industrial search and four public recommendation benchmarks.

References (52)