Manuscript Offprint
arXiv:2610.27898SPAR: Stepwise Personalized Autoregressive Recommendation with Prefix-Balanced Semantic IDs
Chunrui Zhang
University of Electronic Science and
Technology of China
Chengdu, China
Zheng Hu
Southwest Jiaotong University
Chengdu, China
Gaoyun Lin
University of Science and Technology
of China
Hefei, China
Qiran Song
University of Electronic Science and
Technology of China
Chengdu, China
Chang Zhou
HUJING Digital Media &
Entertainment Group
Beijing, China
Shimin Cai
University of Electronic Science and
Technology of China
Chengdu, China
Tao Zhou
University of Electronic Science and
Technology of China
Chengdu, China
Abstract
Semantic ID (SID)-based generative recommendation decomposes item selection into a sequence of token-level decisions, making personalization at each decoding step essential. However, each generated prefix defines a different candidate set, while existing methods insufficiently account for prefix-dependent user evidence and imbalanced historical interaction loads across candidate branches. These limitations increase the risk of irreversible branch-selection errors and reinforce the dominance of popular paths during autoregressive decoding. To address these challenges, we propose SPAR, a generative recommendation framework that enables stepwise personalized branch selection by integrating prefix-conditioned user evidence with interaction-load-aware SID construction. Technically, we design PATH Decoder, a Personalized Adaptive Tree-aware Hybrid Decoder that dynamically retrieves prefix-relevant evidence from compressed long-term memories and integrates it with recent behavior, user profiles, and event context for stepwise personalized decoding. Complementarily, we introduce RQ-PIB, a Prefix-aware Interaction-Balanced SID construction method that regulates historical interaction loads among sibling branches under each parent prefix, mitigating popularity-driven imbalance in the SID hierarchy. We conduct extensive offline and online experiments on Youku, a major video streaming platform operated by Alibaba. Offline evaluations on large-scale industrial data demonstrate an average relative improvement of 2.66% in HitRate over the strongest baseline. Further analysis shows that SPAR improves target-prefix retention by an average of 5.79 percentage points and reduces the traffic-weighted largest child-branch share by an average of 32.84% across SID levels. A 7-day online A/B test deploying SPAR to 10% of Youku's production traffic further achieves relative improvements of 3.95% in average watch time per user and 3.38% in play conversion rate. These results demonstrate the effectiveness of SPAR in improving hierarchical decoding reliability and mitigating popularity-driven branch imbalance, ultimately enhancing retrieval performance and user engagement in real-world recommendation scenarios.
CCS Concepts
• Information systems → Recommender systems.
Keywords
Generative Retrieval; Recommender System; Supervised Fine-tuning; Preference Alignment
1 Introduction
Web platforms such as video streaming services, e-commerce sites, and social feeds rely on large-scale recommendation to connect users with relevant content under strict latency constraints. Generative retrieval reformulates this problem as autoregressive item-identifier generation [23, 24]. In Semantic ID (SID)-based methods, each item is represented by a sequence of discrete semantic tokens, enabling retrieval through successive token predictions conditioned on user behavior [23].
Existing studies have advanced SID-based generative recommendation along two directions. The first focuses on item identifier construction, including semantic tokenization [8], load-regulated code assignment [21], and hierarchical category-tree representations [15]. The second improves user-conditioned generation through generative architectures [3, 27] and contextual information access [32]. Despite these advances, existing methods primarily optimize item representations or generation architectures, without explicitly coordinating prefix-dependent user evidence with the organization of candidate branches. This leaves the hierarchical nature of SID decoding insufficiently addressed. More importantly, the two research directions are often considered separately, although
Corresponding author

Illustrative SID codes and history emphasis. Gray bars denote historical interaction load, not prediction probability.
Figure 1: An example of prefix-conditioned interest extraction in hierarchical decoding. As the generated SID prefix changes, each decoding step requires different evidence from the same long-term user history to distinguish the remaining candidate branches. This motivates prefix-conditioned interest extraction throughout the decoding process. The example also illustrates the challenges of irreversible target-prefix pruning and imbalanced historical interaction loads among sibling branches.
they jointly determine the outcome of autoregressive retrieval. SID construction defines the candidate branches available at each prefix, while the generation model determines how user preferences are translated into branch probabilities. Improving either component without considering their interaction may leave a mismatch between the structure of the candidate space and the personalized evidence used to navigate it.
The key challenge lies in the changing requirements of prefix-conditioned branch decisions. Near the root of the SID tree, the decoder requires coarse-grained interest evidence, while deeper decisions demand finer information to distinguish sibling branches. As illustrated in Figure 1, generating the target SID [17, 06, 42] requires progressively shifting attention from broad user interests to prefix-specific preferences and fine-grained behavioral cues as the candidate space narrows. For users with diverse and evolving preferences, a fixed user representation or static long-term summary [14, 22] may fail to capture the evidence most relevant to each decision. For instance, a user may exhibit broad interests in multiple content categories, while individual branches within each category require more specific behavioral signals for discrimination. Evidence useful for selecting a coarse semantic category may therefore become less informative once the decoder enters a particular subtree. Conversely, fine-grained preferences that are irrelevant to the initial decision may become decisive at deeper levels. This creates a dynamic evidence-selection problem that cannot be fully addressed by simply increasing the capacity of a shared user representation. Instead, personalization should explicitly account for the current generated prefix and its remaining candidate branches.
Meanwhile, uneven historical interaction loads introduce another difficulty. As also illustrated in Figure 1, popular SID paths attract disproportionately more interactions, potentially dominating branch selection and irreversibly eliminating less frequent but relevant targets. Since branch competition occurs among siblings under the same prefix, global codeword balancing may overlook such local disparities. In particular, the same codeword can appear under different parent prefixes with distinct conditional branch distributions, allowing balanced aggregate loads to conceal highly skewed sibling loads. Moreover, enforcing uniform branch assignments may disrupt semantic proximity, introducing a trade-off between load balance and representation quality. Therefore, effective SID-based retrieval requires both prefix-dependent user evidence and locally balanced candidate branches while preserving semantic structure.
To address these challenges, we propose SPAR, a Stepwise Personalized Autoregressive Recommendation framework with Prefix-Balanced Semantic IDs. SPAR integrates two complementary components. First, PATH Decoder constructs coarse-to-fine long-term history views and compresses them into compact memory banks. A decoder-only backbone models recent SID interactions, while prefix-conditioned cross-attention dynamically retrieves relevant long-term evidence at each generation step. User and Event Tokens further incorporate profile information and request-time context into token prediction. Second, RQ-PIB constructs semantic identifiers through residual quantization and rebalances historical interaction loads among child branches sharing the same parent prefix. By selectively reassigning items with minimal additional semantic distortion, it mitigates local branch dominance while preserving semantic structure. Together, PATH Decoder and RQ-PIB improve both the evidence used for branch selection and the organization of competing branches. SPAR further incorporates preference-aligned training to refine generated recommendations.
Our main contributions are summarized as follows:
• Stepwise Personalized Decoding. We propose PATH Decoder, which dynamically retrieves prefix-relevant evidence from compact coarse-to-fine long-term memories and integrates recent behavior, user profiles, and event context for personalized token prediction.
• Prefix-Balanced SID Construction. We introduce RQ-PIB to regulate historical interaction loads among sibling branches under the same prefix while limiting additional semantic reconstruction error, addressing local imbalances overlooked by global codeword balancing.
• Large-Scale Empirical Evaluation. Experiments on industrial Youku data demonstrate an average relative improvement of 2.66% across HR@10/20/50/100 over the strongest baseline. Online A/B tests further improve average watch time per user by 3.95% and play conversion rate by 3.38%.
2.1 Generative Recommendation
Traditional large-scale recommendation systems typically adopt a multi-stage retrieval architecture, where two-tower models such as YouTubeDNN [2] efficiently retrieve candidates through user-item embedding matching. Despite their efficiency, these methods rely on predefined item representations and similarity-based retrieval, limiting the expressiveness of user-item interactions. Generative recommendation (GR) offers an alternative paradigm by directly generating recommendation targets. Early efforts such as P5 [4] formulate recommendation as personalized text generation, while HSTU [25] explores scalable sequential modeling of user behavior. More recently, Semantic ID (SID)-based generative retrieval has emerged as a promising approach, representing items as sequences.
of discrete tokens and retrieving candidates through autoregressive generation rather than conventional embedding matching.
Existing SID-based methods primarily focus on item tokenization and generative modeling. TIGER [18] introduces residual quantization for semantic item indexing and autoregressive retrieval; CoST [31] enhances semantic consistency through contrastive quantization; LETTER [20] incorporates semantic, collaborative, and diversity objectives into item tokenization; and RPG [6] improves generation efficiency through parallel SID decoding. Industrial frameworks, including UniRec [21], OneRec [3], and OneRec-V2 [27], further advance generative recommendation through scalable architectures and unified modeling. However, these approaches largely emphasize the construction of item identifiers or the optimization of generation frameworks, while paying limited attention to the hierarchical decision structure induced by SID prefixes. In particular, uneven branch loads and evolving user preferences across decoding steps can undermine retrieval effectiveness. In contrast, our work explicitly addresses these challenges through prefix-conditioned branch balancing and stepwise personalized decoding, jointly improving SID organization and user-aware decision-making at each level of the generation tree.
2.2 User Interest Modeling and Personalization
User interest modeling is fundamental to personalized recommendation. Early sequential methods, including GRU4Rec [5], SASRec [9], and BERT4Rec [19], capture evolving user preferences through recurrent networks and attention-based architectures, while S3Rec [30] further enhances sequential representations through self-supervised learning. Subsequent methods such as UniSRec [7] and RecFormer [12] incorporate textual semantics to improve generalization, whereas LLM-based approaches, including TALLRec [1], LCRec [26], and CALRec [13], explore language-model adaptation for personalized recommendation. Beyond sequential modeling, industrial systems emphasize fine-grained interest extraction: MIND [10] captures multiple user interests, DIN [29] and DIEN [28] introduce target-aware behavior modeling, and MIMN [16] and SIM [17] extend interest modeling to long behavior sequences through memory and retrieval mechanisms.
Despite these advances, existing methods primarily model user preferences through sequence-level representations or target-aware aggregation, where the candidate item is explicitly available. In contrast, SID-based generative retrieval makes a sequence of hierarchical branch decisions, with only a partial target prefix available at each decoding step. Consequently, the relevant user evidence may vary across SID levels and candidate branches, making static user representations or conventional target-aware attention insufficient for fine-grained personalization. To address this distinction, SPAR organizes long-term user behaviors into compact memories at multiple SID-tree depths and models recent interactions through the autoregressive backbone. More importantly, it dynamically retrieves relevant historical evidence conditioned on the current SID prefix, enabling stepwise personalization at the branch-decision level rather than relying solely on sequence-level user representations.
3 Method
3.1 Overview
SPAR consists of three stages, as illustrated in Figure 2: RQ-PIB constructs prefix-balanced SIDs offline; PATH Decoder retrieves prefix-relevant long-term evidence and fuses it with recent behavior, profile, and event context for next-token prediction; and preference alignment adapts the generator to recent request-time preferences.
3.2 PATH Decoder: Personalized Adaptive Tree-aware Hybrid Decoder
To support stepwise personalized decoding, we design the PATH Decoder, which consists of two key components: (1) a sequence-evidence module that integrates long-term tree-view memories with recent interactions through prefix-conditioned memory retrieval, and (2) hybrid decision tokens that incorporate user-profile and event context into the decoding process.
Long-term Coarse-to-fine history views. Let the long-term history be , ordered chronologically. We construct three history views from cumulative SID prefixes, where denotes the SID layer, and is the total number of SID layers:
(1)
Here, is an SID embedding table, while the position and level embeddings identify interaction order and SID depth. The sequences , , retain one-, two-, and three-token prefixes, respectively, capturing user interests at progressively finer SID resolutions. These views align historical interactions with different depths of the SID tree, so the decoder can access coarse interests near the root and fine-grained preferences near deeper prefix nodes.
Long-term memory compression. Each history view is compressed with a Q-Former-style encoder [11]. We use a separate bank of learnable queries for each view and share the encoder parameters :
The shared encoder extracts behavioral patterns across resolutions, while the view-specific queries produce compact memories that retain their respective hierarchical information.
Recent SID sequence backbone. The decoder-only backbone receives the recent interaction history as a sequence of SID tokens. Let m denote the number of recent interactions included in the decoder context, and let be the j-th recent item, its input block and the resulting backbone context are
(3)
All interactions precede the target item. Before predicting SID position , the backbone computes
This state summarizes the recent SID history and the generated target prefix. Long-term memories, profile information, and event
A. RQ-PIB: Prefix-balanced SID construction
Item embeddings
- Residual semantic quantization
Residual K-Means shared codewords
Freeze codewords + group by prefix
- Inspect sibling loads
p = a1 b2
c1
c2
c3
12
4
10
Overloaded
Available
No room for i*
Historical-load cap (example)
- Min-added-distortion repair

Prefix-balanced SIDs + valid trie
B. PATH Decoder: Personalized adaptive tree-aware hybrid decoder

Append the next token to the generated target prefix
C. Preference-aligned training

Figure 2: Overall framework of SPAR. (A) RQ-PIB regulates historical interaction load among sibling branches under the same parent prefix while limiting additional semantic distortion. (B) PATH Decoder retrieves relevant information from coarse-to-fine long-term user memories according to the current decoding state and generated prefix, and integrates it with recent behavior, user profiles, and event context for next-token prediction. (C) Preference-aligned training constructs DPO pairs from beam-search candidates using a reward model and jointly optimizes the supervised fine-tuning (SFT) and DPO objectives.
context enter through the output-side modules described below. It forms the short-term sequence state used to retrieve prefix-relevant evidence from the long-term memory banks
Prefix-conditioned memory reading. The compressed memories are concatenated along the token dimension as . This step connects the two sequence streams: the recent-prefix state queries the compressed long-term memories through cross-attention. Here, denotes the -th memory token in the long-term memory sequence of user . For one attention head:
The attention weights and retrieved information are then computed as
Attention is normalized over all memory tokens, allowing each decoding step to select information both within and across history views. Because encodes the current prefix , the attention weights are specific to the current tree node rather than shared across all decoding steps. All three banks remain accessible at every SID position. The multi-head implementation concatenates the head outputs and applies an output projection.
Hybrid decoder decision tokens. The sequence-evidence path captures what the user has done at both long-term and recent horizons. However, the next branch decision may also depend on who the user is and under which request-time context the decision is made. This motivates the hybrid design of PATH Decoder, which combines sequential behavioral evidence with two lightweight non-sequential decision tokens. Profile-field embeddings are concatenated into and projected into a User Token:
Here, , , and , , are learnable projection matrices and bias terms, and denotes element-wise multiplication. Let denote the event features available before prediction. The corresponding Event Token is
Here, is a learnable base event embedding, indexes an event-feature field, is the corresponding discretized feature value,

Figure 3: Historical traffic concentration of the top 1% and top 5% SID paths across prefix depths.
and is its embedding table. The User Token provides profile-derived user-bias information, while the Event Token supplies event context. Both participate in the output-side fusion. The final output-side prediction then concatenates the backbone state, retrieved memory, User Token, and Event Token at each decoding step:
The fused representation is projected to the vocabulary at the current SID level:
(10)
Here, denotes the overall user conditions, whereas denotes the SID-only backbone input. The MLP combines prefix-dependent behavioral evidence with profile and event information before token prediction. The compressed memories and their key/value projections can be reused across decoding steps and beams.
Supervised fine-tuning (SFT). We first train the model with supervised fine-tuning using next-item maximum likelihood:
The loss is computed only on the target item's SID; the historical SID tokens serve as context.
3.3 RQ-PIB: Prefix-Balanced Semantic ID Construction
Autoregressive SID decoding makes branch balance a prefix-local issue. At level , a partial SID specifies a parent prefix , and predicting selects one child branch under this parent. Thus, the relevant load is the relative historical load among sibling branches under the same prefix, not merely the global usage of a codeword at a level.
Popular SID paths can acquire a frequency-driven advantage in next-token prediction, making it harder for user-specific evidence to influence branch selection. Figure 3 reveals pronounced concentration in historical path load: the top 1% of paths account for 47.3%, 63.17%, and 71.26% of the total load at prefix depths one, two, and three, respectively. The corresponding shares for the top 5% are 72.46%, 81.79%, and 85.43%. Paths are ranked independently at each depth by their aggregated historical load. This concentration motivates mitigating Matthew-effect amplification, in which already popular paths may gain further advantages during model learning.
RQ-PIB, summarized in Algorithm 1, constructs semantic IDs with prefix-balanced branch organization. It first learns a shared semantic codebook through residual clustering, then rebalances overloaded child branches within each parent prefix using minimum-distortion item moves. This preserves the semantic structure of residual quantization while reducing local branch dominance during autoregressive decoding.
Residual semantic clustering Let denote the embedding of item , and let be codeword at level . Given the codes assigned at previous levels, the current residual is
At the first level, . We initialize shared centers with K-Means++ and run standard K-Means on the residuals until convergence, alternating nearest-center assignment and mean-center updates. Let denote the resulting assignment. The converged centers remain fixed during the subsequent prefix-balancing stage, so later reassignment changes only branch membership, not the semantic codebook.
Prefix-level load upper bound. Let denote the historical interaction count of item , computed from training-period records. For a parent prefix at level , define
(13)
Here, is the item set under parent prefix , is its total load, is the largest single-item load, is the load of child branch , and is the average load per child branch. The average load gives a natural balancing target, but item weights are indivisible: a single heavy item or a sparse parent group can make a bound based only on infeasible. We therefore use the effective load upper bound
and impose . Here, is the branch-load upper bound and is a level-specific load tolerance. The first term controls the desired tolerance, while the second accounts for item granularity; the bound is computed per parent prefix, with the first level using the empty prefix.
Minimum-distortion branch rebalancing. After residual K-Means converges, RQ-PIB freeze the centers and repair each parent group independently. For a positive-weight item i in an overloaded branch
Algorithm 1 RQ-PIB: Prefix-Balanced SID Construction
Require: Item embeddings , weights , codebook sizes , tolerances
Ensure: Prefix-balanced SIDs and shared codebooks
1: for do 2: Compute residuals 3: Run K-Means to obtain and assignments 4: Freeze codebook and group items by prefix 5: for all parent groups do 6: Compute branch loads and upper bound (Eq. 14) 7: while do 8: Select an overloaded branch 9: Find feasible moves satisfying 10: Select with minimum distortion increase 11: Reassign and update branch loads 12: end while 13: end for 14: Set for all 15: end for 16: return Item SIDs and shared codebooks
, define
(15)
Here, is the feasible destination set, is the closest feasible branch in residual space, and is the additional reconstruction cost of moving from to .
We relocate the item with the smallest within the selected overloaded branch, update the source and destination loads, and recompute the feasible destinations before the next move. All codewords, including currently empty branches, are eligible destinations. The rule minimizes the current feasible move cost, without claiming global optimality or perfectly equal branch loads.
Feasibility and termination. Under Eq. (14), every positive-weight item in an overloaded branch has a feasible destination when all codewords are available and no additional assignment constraints are imposed. Each move respects the bound and moves an item at most once, so rebalancing terminates within moves; groups with or require no repair. The greedy procedure claims neither global optimality nor exact load equality, and does not remove intrinsic item popularity or guarantee future exposure balance.
3.4 Preference Alignment
Given a recent request prompt , constrained beam search returns valid items, which are scored by a frozen ranking model . The top- and bottom- candidates form all preference pairs. For an item , let denote the sum of its SID-token log-probabilities. Against the frozen SFT reference , we optimize the standard
Table 1: Overall retrieval performance. The best results are boldfaced, and the second-best results are underlined.
| Method | HR@10 | HR@20 | HR@50 | HR@100 |
|---|---|---|---|---|
| GRU4Rec | ||||
| SASRec | ||||
| TIGER | ||||
| OneRec | ||||
| SPAR |
DPO objective:
(16)
To preserve supervised next-item generation, we jointly optimize recent clicked examples:
(17)
where controls the alignment weight.
3.5 Offline Experiments
3.5.1 Experimental Setup
Dataset and evaluation protocol. We use large-scale production logs collected from Youku's homepage recommendation scenario. SFT uses several months of playback logs, while daily DPO uses recent request contexts whose beam-search candidates are scored by a frozen ranking model trained with click and watch-time feedback. Users are split into training, validation, and test sets at a ratio of 90:5:5.
Evaluation metrics. We report Hit Ratio at (HR@K) for offline evaluation and relative improvements over the production Base in Play Conversion Rate (PCR), Time Spent per User (TS/User), and Total Time Spent (Total TS) for online evaluation.
Model and training configuration. Unless stated otherwise, we use Qwen3-0.6B as the decoder-only backbone and represent each item with a fixed three-level RQ-PIB SID constructed from training-set interaction counts, as described in Section 3.3. We train the supervised model with AdamW using a learning rate of . For the preference alignment stage in Section 3.4, we set and . At inference, trie-constrained beam search is used to ensure valid SID generation.
Baselines. We compare SPAR with item-space sequential recommenders GRU4Rec [5] and SASRec [9], and Semantic-ID-based generative recommenders TIGER [18] and OneRec [3].
3.5.2 Evaluation Results. Table 1 shows that SPAR achieves the best performance across all cutoffs. Compared with the strongest baseline OneRec, HR@10 increases from 0.4648 to 0.4831 and HR@50 from 0.5828 to 0.5947, corresponding to relative gains of 3.94% and 2.04%, respectively. Averaged over HR@10/20/50/100, SPAR improves the strongest baseline by 2.66%. The following ablations
(a) Token NLL

(b) Prefix Retention
(c) Branch Concentration
Figure 4: SID-level decoding and prefix-conditioned traffic concentration analysis. (a) Held-out token NLL. (b) Beam-search target-prefix retention. (c) Traffic-weighted largest child-branch share.
Table 2: Effect of backbone scale on next-item retrieval.
| Backbone | HR@10 | HR@20 | HR@50 | HR@128 |
|---|---|---|---|---|
| Qwen3-0.6B | 0.4831 | 0.5662 | 0.5947 | 0.6124 |
| Qwen3-1.7B | 0.4969 | 0.5783 | 0.6060 | 0.6214 |
| Qwen3-4B | 0.5052 | 0.5856 | 0.6128 | 0.6278 |
isolate the effects of user information, stepwise memory reading, SID construction, and DPO.
3.5.3 Analysis of PATH Decoder. To examine how SPAR affects individual decoding decisions, we analyze held-out token negative log-likelihood (NLL) at each SID level and target-prefix retention during beam search. These metrics characterize conditional token prediction and the preservation of target paths during generation, respectively.
Token prediction across SID levels. As shown in Figure 4(a), SPAR consistently reduces held-out token NLL at all three SID levels. At the first level, NLL decreases from 4.81 to 3.79, corresponding to a relative reduction of 21.21%. At the second and third levels, NLL decreases from 1.23 to 0.86 and from 0.25 to 0.17, yielding relative reductions of 30.08% and 32.00%, respectively.
These improvements indicate that SPAR assigns higher conditional likelihood to the target tokens throughout the SID hierarchy. In particular, the reductions at the second and third levels show improved target-token prediction after the preceding target prefix has been specified. The results are consistent with the benefit of incorporating user information into successive branch decisions. Our analysis focuses on comparisons between models at the same SID level, since vocabulary sizes and conditioning contexts differ across levels.
Target-path retention during beam search. Figure 4(b) examines whether the target prefix remains in the beam as decoding proceeds. For Base, the retention rate decreases from 74.23% at the first level to 67.15% at the second level and 56.24% at the third level. The latter two transitions correspond to decreases of 7.08 and 10.91 percentage points, respectively, illustrating the progressive loss of target paths during generation.
Prefix retention complements the teacher-forced NLL analysis: NLL evaluates the next-token prediction given a correct prefix, whereas retention measures whether the target path remains available under the model's actual decoding decisions. Together, these measurements provide a basis for examining whether improvements in conditional prediction translate into better preservation of target paths.
3.5.4 Ablation Study. Table 3 groups ablations by user information, memory-reading strategy, SID construction, and preference alignment. All variants in Parts (a)–(c) are trained with SFT only and do not use DPO. Part (d) starts from the complete SPAR SFT checkpoint and evaluates the additional effect of DPO while keeping the SID mapping, model architecture, and decoding configuration unchanged.
Contribution of user information. Part (a) shows that each information source improves all reported cutoffs. Event Token gives the largest individual average gain (+1.34 pp), while long-term SID memories and User Token add +0.62 and +0.67 pp. Combining all sources in SPAR yields +3.55 pp on average over Base.
Effect of PATH Decoder. Part (b) shows that replacing PATH Decoder with First-step Reuse reduces the average gain from +3.55 to +2.70 pp, isolating the value of prefix-adaptive memory access.
Effect of RQ-PIB. Part (c) evaluates the proposed Prefix-Capacitated SID Construction by comparing three strategies: ordinary RQ-KMeans, which performs residual semantic clustering without load constraints; Global Capacity-Constrained RQ-KMeans, which balances codeword loads independently of preceding prefixes; and RQ-PIB, which balances child-branch loads within each parent prefix to align with autoregressive decoding. All variants share identical user information, model configurations, and training settings.
As shown in Table 3, global capacity constraints yield slightly lower performance than ordinary RQ-KMeans, suggesting that balancing aggregate codeword loads alone is insufficient. In contrast,
Table 3: Ablation study of SPAR. Part (a) adds individual information sources to Base. Part (b) compares memory-reading strategies with all information sources retained. Part (c) compares SID construction methods while retaining all information sources and stepwise memory reading. Part (d) evaluates DPO using the complete SPAR model as the starting point. Avg. Gain denotes the average absolute improvement over Base across the four metrics, measured in percentage points. The best result within each ablation block is boldfaced.
| Variant | HR@1 | HR@5 | HR@10 | HR@20 | Avg. Gain (pp) |
|---|---|---|---|---|---|
| (a) Contribution of user information | |||||
| Base | 0.1759 | 0.3582 | 0.4424 | 0.5284 | - |
| Base + Event Token | 0.1862 | 0.3750 | 0.4578 | 0.5396 | +1.34 |
| Base + Long-term SID Memories | 0.1802 | 0.3657 | 0.4496 | 0.5341 | +0.62 |
| Base + User Token | 0.1806 | 0.3661 | 0.4502 | 0.5347 | +0.67 |
| (b) Memory reading with all information sources | |||||
| SPAR (First-step Reuse) | 0.1930 | 0.3890 | 0.4740 | 0.5570 | +2.70 |
| SPAR (Stepwise) | 0.1991 | 0.3984 | 0.4831 | 0.5662 | +3.55 |
| (c) SID construction | |||||
| SPAR (RQ-KMeans) | 0.1794 | 0.3549 | 0.4320 | 0.5385 | 0.00 |
| SPAR (Global Capacity-Constrained) | 0.1791 | 0.3546 | 0.4314 | 0.5380 | -0.05 |
| SPAR (RQ-PIB) | 0.1991 | 0.3984 | 0.4831 | 0.5662 | +3.55 |
| (d) DPO preference alignment | |||||
| SPAR (w/o DPO) | 0.1991 | 0.3984 | 0.4831 | 0.5662 | +3.55 |
| SPAR (SFT + DPO) | 0.2076 | 0.4035 | 0.4950 | 0.5719 | +4.33 |
RQ-PIB consistently outperforms both baselines, achieving absolute gains of 2.00, 4.38, 5.17, and 2.82 percentage points over the global variant on HR@1, HR@5, HR@10, and HR@20, respectively. These results highlight the importance of prefix-conditioned load balancing in SID construction.
Effect of DPO preference alignment. Part (d) of Table 3 compares the complete SPAR model with its DPO-aligned counterpart. Both variants use the same SID mapping, model architecture, and decoding configuration, with DPO applied to the complete SFT checkpoint.
DPO improves HR@1, HR@5, HR@10, and HR@20 from 0.1991, 0.3984, 0.4831, and 0.5662 to 0.2076, 0.4035, 0.4950, and 0.5719, respectively. These improvements correspond to relative gains of 4.27%, 1.28%, 2.46%, and 1.01%, with an average absolute improvement of 0.78 percentage points over the SFT model. The largest relative improvement is observed at HR@1, while positive gains are maintained at all larger cutoffs. These results support the additional retrieval benefits of DPO alignment on top of prefix-capacitated SID construction and stepwise personalized decoding.
3.5.5 Effect on prefix-conditioned traffic concentration. Figure 4(c) compares the traffic-weighted largest child-branch share at each SID level under ordinary RQ-KMeans and RQ-PIB. RQ-PIB reduces this share from 9.8% to 6.4% at Level 1, from 36.4% to 23.2% at Level 2, and from 65.7% to 47.6% at Level 3. These changes correspond to absolute reductions of 3.4, 13.2, and 18.1 percentage points, or relative reductions of 34.69%, 36.26%, and 27.55%, respectively. The
Table 4: Online A/B test results in Youku's homepage recommendation scenario. Values indicate relative improvements over the production Base model.
| Metric | Relative Improvement |
|---|---|
| Play Conversion Rate | +3.38% |
| Time Spent per User | +3.95% |
| Total TS Duration | +3.98% |
consistently lower values indicate that, on a traffic-weighted basis, the constructed hierarchy is less dominated by its highest-load child branches. The reductions at Levels 2 and 3 further show that this improvement extends beyond the root to branching decisions conditioned on single-token and two-token prefixes. These results support the effectiveness of our SID construction strategy in controlling prefix-conditioned load concentration at the branching points used by autoregressive decoding.
3.5.6 Scaling with Model Size. Table 2 studies Qwen3 backbones with 0.6B, 1.7B, and 4B parameters under the same data, SID codebooks, long-history encoder, and evaluation protocol. Larger backbones consistently improve retrieval, but the gain from 1.7B to 4B is smaller than from 0.6B to 1.7B, suggesting diminishing returns and making 1.7B a favorable quality-capacity trade-off in our setting.
3.6 Online A/B Tests
We deploy SPAR in Youku’s production recommendation system and conduct an online A/B test in the homepage scenario. The experiment consists of two user buckets, each receiving approximately 10% of the total traffic. The control bucket is served by the production Base model, while the treatment bucket deploys the complete SPAR model after SFT and DPO alignment. As shown in Table 4, SPAR improves Play Conversion Rate by 3.38%, TS Value per User by 3.95%, and Total TS Duration by 3.98% over the Base model. The simultaneous improvements in playback conversion and time-spent metrics indicate that SPAR not only increases the likelihood that a recommended item triggers playback, but also improves the subsequent watch-time outcome, demonstrating its effectiveness in Youku’s production environment.
4 Conclusion
In this paper, we presented SPAR, an industrial generative recommendation framework combining RQ-PIB and PATH Decoder to address popularity-driven branch imbalance and insufficient stepwise personalization. RQ-PIB balances historical interaction loads among sibling branches while preserving semantic reconstruction quality, mitigating local branch concentration. PATH Decoder retrieves relevant long-term user memories conditioned on the current decoding state and generated prefix, integrating them with recent behaviors, user profiles, and event context to guide each SID token decision. Together, these components improve branch organization and stepwise personalized decoding.
Offline experiments on Youku’s production recommendation data show that SPAR outperforms the strongest baseline, achieving an average relative improvement of 2.66% across HR@10/20/50/100. Further analysis confirms improvements in target-prefix retention and historical traffic balance. A 7-day online A/B test on 10% of Youku’s production traffic further demonstrates gains of 3.95% in average watch time per user and 3.38% in play conversion rate. These results demonstrate the effectiveness of SPAR in improving retrieval accuracy, hierarchical decoding reliability, and user engagement in large-scale generative recommendation.
5 Acknowledgments
This work was supported by HUJING Digital Media & Entertainment Group through the HUJING Digital Media & Entertainment Research Intern Program, the STI 2030—Major Projects (Grant No. 2024ZD0523903), and the National Natural Science Foundation of China (Grant Nos. T2293771 and 42361144718).
References
[1] Keqin Bao, Jizhi Zhang, Yang Zhang, Wenjie Wang, Fuli Feng, and Xiangnan He. 2023. Tallrec: An effective and efficient tuning framework to align large language model with recommendation. In Proceedings of the 17th ACM conference on recommender systems. 1007–1014.
[2] Paul Covington, Jay Adams, and Emre Sargin. 2016. Deep neural networks for youtube recommendations. In Proceedings of the 10th ACM conference on recommender systems. 191–198.
[3] Jiaxin Deng, Shiyao Wang, Kuo Cai, Lejian Ren, Qigen Hu, Weifeng Ding, Qiang Luo, and Guorui Zhou. 2025. Onerec: Unifying retrieve and rank with generative recommender and iterative preference alignment. arXiv preprint arXiv:2502.18965 (2025).
[4] Shijie Geng, Shuchang Liu, Zuohui Fu, Yingqiang Ge, and Yongfeng Zhang. 2022. Recommendation as Language Processing (RLP): A Unified Pretrain, Personalized
Prompt & Predict Paradigm (P5). In Proceedings of the 16th ACM Conference on Recommender Systems. ACM, 299–315. doi:10.1145/3523227.3546767
[5] Balázs Hidasi, Alexandros Karatzoglou, Linas Baltrunas, and Domonkos Tikk. 2016. Session-based Recommendations with Recurrent Neural Networks. In International Conference on Learning Representations. https://arxiv.org/abs/1511.06939
[6] Yupeng Hou, Jiacheng Li, Ashley Shin, Jinsung Jeon, Abhishek Santhanam, Wei Shao, Kaveh Hassani, Ning Yao, and Julian McAuley. 2025. Generating long semantic ids in parallel for recommendation. In Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2. 956–966.
[7] Yupeng Hou, Shanlei Mu, Wayne Xin Zhao, Yaliang Li, Bolin Ding, and Ji-Rong Wen. 2022. Towards universal sequence representation learning for recommender systems. In Proceedings of the 28th ACM SIGKDD conference on knowledge discovery and data mining. 585–593.
[8] Zheng Hu, Yuxin Chen, Yongsen Pan, Xu Yuan, Yuting Yin, Daoyuan Wang, Boyang Xia, Zefei Luo, Hongyang Wang, Songhao Ni, et al. 2026. Stop treating collisions equally: Qualification-aware semantic id learning for recommendation at industrial scale. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2. 7401–7411.
[9] Wang-Cheng Kang and Julian McAuley. 2018. Self-Attentive Sequential Recommendation. In 2018 IEEE International Conference on Data Mining (ICDM). IEEE, 197–206. doi:10.1109/ICDM.2018.00035
[10] Chao Li, Zhiyuan Liu, Mengmeng Wu, Yuchi Xu, Huan Zhao, Pipel Huang, Guoliang Kang, Qiwei Chen, Wei Li, and Dik Lun Lee. 2019. Multi-Interest Network with Dynamic Routing for Recommendation at Tmall. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management. ACM, 2615–2623. doi:10.1145/3357384.3357814
[11] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. 2023. Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. In International conference on machine learning. PmLR, 19730–19742.
[12] Jiacheng Li, Ming Wang, Jin Li, Jinniao Fu, Xin Shen, Jingbo Shang, and Julian McAuley. 2023. Text is all you need: Learning language representations for sequential recommendation. In Proceedings of the 29th ACM SIGKDD conference on knowledge discovery and data mining. 1258–1267.
[13] Yaoyiran Li, Xiang Zhai, Moustafa Alzantot, Keyi Yu, Ivan Vulić, Anna Korhonen, and Mohamed Hammad. 2024. Calrec: Contrastive alignment of generative llms for sequential recommendation. In Proceedings of the 18th ACM Conference on Recommender Systems. 422–432.
[14] Jianghao Lin, Rong Shan, Chenxu Zhu, Kounianhua Du, Bo Chen, Shigang Quan, Ruiming Tang, Yong Yu, and Weinan Zhang. 2024. Rella: Retrieval-enhanced large language models for lifelong sequential behavior comprehension in recommendation. In Proceedings of the ACM Web Conference 2024. 3497–3508.
[15] Qijiong Liu, Jiaren Xiao, Lu Fan, Jieming Zhu, and Xiao-Ming Wu. 2024. Learning category trees for ID-based recommendation: exploring the power of differentiable vector quantization. In Proceedings of the ACM Web Conference 2024. 3521–3532.
[16] Qi Pi, Weijie Bian, Guorui Zhou, Xiaoqiang Zhu, and Kun Gai. 2019. Practice on Long Sequential User Behavior Modeling for Click-Through Rate Prediction. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 2671–2679. doi:10.1145/3292500.3330666
[17] Qi Pi, Guorui Zhou, Yujing Zhang, Zhe Wang, Lejian Ren, Ying Fan, Xiaoqiang Zhu, and Kun Gai. 2020. Search-based User Interest Modeling with Lifelong Sequential Behavior Data for Click-Through Rate Prediction. In Proceedings of the 29th ACM International Conference on Information & Knowledge Management. ACM, 2685–2692. doi:10.1145/3340531.3412744
[18] Shashank Rajput, Nikhil Mehta, Anima Singh, Raghunandan Hulikal Keshavan, Trung Vu, Lukasz Heldt, Lichan Hong, Yi Tay, Vinh Tran, Jonah Samost, et al. 2023. Recommender systems with generative retrieval. Advances in Neural Information Processing Systems 36 (2023), 10299–10315.
[19] Fei Sun, Jun Liu, Jian Wu, Changhua Pei, Xiao Lin, Wenwu Ou, and Peng Jiang. 2019. BERT4Rec: Sequential recommendation with bidirectional encoder representations from transformer. In Proceedings of the 28th ACM international conference on information and knowledge management. 1441–1450.
[20] Wenjie Wang, Honghui Bao, Xinyu Lin, Jizhi Zhang, Yongqi Li, Fuli Feng, See-Kiong Ng, and Tat-Seng Chua. 2024. Learnable Item Tokenization for Generative Recommendation. In Proceedings of the 33rd ACM International Conference on Information and Knowledge Management. ACM, 2400–2409. doi:10.1145/3627673.3679569
[21] Ziliang Wang, Gaoyun Lin, Xuesi Wang, Shaoqiang Liang, Yili Huang, Weijie Bian, Li Zhang, Mingchen Cai, Jian Dong, and Guanxing Zhang. 2026. UniRec: Bridging the Expressive Gap between Generative and Discriminative Recommendation via Chain-of-Attribute. arXiv preprint arXiv:2604.12234 (2026).
[22] Zhiyu Yao, Xinyang Chen, Sinan Wang, Qinyan Dai, Yumeng Li, Tanchao Zhu, and Mingsheng Long. 2024. Recommender transformers with behavior pathways. In Proceedings of the ACM Web Conference 2024. 3643–3654.
[23] Jun Yin, Zhengxin Zeng, Mingzheng Li, Hao Yan, Chaozhuo Li, Weihao Han, Jianjin Zhang, Ruochen Liu, Hao Sun, Weiwei Deng, et al. 2025. Unleash llms potential for sequential recommendation by coordinating dual dynamic index mechanism. In Proceedings of the ACM on Web Conference 2025. 216–227.
[24] Hansi Zeng, Chen Luo, Bowen Jin, Sheikh Muhammad Sarwar, Tianxin Wei, and Hamed Zamani. 2024. Scalable and effective generative information retrieval. In Proceedings of the ACM Web Conference 2024. 1441–1452.
[25] Jiaqi Zhai, Lucy Liao, Xing Liu, Yueming Wang, Rui Li, Xuan Cao, Leon Gao, Zhaojie Gong, Fangda Gu, Jiayuan He, Yinghai Lu, and Yu Shi. 2024. Actions Speak Louder than Words: Trillion-Parameter Sequential Transducers for Generative Recommendations. In Proceedings of the 41st International Conference on Machine Learning (Proceedings of Machine Learning Research, Vol. 235). PMLR, 58484–58509. https://proceedings.mlr.press/v235/zhai24a.html
[26] Bowen Zheng, Yupeng Hou, Hongyu Lu, Yu Chen, Wayne Xin Zhao, Ming Chen, and Ji-Rong Wen. 2024. Adapting large language models by integrating collaborative semantics for recommendation. In 2024 IEEE 40th International Conference on Data Engineering (ICDE). IEEE, 1435–1448.
[27] Guorui Zhou, Hengrui Hu, Hongtao Cheng, Huanjie Wang, Jiaxin Deng, Jinghao Zhang, Kuo Cai, Lejian Ren, Lu Ren, Liao Yu, Pengfei Zheng, Qiang Luo, Qianqian Wang, Qigen Hu, Rui Huang, Ruiming Tang, Shiyao Wang, Shujie Yang, Tao Wu, Wuchao Li, Xinchen Luo, Xingmei Wang, Yi Su, Yunfan Wu, Zexuan Cheng, Zhanyu Liu, Zixing Zhang, Bin Zhang, Boxuan Wang, Chaoyi Ma, Chengru Song, Chenhui Wang, Chenglong Chu, Di Wang, Dongxue Meng, Dunju Zang, Fan Yang, Fangyu Zhang, Feng Jiang, Fuxing Zhang, Gang Wang, Guowang Zhang, Han Li, Honghui Bao, Hongyang Cao, Jiaming Huang, Jiapeng Chen, Jiaqiang Liu, Jinghui Jia, Kun Gai, Lantao Hu, Liang Zeng, Qiang Wang, Qidong Zhou, Rongzhou Zhang, Shengzhe Wang, Shihui He, Shuang Yang, Siyang Mao, Sui Huang, Tiantian He, Tingting Gao, Wei Yuan, Xiao Liang, Xiaoxiao Xu,
Xugang Liu, Yan Wang, Yang Zhou, Yi Wang, Yiwu Liu, Yue Song, Yufei Zhang, Yunfeng Zhao, Zhixin Ling, and Ziming Li. 2025. OneRec-V2 Technical Report. arXiv:2508.20900 [cs.IR]
[28] Guorui Zhou, Na Mou, Ying Fan, Qi Pi, Weijie Bian, Chang Zhou, Xiaoqiang Zhu, and Kun Gai. 2019. Deep Interest Evolution Network for Click-Through Rate Prediction. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 33. 5941–5948. doi:10.1609/aaai.v33i01.33015941
[29] Guorui Zhou, Chengru Song, Xiaoqiang Zhu, Ying Fan, Han Zhu, Xiao Ma, Yanghui Yan, Junqi Jin, Han Li, and Kun Gai. 2018. Deep Interest Network for Click-Through Rate Prediction. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining. ACM, 1059–1068. doi:10.1145/3219819.3219823
[30] Kun Zhou, Hui Wang, Wayne Xin Zhao, Yutao Zhu, Sirui Wang, Fuzheng Zhang, Zhongyuan Wang, and Ji-Rong Wen. 2020. S3-rec: Self-supervised learning for sequential recommendation with mutual information maximization. In Proceedings of the 29th ACM international conference on information & knowledge management. 1893–1902.
[31] Jieming Zhu, Mengqun Jin, Qijiong Liu, Zexuan Qiu, Zhenhua Dong, and Xiu Li. 2024. Cost: Contrastive quantization based semantic tokenization for generative recommendation. In Proceedings of the 18th ACM Conference on Recommender Systems. 969–974.
[32] Yaochen Zhu, Liang Wu, Qi Guo, Liangjie Hong, and Jundong Li. 2024. Collaborative large language model for recommender systems. In Proceedings of the ACM Web Conference 2024. 3162–3172.