betaFeedback

WorksComputer Science

From Tokens to Behaviors: Rethinking Generative Recommendation for User Trajectory Prediction

Abstract

User behavior trajectory prediction (UBTP) aims to capture how a user's needs evolve over time by predicting the sequence of future interactions from that user's interaction history. Recent generative recommendation (GR) methods address this task through autoregressive generation of semantic IDs (SIDs). However, serial SID decoding couples token generation with behavior state transitions and requires multiple dependent steps per interaction. Discrete item feedback overlooks predictive uncertainty, and teacher-forced training leaves a training-inference gap in trajectory generation. To address these limitations, we propose TraGR, a behavior-aware generative recommendation framework that aligns generation, feedback, and learning with successive user behaviors. Its behavior-level architecture predicts SID tokens in parallel within each interaction and models behavioral transitions through recurrent state updates, with joint SID and item-level supervision. Probability feedback combines the selected behavior with a probability-weighted summary of alternatives to guide subsequent predictions. Relation-aware trajectory learning incorporates collaborative transition signals and later credit assignment into training on model-generated trajectories. Experiments on four public datasets demonstrate that TraGR consistently outperforms state-of-the-art baselines across different prediction horizons. Code: https://github.com/CalmaQi/GR4UBT.

Introduction

Recommender systems play an important role in helping users discover relevant items from large catalogs [1, 2, 3, 4]. Personalized recommendation mainly needs to learn what users like from their past interactions. Since these interactions unfold over time, sequential recommendation has been developed to learn from historical user–item interactions and predict the next item a user is likely to interact with, yielding remarkable success in both academia and industry [5, 6, 7, 8, 9]. Recent advances in large language models (LLMs) [10, 11, 12] have popularized generative recommendation (GR), shifting recommendation from scoring items to generating their identifiers. A prominent approach represents items as Semantic IDs (SIDs) and autoregressively generates their constituent tokens conditioned on the user’s interaction history [13]. This formulation brings user preference modeling and item prediction into a unified sequence generation framework.

Despite these advances, most sequential and generative recommendation methods remain focused on next item prediction [14, 15, 16, 17]. While effective for anticipating an immediate interaction, this objective provides only a limited view of how user behavior unfolds over time. Understanding and predicting a user’s subsequent course of actions is important for anticipating related needs and enabling more proactive recommendation. For example, a user may purchase running shoes, followed by sports socks and a water bottle, as illustrated in Figure 1(a). Predicting only the next purchase captures one part of this progression, whereas forecasting the sequence reveals how related behaviors follow one another. User Behavior Trajectory Prediction (UBTP) aims to capture this broader progression by forecasting an ordered sequence of future interactions from a user’s history [18, 19]. Unlike a next item ranked list, whose items are alternative candidates for a single future interaction, a predicted trajectory contains behaviors at successive future positions.

Figure 1. Generative recommendation for user trajectory prediction. (a) Next item prediction considers candidates as alternatives for one interaction, whereas a trajectory contains items at successive future positions. (b) With socks selected, item-only feedback may predict more socks, while a probability summary retains support for running shoes and guides the next prediction. (c) Model-generated trajectories require relation-aware learning to address the training–inference gap.

Recent work has begun to explore this direction. LPDO [18] employs diffusion with listwise preference optimization to model future trajectories. MaskGR [20] explores multi-item recommendation through masked diffusion over SIDs. EchoRec [21] combines supervision from future interactions with cycle-consistent preference alignment to enhance generative recommendation. GCB [19] extends SID-based GR to trajectory prediction, autoregressively generating the semantic tokens of successive items so that earlier generated behaviors provide context for later predictions. However, extending SID-based generation from a single item to a behavior trajectory also exposes limitations in decoding, information propagation, and learning. Token-autoregressive decoding intertwines within-item SID generation with across-item behavior transitions. Passing selected items forward without explicit predictive uncertainty feedback leaves useful information about alternative behaviors behind. Moreover, teacher-forced likelihood training learns to continue observed behavior prefixes, whereas inference requires the model to continue its own predictions. We identify the following three key limitations.

First, a mismatch between token-level generation and behavior-level dependencies. Serial decoding uses the same autoregressive process to construct each item’s semantic code and move between successive items [22]. This requires multiple dependent decoding steps per behavior and leaves transitions between complete interactions implicit in the token sequence. Second, the neglect of predictive uncertainty during trajectory rollout. Autoregressive methods typically pass selected items to later predictions [19], although these intermediate behaviors have not yet been observed. In Figure 1(b), socks are selected with probability 50%, while running shoes also receive 35%. The socks embedding alone does not convey this alternative support: it may lead to another sock prediction, whereas the candidate probabilities provide useful context for predicting running shoes next. Third, lack of relation-aware learning to bridge the training–inference gap in trajectory generation. Models learn from observed prefixes in training but rely on their own predictions at inference [19, 23, 24]. In Figure 1(c), the behavior at t+2t + 2 should be evaluated by its current accuracy, the collaborative transition from t+1t + 1, and its contribution to predicting t+3t+3. Yet likelihood supervision under observed prefixes does not directly evaluate these generated transitions or assign later prediction rewards to earlier choices.

To address these limitations, we propose TraGR, a behavior-aware generative recommendation framework that aligns generation, feedback, and learning with successive user behaviors. To resolve the granularity mismatch, we build a behavior-level generation architecture on OPQ tokenization and parallel SID prediction. At each step, parallel SID predictions define a distribution over items, and a recurrent behavioral state advances once per item interaction. Joint SID and item-level supervision learns semantic representations and ordered behavior dependencies. To retain predictive uncertainty during trajectory generation, we introduce probability feedback. This mechanism combines the selected item’s representation with a candidate summary weighted by both predicted probabilities and similarity to the selected item. The resulting feedback embedding updates the behavioral state, allowing subsequent predictions to use both the selected behavior and information about its plausible alternatives. To bridge the training–inference gap in trajectory generation, we introduce relation-aware trajectory learning. After supervised initialization, the model generates trajectories conditioned on its own predictions. Current candidates are evaluated using observed future targets and directed collaborative transition signals, while later credit assigns subsequent prediction quality to earlier choices. These signals jointly optimize the SID predictor and behavior-state transitions, enabling behavior-level dependencies to be reflected throughout the generation process.

Our main contributions are summarized as follows:

  1. Behavior-level trajectory generation. We integrate parallel SID prediction with recurrent behavior state updates, trained under joint SID and item-level supervision.

  1. Probability feedback. We pass the selected item and a probability-weighted summary of related candidates to the next step, allowing subsequent predictions to use information about current alternatives.

  1. Relation-aware trajectory learning. We combine current candidate evaluation with later credit assignment on model-generated prefixes, learning how each prediction follows preceding behaviors and supports later forecasts.

  1. Comprehensive experimental evaluation. We conduct extensive experiments on four public datasets and demonstrate strong predictive performance against competitive baselines.

Generative Recommendation

Generative recommendation produces item identifiers conditioned on user history. Semantic IDs represent an item with several discrete codes, allowing different items to share semantic components [25]. TIGER [13] constructs hierarchical SIDs through residual quantization and autoregressively generates the codes of the next item. Subsequent work improves how these identifiers incorporate recommendation signals. LC-Rec [26] aligns language and collaborative semantics through learned item indices and alignment tasks, while LETTER [27] incorporates semantic, collaborative, and code-diversity regularization into item tokenization. RPG [28] addresses the cost of sequential code generation by constructing SIDs with optimized product quantization and predicting their code positions in parallel. Other studies introduce collaborative guidance, interaction timing, and future behavior supervision into SID-based recommendation. TCBSA [29] projects item scores from a discriminative recommender onto SID prefixes to guide beam selection at test time, keeping both models frozen. ChronoSID [30] introduces time-gap supervision into item representation learning and interleaves historical time-gap tokens with SIDs to account for elapsed time between interactions. EchoRec [21] connects prediction branches across future positions and uses cycle-consistent preference alignment to learn from multiple future interactions. GCB [19] applies SID generation to predict behavior trajectories. Building on these developments, we study how SID-based generative recommendation can guide the transition between predicted behaviors and support learning from the trajectories.

User Behavior Trajectory Prediction

User behavior trajectory prediction forecasts several successive interactions conditioned on an observed history [31]. Each output position corresponds to a future interaction, making both positional prediction accuracy and dependencies between successive behaviors relevant to the task. LPDO [18] develops a diffusion-based approach and incorporates listwise preference supervision into the prediction of future interaction sequences. MaskGR [20] also explores multi-item recommendation through masked diffusion over SIDs. EchoRec [21] combines supervision from future interactions with cycle-consistent preference alignment to enhance generative recommendation. GCB [19] models future interactions as a concatenated SID sequence and trains its autoregressive generator with teacher-forced token likelihood, using preceding item tokens as context for subsequent predictions. TraGR develops a unified behavior-level formulation for trajectory generation, feedback, and learning. It separates parallel SID prediction within an item from state updates between interactions. Each update receives the selected item together with a probability-weighted summary of its alternatives, allowing the current prediction distribution to inform subsequent predictions. Beyond supervised learning from observed trajectories, we optimize trajectories generated from the model’s own previous predictions.

Multi-Item Recommendation

Multi-item recommendation includes several tasks with different output units. Next-basket methods predict the products associated with the next shopping event. ReCANet [32] explicitly models users’ repeat-purchase patterns, while CASE [33] models item-specific repurchase cycles in calendar time and uses set attention to identify items likely to be purchased again. Although these methods use temporal information from historical purchases, their target is a set of items within the next basket, without a prescribed interaction order among those items. Session-wise recommendation and list- or page-level reranking organize multiple items into a recommendation output. OneRec [34] generates session-wise video lists for a user request and refines them through preference alignment. APCR [35] uses LLM-based pairwise comparisons against a reference item and position-aware reranking to refine recommendation lists. PAR [36] performs page-level reranking by considering interactions within and across lists, together with the spatial relationships among displayed items. These methods aim to improve the quality of a recommended list or page.

UBTP defines its output as a sequence of future user interactions. Each output position predicts the item at a specific future interaction. These interactions need not form a single basket or served session. The prediction target therefore differs from basket membership or page placement: UBTP forecasts which items the user will interact with and in what temporal order. In TraGR, intermediate items are predictions made before the corresponding interactions are observed, and they provide context for subsequent forecasts. We accordingly learn how each prediction follows the preceding behavior and how it supports accurate predictions of later interactions.

Method

Task Definition and Overview

Let I={1,…,N}\mathcal{I} = \{1,\ldots,N\} denote the item catalog, H=(i1,…,in)H = (i_1,\ldots,i_n) an observed interaction history, and Y=(y1,…,yK)Y = (y_1,\ldots,y_K) the next KK interactions in order. Given HH, TraGR predicts an ordered trajectory X=(x1,…,xK)X = (x_1,\ldots,x_K), where xtx_t forecasts the item at the tt-th future interaction.

TraGR maintains a behavioral state that advances once per predicted item. At each step, parallel SID heads produce a distribution over items. The selected item and the current step’s predicted distribution then update the state for the next prediction. Stage I jointly learns SID and item prediction. Stage II learns from model-generated trajectories: it evaluates how each candidate follows the preceding behavior and assigns later prediction quality to earlier choices, with KL regularization to a frozen reference model. At inference, items are selected greedily while the full predicted distribution continues to inform the state update.

Trajectory Generation with Semantic IDs

SIDs and history encoding

Following RPG [28], we apply optimized product quantization (OPQ) to item text features. Each item ii receives a SID c(i)=(c1(i),…,cL(i))c(i) = (c_1(i), \ldots, c_L(i)), with one token from each of LL codebooks. Let Eℓ,v∈RdE_{\ell,v} \in\mathbb{R}^d be the learned embedding of token vv at SID position ℓ\ell. The item representation is the mean of its token embeddings:

eθ(i)=1L∑ℓ=1LEℓ,cℓ(i).(1)e_{\theta}(i) = \frac{1}{L}\sum_{\ell=1}^{L} E_{\ell,c_{\ell}(i)}. \tag*{(1)}

The SID assignments remain fixed while the embedding tables are learned. A causal Transformer encoder initializes the behavioral state from the history sequence:

h1=Enc⁡θ(eθ(i1),…,eθ(in))n,(2)h_1 = \operatorname{Enc}_{\theta}\left(e_{\theta}(i_1),\ldots,e_{\theta}(i_n)\right)_n, \tag*{(2)}

where the subscript nn selects the last history output and θ\theta denotes the trainable generator parameters.

Parallel SID prediction

We follow RPG’s parallel prediction design and use a separate residual head for each SID position. All heads receive the same behavioral state hth_t:

zt,ℓ=ht+fℓ(ht),ℓ=1,…,L,(3)z_{t,\ell} = h_t + f_{\ell}(h_t), \qquad\ell= 1,\ldots,L, \tag*{(3)}

where fℓf_{\ell} is an MLP with output dimension dd. The heads have separate parameters across SID positions and are shared across behavior steps. The SID-token probabilities are

qt,ℓ(v)=softmax⁡v(zt,ℓTEℓ,v/τsid),(4)q_{t,\ell}(v) = \operatorname{softmax}_{v}\left(z_{t,\ell}^{\mathsf{T}} E_{\ell,v}/\tau_{\mathrm{sid}}\right), \tag*{(4)}

Figure 2. Overview of the proposed TraGR. (a) K-step behavior trajectory generation with parallel SID prediction and behavior-level state updates. (b) Probability feedback combines the selected item’s embedding with a feedback embedding weighted by predicted probabilities and similarity to the selected item. (c) Stage I jointly learns next item prediction and teacher-forced trajectory prediction. (d) Stage II learns from model-generated trajectories using position accuracy and collaborative transition rewards, later credit assignment, and KL regularization toward a frozen reference.

where the softmax is over the vocabulary of codebook ℓ\ell. We combine the token probabilities assigned to each item’s SID:

st(i)=1L∑ℓ=1Llog⁡qt,ℓ(cℓ(i)),(5)s_t(i) = \frac{1}{L}\sum_{\ell=1}^{L} \log q_{t,\ell}(c_\ell(i)), \tag*{(5)}
πt(i)=exp⁡(st(i)/τitem)∑j∈Iexp⁡(st(j)/τitem).(6)\pi_t(i) = \frac{\exp(s_t(i)/\tau_{\mathrm{item}})}{\sum_{j\in\mathcal{I}} \exp(s_t(j)/\tau_{\mathrm{item}})}. \tag*{(6)}

The positive temperatures τsid\tau_{\mathrm{sid}} and τitem\tau_{\mathrm{item}} control token and item normalization, respectively. All SID positions are predicted in parallel, and the resulting item distribution is normalized over the catalog. The catalog softmax cancels the codebook-specific log-normalization constants. Consequently, the item distribution is equivalent to a softmax over additive SID logits.

c) Probability feedback: After selecting xtx_t, we combine its representation with a summary of plausible candidates. Let bi∈Rdb_i \in\mathbb{R}^{d} denote the representation used for feedback. Stage I uses the current mean-pooled SID representation bi=eθ(i)b_i = e_\theta(i). We weight each candidate by its predicted probability and its similarity to the selected item:

wt(i)=πt(i)exp⁡(bi⊤bxt/τsim)∑j∈Iπt(j)exp⁡(bj⊤bxt/τsim).(7)w_t(i) = \frac{\pi_t(i)\exp(b_i^\top b_{x_t}/\tau_{\mathrm{sim}})}{\sum_{j\in\mathcal{I}}\pi_t(j)\exp(b_j^\top b_{x_t}/\tau_{\mathrm{sim}})}. \tag*{(7)}

Here τsim>0\tau_{\mathrm{sim}} > 0 controls the similarity weighting. The candidate probability summary and feedback vector are

μt=∑i∈Iwt(i)bi,dt=(1−η)bxt+ημt,(8)\mu_t = \sum_{i\in\mathcal{I}} w_t(i)b_i,\qquad d_t = (1-\eta)b_{x_t}+\eta\mu_t, \tag*{(8)}

where 0≤η<10 \leq\eta< 1 controls the summary’s contribution. The summary is computed over the full catalog, while the selected item retains an explicit contribution to dtd_t. When η>0\eta> 0, the dependence of the weights on πt\pi_t allows later predictions to send gradients to earlier SID probabilities through this feedback.

d) State update: A residual state transition head uses the feedback to advance the behavioral state once per item:

ht+1=ht+MLP⁡tr([LN⁡(ht);LN⁡(dt);ot]),(9)h_{t+1}=h_t+\operatorname{MLP}_{\mathrm{tr}}\left(\left[\operatorname{LN}(h_t);\operatorname{LN}(d_t);o_t\right]\right), \tag*{(9)}

where LN denotes layer normalization, [⋅;⋅][\cdot;\cdot] denotes concatenation, and oto_t is a learned embedding of future step tt. The transition head is shared across steps and is applied for t<Kt<K. Thus, the SID heads operate in parallel within an item, while the transition head connects successive item predictions.

The resulting distribution πt\pi_t depends on HH and the selected prefix x<t=(x1,…,xt−1)x_{<t}=(x_1,\ldots,x_{t-1}) through the recurrent state. The trajectory distribution is

Pθ(X∣H)=∏t=1Kπθ(xt∣H,x<t)=∏t=1Kπt(xt).(10)P_\theta(X\mid H)=\prod_{t=1}^{K}\pi_\theta(x_t\mid H,x_{<t})=\prod_{t=1}^{K}\pi_t(x_t). \tag*{(10)}

Training with observed prefixes, training with sampled prefixes, and greedy inference use this same generation process with different item selection rules.

Stage I: Joint Item and Trajectory Supervision

Stage I jointly optimizes next item prediction and teacher-forced trajectory prediction. Both objectives supervise the generator using items observed in the training sequences.

a) Next item supervision: Let (H−,i+)(H^{-}, i^{+}) denote history–item pairs extracted from the training sequences. For each pair, the observed next item i+i^{+} supplies two targets: its SID tokens c1(i+),…,cL(i+)c_1(i^{+}), \ldots, c_L(i^{+}) supervise the parallel token distributions, and its item identity supervises the catalog distribution. Both predictions are computed from H−H^{-}. The loss is

Lnext=−E[1L∑ℓ=1Llog⁡q1,ℓ(cℓ(i+))+λitemlog⁡π1(i+)].(11)\mathcal{L}_{\mathrm{next}}=-\mathbb{E}\left[\frac{1}{L}\sum_{\ell=1}^{L}\log q_{1,\ell}(c_{\ell}(i^{+}))+\lambda_{\mathrm{item}}\log\pi_1(i^{+})\right]. \tag*{(11)}

The token term trains each SID position against its codebook vocabulary. The item term trains the target item’s probability over the catalog through the composed SID scores. Both terms update the same SID prediction heads. The coefficient λitem\lambda_{\mathrm{item}} weights item supervision.

b) Trajectory supervision: Let Dtraj\mathcal{D}_{\mathrm{traj}} contain history–future pairs (H,Y)(H,Y) with KK observed future interactions. At step tt, the model predicts πt\pi_t from HH and the preceding observed items y<ty_{<t}. After evaluating the target probability πt(yt)\pi_t(y_t), we use yty_t in the feedback and state transition for the next step. The trajectory loss is

Ltraj=−1KE(H,Y)∼Dtraj[∑t=1Klog⁡πt(yt)].(12)\mathcal{L}_{\mathrm{traj}}=-\frac{1}{K}\mathbb{E}_{(H,Y)\sim\mathcal{D}_{\mathrm{traj}}}\left[\sum_{t=1}^{K}\log\pi_t(y_t)\right]. \tag*{(12)}

Its item labels are the future interactions in the training sequence, and gradients propagate through the state transitions. We jointly optimize the encoder, token embeddings, SID heads, and transition head using

LI=Lnext+λtrajLtraj,(13)\mathcal{L}_{I}=\mathcal{L}_{\mathrm{next}}+\lambda_{\mathrm{traj}}\mathcal{L}_{\mathrm{traj}}, \tag*{(13)}

where λtraj\lambda_{\mathrm{traj}} weights trajectory supervision. During Stage I, we set η=0\eta=0, so each teacher-forced transition uses the observed item’s current SID representation.

c) Initialization for Stage II: After joint supervised training, we cache the feedback table bib_i from the learned SID embeddings. We initialize Stage II with the supervised generator, enable probability feedback with η=0.75\eta=0.75, and freeze a copy of the generator with this configuration as the reference model P0P_0. The feedback is also used at inference.

Stage II: Relation-Aware Trajectory Learning

Stage II optimizes the generator on trajectories sampled from its current policy. For each training pair (H,Y)(H,Y), we generate X∼Pθ(⋅∣H)X\sim P_{\theta}(\cdot\mid H) autoregressively by sampling each xtx_t from the catalog distribution πt\pi_t and updating the behavioral state through probability feedback. The observed future YY is used only for reward evaluation after generation. The objective considers both the compatibility of each prediction with the preceding behavior and its contribution to subsequent prediction quality.

a) Prediction and transition rewards: For a candidate item ii at step tt, we use

rt(i)=1K[R(i,yt)+λAA(xt−1,i)],x0=in.(14)r_t(i)=\frac{1}{K}\left[R(i,y_t)+\lambda_A A(x_{t-1},i)\right],\qquad x_0=i_n. \tag*{(14)}

Here R(i,yt)R(i,y_t) evaluates the prediction against the observed item yty_t. The global collaborative transition score A(i,j)A(i,j) measures support for the directed transition i→ji\to j, using interactions aggregated across users in the training data. The coefficient λA∈[0,1]\lambda_A\in[0,1] weighs this transition reward.

We define the position accuracy reward, R(i,yt)=I[i=yt]R(i,y_t)=\mathbb{I}[i=y_t], where I[⋅]\mathbb{I}[\cdot] is the indicator function. Its expectation under the current policy is ∑i∈Iπt(i)R(i,yt)=πt(yt)\sum_{i\in\mathcal{I}}\pi_t(i)R(i,y_t)=\pi_t(y_t), so maximizing this term directly increases the probability assigned to the observed target. To construct the collaborative transition score, we count ordered pairs of consecutive items in each user’s chronologically ordered training sequence. Let NijN_{ij} denote the number of times item jj immediately follows item ii, aggregated across users, and let Niout=∑j∈INijN_i^{\mathrm{out}}=\sum_{j\in\mathcal{I}}N_{ij} be the total number of observed outgoing transitions from ii. We define

A(i,j)={Nij/Niout,Niout>0,0,Niout=0.(15)A(i,j)= \begin{cases} N_{ij}/N_i^{\mathrm{out}}, & N_i^{\mathrm{out}}>0,\\ 0, & N_i^{\mathrm{out}}=0. \end{cases} \tag*{(15)}

Thus, A(i,j)A(i,j) is the empirical frequency of choosing jj as the next item after ii, conditional on an observed outgoing transition. Unobserved transitions receive zero additional reward. The scores are computed using only the training data.

The two terms provide complementary signals: R(i,yt)R(i,y_t) keeps the prediction aligned with the observed target, while A(xt−1,i)A(x_{t-1},i) favors continuations supported by behavior patterns across users. The transition term is evaluated against the last item in the generated prefix, with the final historical item providing the predecessor at the first prediction step.

We maximize the expected total reward

J(θ)=E(H,Y)∼DtrajEX∼Pθ(⋅∣H)[∑t=1Krt(xt)].(16)J(\theta)=\mathbb{E}_{(H,Y)\sim\mathcal{D}_{\mathrm{traj}}}\mathbb{E}_{X\sim P_{\theta}(\cdot\mid H)}\left[\sum_{t=1}^{K}r_t(x_t)\right]. \tag*{(16)}

The dependence of rtr_t on the sampled prefix and observed future is left implicit for readability.

b) Expected current rewards: Given a generated prefix, the current reward rt(i)r_t(i) is available for every catalog item. We therefore compute its expectation exactly under πt\pi_t:

mt=∑i∈Iπt(i)rt(i).(17)m_t=\sum_{i\in\mathcal{I}}\pi_t(i)r_t(i). \tag*{(17)}

Optimizing mtm_t trains the candidate distribution using both position accuracy and collaborative transition rewards. Its gradient incorporates rewards from the full candidate set, including items that were not sampled.

c) Credit from later predictions: Selecting xtx_t changes the context for subsequent predictions. We estimate this role using the rewards of the later prediction distributions reached after that choice. The continuation of the sampled trajectory provides the estimate ∑s=t+1Kms\sum_{s=t+1}^{K}m_s. This quantity reflects both agreement with later observed items and the transitions along the generated continuation. We combine expected current reward and continuation credit in the following surrogate loss

Lrel=−∑t=1Kmt−∑t=1K−1sg⁡(∑s=t+1Kms−B)log⁡πt(xt),(18)\mathcal{L}_{\mathrm{rel}}=-\sum_{t=1}^{K}m_t-\sum_{t=1}^{K-1}\operatorname{sg}\left(\sum_{s=t+1}^{K}m_s-B\right)\log\pi_t(x_t), \tag*{(18)}

where sg⁡\operatorname{sg} denotes stop-gradient. For each training pair, we independently sample G≥2G \ge2 trajectories. For a given trajectory, BB is the mean total expected reward ∑sms\sum_s m_s of the other trajectories. It is independent of that trajectory’s sampled choices, conditional on the training pair, and is detached in the surrogate. The loss is averaged over trajectories and training pairs. With fixed reward functions and fresh on-policy trajectories, the negative gradient of Lrel\mathcal{L}_{\mathrm{rel}} is an unbiased estimator of ∇θJ(θ)\nabla_\theta J(\theta), provided that replay preserves all deterministic parameter dependencies.

The first term optimizes expected current rewards across all steps, with gradients propagating through probability feedback and state transitions. The second assigns continuation credit to sampled item choices through their log-probabilities. The continuation reward sum excludes the current step, whose reward is already averaged over candidate items in mtm_t. For K=3K=3, m2m_2 directly trains the second-step distribution, while m3m_3 contributes to the continuation credit for x2x_2. The final step is trained through mKm_K and has no continuation-credit term.

d) KL regularization: We regularize the item distributions at sampled contexts toward the frozen reference P0P_0. Let π0t\pi_0^t be its item distribution conditioned on the same history and sampled prefix as πt\pi_t. Each model computes its own states and probability feedback along that shared item sequence. The Stage II loss for one sampled trajectory is

LII=Lrel+λKLK∑t=1K∑i∈Iπt(i)log⁡πt(i)π0t(i),(19)\mathcal{L}_{\mathrm{II}}=\mathcal{L}_{\mathrm{rel}}+\frac{\lambda_{\mathrm{KL}}}{K}\sum_{t=1}^{K}\sum_{i\in\mathcal{I}}\pi_t(i)\log\frac{\pi_t(i)}{\pi_0^t(i)}, \tag*{(19)}

where λKL\lambda_{\mathrm{KL}} controls the regularization strength. The reference probabilities are treated as constants. For this KL term, sampled items are fixed, while gradients through the current model’s probabilities, feedback, and state updates are retained. Stage II uses the relation-aware surrogate and KL regularization, and the observed future enters through the rewards.

e) Optimization: At each update, we sample fresh trajectories and replay the sampled item sequences with gradients enabled, using the same model parameters for sampling and replay. Replay recomputes probabilities, probability feedback, and behavioral states, preserving their deterministic parameter dependencies in both mtm_t and log⁡πt(xt)\log\pi_t(x_t). We average LII\mathcal{L}_{\mathrm{II}} over trajectories and training pairs and take one optimizer step. The encoder, SID heads, and transition head are updated jointly. SID assignments, the feedback table, reward functions, and P0P_0 remain fixed.

Greedy Inference and Complexity

a) Greedy inference: The history is encoded once to obtain h1h_1. At each future step, we compute the catalog distribution and select

xt=arg max⁡i∈I πt(i).(20)x_t=\underset{i\in\mathcal{I}}{\operatorname{arg\,max}}\ \pi_t(i). \tag*{(20)}

For t<Kt<K, the selected item and the full distribution πt\pi_t produce the feedback and the next behavioral state. The output is the ordered sequence (x1,…,xK)(x_1,\ldots,x_K).

b) Time complexity: Let VV be the vocabulary size of each SID codebook and dd the model width. We assume fixed-depth dense residual heads and a transition MLP with widths of order dd, and feedback vectors of dimension dd. Let Ce(n)C_e(n) denote the cost of encoding the history, including its input representations. SID indices and fixed feedback vectors are stored before inference.

At each step, the LL residual SID heads cost O(Ld2)O(Ld^2), token scoring costs O(LVd)O(LVd), and item-score composition costs O(NL)O(NL). Item normalization and greedy selection cost O(N)O(N), which is included in the item-scoring bound. Each non-final step additionally requires O(Nd)O(Nd) for probability feedback and O(d2)O(d^2) for the state transition. The total inference cost is

O(Ce(n)+K[Ld2+LVd+NL]+(K−1)[Nd+d2]).(21)O\left(C_e(n)+K[Ld^2+LVd+NL]+(K-1)[Nd+d^2]\right). \tag*{(21)}

For fixed SID settings, the catalog-dependent computation is linear in NN, and generation is linear in KK.

c) Memory and training cost: The stored SID indices and feedback table occupy O(NL+Nd)O(NL+Nd) memory, in addition to model parameters and the encoder workspace. Greedy decoding reuses per-step buffers and does not require storing all KK catalog distributions. Stage II adds sampling, differentiable replay, and a complete frozen reference forward pass for each trajectory. The reference pass has the same asymptotic dependence on NN and KK as generation. Given the two item distributions, the KL sum itself costs O(N)O(N) per step. With the reward scores available, computing mtm_t also costs O(N)O(N), and all continuation sums are obtained in O(K)O(K) time per trajectory by a reverse cumulative sum. The costs of constructing and storing the collaborative reward statistics are separate offline costs.

Experiments

We evaluate TraGR on ordered future interaction prediction, focusing on prediction quality, the contributions of its main components, and computational cost. Our experiments address the following five research questions:

RQ1. How does our model compare with existing methods in predicting user behavior trajectories?

RQ2. How do behavioral state updates and ordered supervision affect trajectory prediction?

RQ3. How do different probability feedback rules affect trajectory prediction?

RQ4. How do collaborative transition rewards and continuation credit contribute to trajectory prediction?

RQ5. What are the inference time and peak memory costs of TraGR relative to other baselines?

Experimental Setup

a) Data and evaluation: We evaluate TraGR on Beauty, Cell Phones & Accessories, ML-1M, and Last-FM. Table I lists the statistics of the four datasets used in our experiments. RUsers denotes the retained cohort used during training. and evaluation in our local experiments at the specified KK. Following the previous standard [18, 19], we use K=3K = 3 for Beauty and Cell Phones & Accessories, which have shorter average user sequences, and K=5K = 5 for ML-1M and Last-FM, which have longer sequences. These common settings facilitate fair comparisons at matched prediction horizons. We adopt a chronological trajectory leave-out evaluation setup, following LPDO and GCB. Each example consists of an observed interaction history and the next KK interactions in their original temporal order. For each dataset and prediction horizon, all locally evaluated methods use the same preprocessed interaction sequences, data splits, and history–future windows. Training windows and collaborative transition statistics are constructed exclusively from the training portion. For a chronological user sequence Su=(iu,1,…,iu,Tu)S_u = (i_{u,1}, \ldots, i_{u,T_u}), the final KK interactions form the test target, and the immediately preceding KK interactions form the validation target. Training pairs are constructed only from Su[1:Tu−2K]S_u[1 : T_u - 2K]. The validation and test histories are Su[1:Tu−2K]S_u[1 : T_u - 2K] and Su[1:Tu−K]S_u[1 : T_u - K], respectively. We report MHR@MM, MNDCG@MM, SHR@MM, and SNDCG@MM with M∈{5,10}M \in\{5, 10\}, and SeqMatch@50 to measure the fraction of test trajectories for which every target item appears among the top-50 candidates at its corresponding future position. For each future position, HR and NDCG are computed over the test instances. MHR and MNDCG take the arithmetic mean of these position-wise scores, whereas SHR and SNDCG take their geometric mean.

DatasetUsersRUsersItemsInteractionsAvgLenKK
Beauty22,3635,12312,101198,5028.883
Cell Phones27,8793,21610,429194,4396.973
MovieLens-1M6,0406,0403,7061,000,209165.605
Last-FM8918299871,048,5751176.855

Table I. Statistics of the datasets used in our experiments.

Thus, KK denotes the trajectory length, while MM denotes the ranking cutoff at each future position. All locally evaluated methods use the same eligible item catalog, without sampled negatives. Models that score the full catalog are evaluated by their catalog ranks, whereas beam-based generators are evaluated using their decoded candidate lists, as described below. For beam-based SID generators, including TIGER and our GCB implementation, we follow GCB’s trajectory decoding and evaluation route, using beam width 100. Generated token sequences are divided into consecutive SID blocks and mapped back to catalog items through the item-code dictionary. Beams containing invalid item mappings are discarded before evaluation. Position-wise ranking metrics are computed from the decoded item candidates. SeqMatch@50 is computed from the same position-wise ranked lists using the definition above.

c) Baselines: We compare TraGR with 11 baseline methods and two additional variants, SASRec-M and RPG-M, covering conventional sequential recommendation, diffusion-based recommendation, generative recommendation, and user behavior trajectory prediction. FPMC [37] combines matrix factorization with first-order Markov transitions. SAS-Rec [38] uses self-attention to model interaction histories, while STOSA [39] incorporates stochastic representations of item transitions. DCRec [40] augments sequential representations with contrastive learning. Among diffusion-based methods, DiffuRec [41] reconstructs target-item representations through history-conditioned reverse diffusion, and PreferDiff [42] incorporates personalized ranking signals into diffusion training. LPDO [18] formulates UBTP as diffusion-based trajectory generation with listwise preference supervision. For generative recommendation, TIGER [13] represents items with residual-quantized semantic IDs and autoregressively generates the next item’s SID. RPG [28] uses unordered semantic IDs to support parallel token prediction within an item. EchoRec [21] uses future behaviors as supervision and aligns holistic preference representations with the decoding representations. GCB [19] represents items with discrete semantic IDs and autoregressively generates a sequence of future behaviors.

FPMC, STOSA, DCRec, DiffuRec, PreferDiff, SASRec, RPG, TIGER, and EchoRec retain their model-specific training objectives and are adapted to the KK-step UBTP task. FPMC, SASRec, STOSA, DCRec, and DiffuRec produce position-wise rankings directly from the observed history, without feeding generated items back. PreferDiff, RPG, and EchoRec use greedy autoregressive rollout, appending each top-1 generated item

c) Evaluation metrics: Let NtestN_{\text{test}} be the number of test trajectories, KK the prediction horizon, and MM the ranking cutoff. For test trajectory nn at future position tt, let rn,tr_{n,t} denote the one-based rank of the ground-truth item. Since each position has one relevant item, its hit and discounted ranking scores are

Hn,t=1{rn,t≤M},Dn,t=Hn,tlog⁡2(rn,t+1).(22)H_{n,t} = \mathbf{1}\{r_{n,t} \le M\}, \qquad D_{n,t} = \frac{H_{n,t}}{\log_{2}(r_{n,t}+1)}. \tag*{(22)}

We first compute the position-wise test scores:

ht=1Ntest∑n=1NtestHn,t,dt=1Ntest∑n=1NtestDn,t.(23)h_t = \frac{1}{N_{\text{test}}}\sum_{n=1}^{N_{\text{test}}} H_{n,t}, \qquad d_t = \frac{1}{N_{\text{test}}}\sum_{n=1}^{N_{\text{test}}} D_{n,t}. \tag*{(23)}

MHR and MNDCG use arithmetic aggregation across future positions, while SHR and SNDCG use geometric aggregation [18]:

MHR⁡@M=1K∑t=1Kht,MNDCG⁡@M=1K∑t=1Kdt,\operatorname{MHR}@M = \frac{1}{K}\sum_{t=1}^{K} h_t, \qquad\operatorname{MNDCG}@M = \frac{1}{K}\sum_{t=1}^{K} d_t,
SHR⁡@M=(∏t=1Kht)1K,SNDCG⁡@M=(∏t=1Kdt)1K.(24)\operatorname{SHR}@M = \left(\prod_{t=1}^{K} h_t\right)^{\frac{1}{K}}, \qquad\operatorname{SNDCG}@M = \left(\prod_{t=1}^{K} d_t\right)^{\frac{1}{K}}. \tag*{(24)}

We additionally report SeqMatch, the fraction of test trajectories for which every target item appears among the top-MM candidates at its corresponding position:

SeqMatch⁡@M=1Ntest∑n=1Ntest∏t=1KHn,t.(25)\operatorname{SeqMatch}@M = \frac{1}{N_{\text{test}}}\sum_{n=1}^{N_{\text{test}}}\prod_{t=1}^{K} H_{n,t}. \tag*{(25)}

All metrics are higher-is-better. before the next step, whereas TIGER uses autoregressive beam search and extends multiple candidate paths. RPG, TIGER, and EchoRec retain their respective within-item SID prediction and decoding procedures. Separately, SASRec-M and RPG-M are trained with multi-step objectives supervised at all KK future positions and are evaluated autoregressively. We compute each model’s ranking metrics from its position-wise outputs, and TIGER’s ranks are based on its decoded 100 beam candidates. Generated SID blocks are mapped to catalog items, and beams containing invalid item mappings are discarded. At each future position, repeated occurrences of the same item across valid beams are merged. If fewer than MM distinct valid items remain, the available list is evaluated without padding or additional search. Ground-truth future items are never used as validation or test inputs. We reproduce LPDO using the authors’ publicly available implementation3 and recompute its ranking metrics with the common evaluator used for the other methods. The reported LPDO results are obtained from this reproduction under our unified evaluation protocol. No public implementation of GCB is available. So we implement GCB from the paper’s description, using RQ-VAE semantic IDs and an autoregressive Transformer, and decode with beam size 100. For all locally evaluated methods, we use the same registered data splits, rank items over the same full catalog. Checkpoint selection uses validation SNDCG@10, and the test split is not used for checkpoint or configuration selection. We follow author-released configurations or documented settings where available and make validation-based choices otherwise.

d) Implementation Details: We implement our model in PyTorch and conduct our experiments on one NVIDIA H200 GPU, using Adam for optimization. Training consists of Stage I supervised initialization followed by Stage II relation-aware optimization. Table II summarizes the model configuration, the optimization settings for each stage, and the coefficients used for feedback and reward-based learning. TraGR uses greedy decoding at inference. For the methods and ablation variants reproduced by us, we report mean performance over three training runs with random seeds 42, 123, and 2024. Furthermore, the reported improvements of the main metric are statistically significant (p<0.05p < 0.05).

ParameterConfiguration
Architecture
Maximum history length50 items
SID tokens / codebook size16 tokens per item / 256 codes per position
Item / feedback dimensions448 / 448
Encoder2-layer causal Transformer, 4 heads, FFN width 1024
Stage I
Learning rate10−410^{-4}
Batch size256
Maximum epochs80
Temperature τsid\tau_{\mathrm{sid}} / τitem\tau_{\mathrm{item}}0.03 / 0.15
Loss weight λitem\lambda_{\mathrm{item}} / λtraj\lambda_{\mathrm{traj}}1 / 1
Stage II
Learning rate10−510^{-5}
Batch size32
Maximum epochs10
Rollouts per history8
Probability feedback and regularization
Mixing coefficient η\etaStage I: 0 / Stage II and evaluation: 0.75
Similarity temperatureτsim=0.2\tau_{\mathrm{sim}} = 0.2
Transition reward weightλA=0.25\lambda_A = 0.25
KL coefficientλKL=0.5\lambda_{KL} = 0.5

Table II. Implementation details.

Overall Trajectory Prediction (RQ1)

Table III compares TraGR with 13 baseline configurations on four datasets. TraGR achieves the highest reported score in all 36 dataset–metric combinations, including SeqMatch@50 on every dataset. The improvements cover both the three-step prediction tasks on Beauty and Cell Phones & Accessories and the five-step tasks on ML-1M and Last-FM.

MetricFPMCSASRecSASRec-MSTOSADiffuRecPreferDiffDCRecTIGERRPGRPG-MLPDOEchoRecGCBOurs
Beauty (K=3K = 3)
MHR@50.01950.01820.01240.01560.01830.02620.00200.00350.02500.03530.02850.03120.01920.0381
MNDCG@50.01230.01130.00740.01030.01150.01870.00110.00230.01510.02280.01860.02130.01210.0252
MHR@100.03240.02890.02150.02210.03330.03460.00420.00590.04270.05390.04500.04720.02680.0629
MNDCG@100.01640.01480.01040.01250.01630.02140.00180.00310.02070.02880.02390.02650.01460.0332
SHR@50.01910.01740.01180.01520.01720.01960.00180.00340.02170.03070.02700.02690.01850.0335
SNDCG@50.01200.01080.00710.01000.01060.01310.00110.00230.01280.01930.01760.01800.01150.0217
SHR@100.03190.02790.02130.02140.03200.02730.00420.00570.03900.04820.04250.04230.02600.0577
SNDCG@100.01610.01420.01020.01210.01540.01560.00180.00300.01840.02510.02260.02300.01400.0296
SeqMatch@500.02440.02280.00940.00640.02400.00250.00000.00140.02170.03360.03220.02300.00390.0435
Cell Phones & Accessories (K=3K = 3)
MHR@50.01090.00440.00330.00920.01610.01550.00830.00620.01690.01700.01530.02350.01080.0281
MNDCG@50.00680.00270.00230.00640.01080.01070.00560.00380.01100.01110.00960.01560.00730.0179
MHR@100.01960.00740.00620.01530.02390.02190.01500.00910.02610.02740.02570.03770.01460.0483
MNDCG@100.00960.00360.00330.00840.01330.01280.00770.00470.01400.01440.01290.02010.00860.0244
SHR@50.01080.00430.00310.00890.01300.01210.00780.00510.01580.01580.01510.02240.01060.0264
SNDCG@50.00680.00260.00220.00620.00820.00830.00530.00330.01010.01010.00940.01490.00720.0168
SHR@100.01900.00720.00590.01490.02100.01810.01420.00730.02470.02610.02520.03620.01410.0454
SNDCG@100.00940.00360.00310.00810.01090.01020.00740.00400.01300.01340.01260.01930.00840.0229
SeqMatch@500.00500.00030.00060.00030.00650.00120.00090.00000.00620.00650.00780.01150.00220.0202
ML-1M (K=5K = 5)
MHR@50.01930.08520.07040.05580.08880.03870.07940.08210.06000.11080.11420.05990.08850.1363
MNDCG@50.01110.05270.04400.03400.05530.02480.04770.05250.03800.07210.07200.03810.05390.0870
MHR@100.04180.14730.11830.09800.14880.06040.14370.13500.09880.17450.18710.09770.12710.2144
MNDCG@100.01820.07270.05930.04750.07460.03180.06830.06940.05040.09260.09540.05030.06650.1120
SHR@50.01920.08490.06870.05570.08860.02860.07630.07780.05380.10200.11210.05310.08450.1300
SNDCG@50.01100.05260.04280.03390.05510.01750.04580.04900.03320.06510.07050.03320.05110.0824
SHR@100.04170.14670.11570.09790.14820.04780.13910.12920.09180.16470.18390.08990.12500.2076
SNDCG@100.01820.07240.05790.04750.07430.02370.06590.06560.04550.08540.09360.04510.06450.1074
SeqMatch@500.01620.11030.06850.05860.10980.00200.08840.04420.03970.09490.14490.03530.00680.1545
Last-FM (K=5K = 5)
MHR@50.16190.19660.18700.12420.18790.22000.19250.24610.00820.22650.21590.00770.20940.2531
MNDCG@50.11330.14040.13040.09280.13700.17050.13660.18270.00420.17620.15860.00480.15380.1855
MHR@100.23430.26130.25980.16280.26100.25600.27040.32710.01540.29310.28010.01540.25330.3320
MNDCG@100.13650.16120.15380.10520.16060.18220.16200.20870.00650.19780.17930.00720.16790.2111
SHR@50.16140.19610.18580.12350.18710.20830.18680.23720.00710.21510.21240.00730.20500.2480
SNDCG@50.11310.13990.12970.09230.13620.15980.13290.17510.00350.16620.15580.00440.15020.1795
SHR@100.23390.26120.25710.16210.26010.24400.26450.31990.01450.28230.27650.01500.24900.3264
SNDCG@100.13640.16100.15280.10470.15980.17150.15820.20190.00600.18810.17650.00690.16430.2052
SeqMatch@500.17130.17130.07240.07120.18580.09050.15560.20140.00240.17010.15440.00360.08320.2256

Table III. Overall UBTP results on four datasets. MHR, MNDCG, SHR, and SNDCG are evaluated at cutoffs 5 and 10, and SeqMatch is evaluated at cutoff 50. Bold values indicate the highest reported score for each dataset and metric.

The strongest baseline for MNDCG@10 and SNDCG@10 varies across datasets. Relative to the strongest baseline for each dataset and metric, TraGR improves MNDCG@10 by approximately 1.15%–21.39% and SNDCG@10 by approximately 1.63%–18.65%. Its advantage therefore holds against different leading competitors across the four datasets.

The gains also extend across both ranking cutoffs and both arithmetic aggregation (MHR and MNDCG) and geometric aggregation (SHR and SNDCG), showing that the comparative advantage is retained under different summaries of position-wise performance.

On SeqMatch@50, the relative improvements are approximately 29.46%, 75.65%, 6.63%, and 12.02% on Beauty, Cell Phones & Accessories, ML-1M, and Last-FM, respectively. These gains indicate that more test trajectories have every target item included in the top-50 candidate list at its corresponding future position. This complements the position-aggregated ranking results. On Last-FM, for example, the relatively modest improvements in MNDCG@10 and SNDCG@10 are accompanied by a larger relative gain in SeqMatch@50, demonstrating the additional benefit observed when coverage is assessed jointly across all target positions.

Position-wise prediction. We select LPDO and GCB as representative diffusion-based and autoregressive SID-based methods for trajectory prediction, respectively. As shown in Figure 3, TraGR achieves the highest HR@10 and NDCG@10 at every position on both datasets.

Figure 3. Comparison of three representative methods at each future trajectory position on Beauty and ML-1M, measured by HR@10 and NDCG@10.

Behavioral State Evolution (RQ2)

Panel A of Table IV compares four supervised variants in Stage I. History Only predicts each future position from the same history representation and its position embedding, without recurrent state updates. Zero Feedback retains the state recurrence but sets the item feedback input to zero. Multi-label uses the History Only architecture and replaces the ordered trajectory objective with multi-label BCE over the future item set, while retaining the auxiliary next item loss. Stage I Only evaluates the checkpoint before Stage-II fine-tuning using the same probability feedback generation procedure and feedback coefficient as the full model. Zero Feedback produces almost no improvement on Beauty and only small gains on ML-1M over History Only. Compared with History Only, Stage I Only increases SNDCG@10 from 0.0219 to 0.0258 on Beauty and from 0.0521 to 0.0972 on ML-1M. Among the ordered variants, the main improvement therefore comes from supplying item information to the state updates. Multi-label obtains the lowest scores on both datasets. Relative to History Only, its SNDCG@10 decreases by approximately 25% on Beauty and 23% on ML-1M.

VariantBeauty (K=3K = 3) SNDCG@5SHR@5SNDCG@10SHR@10ML-1M (K=5K = 5) SNDCG@5SHR@5SNDCG@10SHR@10
A. State evolution and supervision (RQ2)
History Only0.01650.02630.02190.04290.03840.06120.05210.1034
Zero Feedback0.01650.02590.02190.04280.03950.06330.05280.1048
Multi-label0.01150.01940.01630.03430.02880.04610.04010.0812
Stage I Only0.02010.03280.02580.05010.07630.11080.09720.1823
B. Probability feedback design (RQ3)
Item Only0.02020.03200.02730.05100.07790.12090.09720.1851
Item + Prob0.02070.03240.02810.05360.08200.12690.10510.2045
Item + Sim0.02010.03020.02620.04900.07380.11840.09780.1927
w/o Item Anchor0.02140.03310.02920.05690.08090.12850.10590.2047
Full0.02170.03350.02960.05770.08240.13000.10740.2076

Table IV. State evolution and feedback comparisons on Beauty and ML-1M. The best result in each column within each panel is shown in bold.

Probability Feedback (RQ3)

Panel B of Table IV compares multiple feedback rules used to update the behavioral state. Each variant is trained separately in Stage II, with its feedback rule used consistently during both training and inference. Item Only uses the selected-item representation alone. Item + Probability (Item + Prob) combines this representation with a candidate summary weighted by the current predicted probabilities, without similarity reweighting. Item + Similarity (Item + Sim) combines the selected-item representation with a candidate summary weighted by similarity to the selected item, without using the predicted probabilities in these weights. w/o Item Anchor retains the probability and similarity weighting while removing the explicit selected-item contribution. Full uses both the predicted probabilities and item similarity to determine the weights of the candidate summary. The mixing coefficient is kept identical across the three variants with an additional summary, while the remaining model and training settings are held fixed.

Item + Prob outperforms Item Only across all reported metrics on both datasets, supporting the use of a probability-weighted candidate summary in addition to the selected-item representation. Item + Sim does not provide uniform improvements: it underperforms Item Only on Beauty and produces mixed results on ML-1M. Full achieves the highest values across all reported metrics. In particular, compared with Item + Prob, Full improves SNDCG@10 and SHR@10 by 5.34% and 7.65% on Beauty. Since both variants retain selected-item feedback and probability weighting, this comparison supports the additional benefit of similarity reweighting. Overall, the results favor the joint weighting used by TraGR over either probability-based or similarity-based weighting alone. w/o Item Anchor obtains lower scores, supporting the inclusion of the selected item alongside the feedback embedding weighted by predicted probabilities and similarity.

Prediction quality across future positions. Figure 4 compares position-wise NDCG@10 and HR@10 for Full and Item Only. Although both variants decline as the prediction horizon advances, Full achieves higher scores at every position on both datasets. On ML-1M, the relative HR@10 gain increases from approximately 5% at the first position to 19.3% at the fifth, while the NDCG@10 advantage is generally larger at later positions. On Beauty, the relative gains increase from approximately 2% for both metrics at the first position to 18.2% in NDCG@10 and 31.0% in HR@10 at the third. These results suggest that probability feedback benefits prediction quality at later rollout steps.

Figure 4. Prediction quality at each future position on ML-1M and Beauty. The first two columns report position-wise NDCG@10 and HR@10 for Full and Item Only. The last column shows the relative improvement of Full, computed as 100(Full/ItemOnly−1)100(\mathrm{Full}/\mathrm{ItemOnly} - 1) for each metric and position.

Relation-Aware Learning (RQ4)

Table V examines relation-aware trajectory learning in Stage II through supervised controls, ablations of CT and CC, and a feedback-gradient ablation. Here, the collaborative transition reward (CT) is the reward component that captures collaborative support for behavior transitions, whereas continuation credit (CC) is the credit-assignment mechanism that attributes subsequent expected rewards to earlier sampled choices.

VariantCTCCSNDCG@5SHR@5SNDCG@10SHR@10SNDCG@5SHR@5SNDCG@10SHR@10
Stage I Only——0.02010.03280.02580.05010.07630.11080.09720.1823
Supervised FT——0.02010.03250.02610.05050.08050.12110.10340.1863
Generated-Prefix FT——0.02040.03160.02650.05120.08020.12170.10550.1931
Task Only××0.02120.03290.02830.05570.07810.12760.10120.1968
Task + CC×✓0.02160.03330.02850.05620.08060.11780.10520.1933
Task + CT✓×0.02040.03290.02830.05630.08180.12290.10570.2019
w/o Feedback Gradients✓✓0.02090.03240.02810.05440.08150.12870.10670.2053
Full✓✓0.02170.03350.02960.05770.08240.13000.10740.2076

Table V. Ablation of relation-aware learning on Beauty and ML-1M. CT and CC denote the collaborative transition reward and continuation credit. Dashes indicate that CT and CC are not applicable to the supervised variants. Best scores are in bold. Beauty (K=3K = 3) and ML-1M (K=5K = 5).

Comparison with supervised training. Stage I Only evaluates the generator after joint supervised initialization, without further optimization. Supervised FT continues supervised training on observed targets, whereas Generated-Prefix FT minimizes cross-entropy against the observed future items using the same sampled item prefixes as its trajectory-training reference. Both fine-tuning controls use the feedback configuration of Full. Full achieves the best scores across all reported metrics on both datasets. Its advantage over these supervised references supports the benefit of the proposed training objective beyond additional supervised updates and exposure to generated prefixes.

Effects of CT and CC. The four reward-based variants train predictions across the complete horizon using model-generated trajectories, with probability feedback, state transitions, and KL regularization retained. Task Only sets λA=0\lambda_A = 0 and removes the continuation-credit term from Eq. (18). Task + CC restores this term, whereas Task + CT adds the collaborative reward λAA(xt−1,i)\lambda_A A(x_{t-1}, i) without continuation credit. Full includes both components, allowing the collaborative reward to contribute to both current candidate evaluation and continuation credit. Disabling CC removes only the explicit credit assigned to discrete sampled choices, and gradients from the expected rewards still propagate through probability feedback and state updates. The effects of adding CT or CC individually vary across datasets and metrics. However, removing either component from Full lowers every reported score, supporting their complementary roles. CT favors transitions supported by collaborative interaction patterns, while CC assigns expected rewards from subsequent predictions to earlier sampled choices. Together, they connect the relation to the preceding behavior with the consequences for later predictions.

Effect of feedback gradients. w/o Feedback Gradients retains CT, CC, and the forward feedback computation of Full, but stops gradients through the predicted probabilities used to construct the feedback embedding during Stage II. The remaining objective terms and gradient paths are unchanged. Its lower scores support the additional value of the differentiable feedback path, through which subsequent losses can update earlier predictive distributions.

Hyperparameter Sensitivity

We examine the feedback mixing coefficient η\eta and the trajectory-supervision weight λtraj\lambda_{\mathrm{traj}}. The figures report percentage changes relative to the corresponding default setting, allowing the sensitivity of the two metrics to be compared across Beauty and ML-1M.

a) Feedback mixing coefficient: Figure 5 varies η\eta, which controls the contribution of the soft candidate summary relative to the selected-item feedback. Increasing η\eta from 0.25 to 0.75 improves both metrics on the two datasets. Beauty obtains its strongest results at the default setting, while ML-1M exhibits a trade-off at η=0.90\eta= 0.90: SNDCG@10 increases further, but SHR@10 decreases. Thus, a larger contribution from the soft summary does not uniformly improve prediction quality. Finally, we set η=0.75\eta= 0.75.

Figure 5. Sensitivity to the feedback mixing coefficient η\eta and trajectory-supervision weight λtraj\lambda_{\mathrm{traj}}. Grey lines mark the default parameter and the zero-change reference.

b) Trajectory supervision weight: Figure 5 varies λtraj\lambda_{\mathrm{traj}}, which weights the trajectory loss relative to the next item supervision in Stage I. The default value of 1.0 gives the strongest overall results among the tested settings, although the changes are not monotonic. ML-1M remains comparatively stable across this range, particularly in SHR@10, for which the scores at 0.5

and 1.0 are nearly identical. Beauty shows greater sensitivity, with both metrics dropping at intermediate weights before recovering at the default setting. These results support retaining the default trajectory weight within the evaluated range.

G. Effect of Prediction Horizon

We examine how trajectory prediction performance changes with the prediction horizon on ML-1M and Last-FM. We compare TraGR with LPDO and GCB at K∈{3,5,7,10}K \in\{3, 5, 7, 10\}, where KK denotes the number of future items to predict. Each method is trained separately for every value of KK. For each horizon, all three methods use identical training and test samples, candidate sets, and metric implementations. Figure 6 reports SHR@10 and SNDCG@10 for each setting, with TraGR labeled as Ours. LPDO and GCB provide representative comparisons with diffusion-based and autoregressive trajectory generation, respectively. This experiment complements the main evaluation by examining whether the comparative advantage persists across separately trained models targeting different prediction horizons. All three methods obtain lower scores as the prediction horizon increases on both datasets. TraGR achieves the highest SHR@10 and SNDCG@10 at every evaluated horizon on ML-1M. On Last-FM, it also achieves the highest SHR@10 throughout and the highest SNDCG@10 for K≥5K \ge5. At K=3K = 3, TraGR and LPDO perform closely: TraGR has a slight advantage in SHR@10, whereas LPDO has a marginally higher SNDCG@10. The results therefore show consistent advantages beyond the shortest horizon, while preserving a small exception in short-horizon ranking quality.

Figure 6. Comparison of three representative methods across prediction horizons KK on ML-1M and Last-FM. Each method is trained separately for each KK.

Comparing the separately trained models at K=3K = 3 and K=10K = 10, TraGR exhibits a smaller relative decrease in both metrics than either baseline on both datasets. Its advantage remains evident at the longest evaluated horizon, although all methods obtain substantially lower scores than at the shortest horizon. The size of the improvement over LPDO varies across horizons and metrics rather than increasing monotonically with KK. Nevertheless, TraGR maintains the best reported scores for both metrics on both datasets at K=5K = 5, 7, and 10. Taken together, these observations support its effectiveness for longer target trajectories within the evaluated range, complementing the component-level analyses in the preceding experiments.

Inference Efficiency (RQ5)

We compare TraGR with RPG, LPDO, and GCB on Last-FM and ML-1M. RPG provides a close architectural reference through parallel SID prediction, while LPDO and GCB represent diffusion-based and autoregressive SID-based trajectory generators, respectively. We evaluate the RPG baseline listed in Table III and use our GCB reimplementation on both datasets. All measurements use a single NVIDIA H200 GPU with batch size 64. We report the total inference time over each dataset’s test workload, averaged over five timed runs after three warm-up runs. The timed region includes model forward passes and trajectory generation, including LPDO denoising and GCB beam search, with GPU synchronization before and after each measurement. RPG and TraGR use greedy decoding, LPDO uses 1 denoising step, and GCB uses beam width 100. As shown in Figure 7, TraGR achieves substantially lower inference time than LPDO and GCB on both datasets, with additional runtime overhead relative to RPG. Its peak GPU memory is lower than that of GCB but higher than that of LPDO. Compared with RPG, TraGR uses more memory on Last-FM and ML-1M. These results demonstrate a speed–memory trade-off relative to LPDO and lower inference costs in both time and memory relative to GCB under the evaluated settings.

Figure 7. Comparison of inference time and peak GPU memory usage across RPG, LPDO, GCB, and TraGR on Last-FM and ML-1M.

Conclusion

We presented TraGR, a behavior-aware generative recommendation framework for user behavior trajectory prediction. By coupling behavioral state updates with item-anchored probability feedback, the framework carries information from selected items and predictive distributions across future positions. Relation-aware learning on model-generated trajectories combines position accuracy and directed collaborative transition rewards with credit assigned to earlier choices for later prediction quality. Experiments on four public datasets show improvements in position-wise ranking and trajectory coverage, with ablation studies supporting the contributions of the proposed components. Under the evaluated settings, TraGR also achieves lower inference time than LPDO and GCB on ML-1M and Last-FM. Future work will explore efficient candidate selection and feedback aggregation to reduce catalog-dependent computation and improve scalability to larger item catalogs.

References

  1. [1]Z. Liu, S. Liu, Z. Zhang, Q. Cai, X. Zhao, K. Zhao, L. Hu, P. Jiang, and K. Gai, “Sequential recommendation for optimizing both immediate feedback and long-term retention,” in Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval, 2024, pp. 1872–1882.
  2. [2]J. Xu, Z. Chen, S. Yang, J. Li, H. Wang, Y. Li, J. Tang, Y. Liu, and E. C. H. Ngai, “Cammsr: Category-guided attentive mixture of experts for multimodal sequential recommendation,” in 2026 IEEE 42nd International Conference on Data Engineering (ICDE), 2026, pp. 2206–2219.arxiv.org/abs/2603.04320
  3. [3]X. Liu, J. Guo, Q. Hao, Z. Yu, Q. Yang, and J. Shao, “Community-level personalized recommendation by exploiting evolving user-item micro-clusters,” in 2026 IEEE 42nd International Conference on Data Engineering (ICDE). IEEE, 2026, pp. 1–15.DOI
  4. [4]L. Zhang, X. Zhou, Z. Zeng, and Z. Shen, “Are id embeddings necessary? whitening pre-trained text embeddings for effective sequential recommendation,” in 2024 IEEE 40th International Conference on Data Engineering (ICDE). IEEE, 2024, pp. 530–543.arxiv.org/abs/2402.10602
  5. [5]L. Ning, L. Liu, J. Wu, N. Wu, D. Berlowitz, S. Prakash, B. Green, S. O’Banion, and J. Xie, “User-llm: Efficient LLM contextualization with user embeddings,” in Companion Proceedings of the ACM on Web Conference 2025. ACM, 2025, pp. 1219–1223.
  6. [6]C. Huang, X. Wu, X. Zhang, C. Zhang, J. Zhao, D. Yin, and N. V. Chawla, “Online purchase prediction via multi-scale modeling of behavior dynamics,” in Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. ACM, 2019, pp. 2613–2622.DOI
  7. [7]N. Pancha, A. Zhai, J. Leskovec, and C. Rosenberg, “Pinnerformer: Sequence modeling for user representation at pinterest,” in Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. ACM, 2022, pp. 3702–3712.arxiv.org/abs/2205.04507
  8. [8]B. Peng, Z. Ren, S. Parthasarathy, and X. Ning, “M2: Mixed models with preferences, popularities and transitions for next-basket recommendation,” IEEE Transactions on Knowledge and Data Engineering, vol. 35, no. 4, pp. 4033–4046, 2023.DOI
  9. [9]X. Li, J. Sheng, J. Cao, X. Zhang, W. Zhang, Y. Sun, S. Pan, Z. Tian, and T. Liu, “Personalized multi-interest modeling for cross-domain recommendation to cold-start users,” in 2025 IEEE 41st International Conference on Data Engineering (ICDE). IEEE, 2025, pp. 4092–4105.DOI
  10. [10]J. Achiam, “Gpt-4 technical report,” arXiv preprint arXiv:2303.08774, 2023.arxiv.org/abs/2303.08774
  11. [11]D. Guo, D. Yang, H. Zhang, J. Song, P. Wang, Q. Zhu, R. Xu, R. Zhang, S. Ma, X. Bi et al., “Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning,” arXiv preprint arXiv:2501.12948, 2025.DOI
  12. [12]X. Yang, H. Jing, Z. Zhang, J. Wang, N. Ziu, S. Wang, Y. Lu, J. Wang, D. Yin, X. Liu et al., “Darec: A disentangled alignment framework for large language model and recommender system,” in 2025 IEEE 41st international conference on data engineering (ICDE). IEEE, 2025, pp. 904–917.arxiv.org/abs/2408.08231
  13. [13]S. Rajput, N. Mehta, A. Singh, R. Hulikal Keshavan, T. Vu, L. Heldt, L. Hong, Y. Tay, V. Tran, J. Samost, M. Kula, E. Chi, and M. Sathiamoorthy, “Recommender systems with generative retrieval,” in Advances in Neural Information Processing Systems, A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine, Eds., vol. 36. Curran Associates, Inc., 2023, pp. 10 299–10 315.arxiv.org/abs/2305.05065
  14. [14]S. Wang, L. Hu, Y. Wang, L. Cao, Q. Z. Sheng, and M. A. Orgun, “Sequential recommender systems: Challenges, progress and prospects,” in Proceedings of the 28th International Joint Conference on Artificial Intelligence, 2019, pp. 6332–6338.
  15. [15]Y. Chen, Z. Liu, J. Li, J. J. McAuley, and C. Xiong, “Intent contrastive learning for sequential recommendation,” in WWW ’22: The ACM Web Conference 2022, Virtual Event, Lyon, France, April 25 - 29, 2022. ACM, 2022, pp. 2172–2182.DOI
  16. [16]X. Xie, F. Sun, Z. Liu, S. Wu, J. Gao, J. Zhang, B. Ding, and B. Cui, “Contrastive learning for sequential recommendation,” in 38th IEEE International Conference on Data Engineering, ICDE 2022, Kuala Lumpur, Malaysia, May 9-12, 2022. IEEE, 2022, pp. 1259–1273.arxiv.org/abs/2010.14395
  17. [17]Y. Hao, P. Zhao, J. Fang, J. Qu, G. Liu, F. Zhuang, V. S. Sheng, and X. Zhou, “Meta-optimized joint generative and contrastive learning for sequential recommendation,” in 2024 IEEE 40th International Conference on Data Engineering (ICDE). IEEE, 2024, pp. 705–718.arxiv.org/abs/2310.13925
  18. [18]H. Huang, C. Huang, J. Wu, T. Yu, J. McAuley, and L. Yao, “Listwise preference diffusion optimization for user behavior trajectories prediction,” in Advances in Neural Information Processing Systems, D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Koniusz, M. Ghassemi, and N. Chen, Eds., vol. 38, Main Conference. Curran Associates, Inc., 2025, pp. 159 383–159 408.arxiv.org/abs/2511.00530
  19. [19]C. Huang, X. Chen, H. Huang, Q. Z. Sheng, and L. Yao, “Generative chain of behavior for user trajectory prediction,” arXiv preprint arXiv:2601.18213, 2026.arxiv.org/abs/2601.18213
  20. [20]K. Shah, B. Kumar, N. Shah, and L. Collins, “Masked diffusion for generative recommendation,” arXiv preprint arXiv:2511.23021, 2025.arxiv.org/abs/2511.23021
  21. [21]H. Ma, A. Hu, Y. Xing, R. Xie, Y. Yang, T. Tu, L. Meng, and T.-S. Chua, “Echorec: Multi-item prediction-empowered generative recommendation via cycle-consistent preference alignment,” arXiv preprint arXiv:2608.14011, 2026.arxiv.org/abs/2608.14011
  22. [22]H. Luo, S. Li, H. Yang, Z. Sun, H. Ding, B. Zhang, Z. Cai, R. Qian, F. Yang, T. Gao, C. Lei, W. Ou, and F. Zhuang, “Awakening dormant users: Modeling intent evolution via LLM-based functional role reasoning for generative recommendation,” in Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing: Industry Track. Budapest, Hungary: Association for Computational Linguistics, Oct. 2026, pp. 3334–3356.DOI
  23. [23]C. Feng, L. Ma, X. Gao, C. Zhang, Y. Pu, and X. Li, “Psg: Pair-space generation for efficient generative reranking,” arXiv preprint arXiv:2607.26427, 2026.
  24. [24]J. Cao, H. Peng, W. Xu, J. Deng, Z. Ling, X. Wang, K. Shang, C. Tang, Z. Cai, J. Du et al., “Kuaishou explorer llm-rec challenge 2026: Reasoning generative recommendation,” arXiv preprint arXiv:2609.39828, 2026.arxiv.org/abs/2609.39828
  25. [25]M. Hong, Y. Xia, Z. Wang, J. Zhu, Y. Wang, S. Cai, X. Yang, Q. Dai, Z. Dong, Z. Zhang et al., “Eager-llm: Enhancing large language models as recommenders through exogenous behavior-semantic integration,” in Proceedings of the ACM on Web Conference 2025, 2025, pp. 2754–2762.DOI
  26. [26]B. Zheng, Y. Hou, H. Lu, Y. Chen, W. X. Zhao, M. Chen, and J.-R. Wen, “Adapting large language models by integrating collaborative semantics for recommendation,” in 2024 IEEE 40th International Conference on Data Engineering (ICDE). IEEE, 2024, pp. 1435–1448.arxiv.org/abs/2311.09049
  27. [27]W. Wang, H. Bao, X. Lin, J. Zhang, Y. Li, F. Feng, S.-K. Ng, and T.-S. Chua, “Learnable item tokenization for generative recommendation,” in Proceedings of the 33rd ACM International Conference on Information and Knowledge Management, 2024, pp. 2400–2409.arxiv.org/abs/2405.07314
  28. [28]Y. Hou, J. Li, A. Shin, J. Jeon, A. Santhanam, W. Shao, K. Hassani, N. Yao, and J. McAuley, “Generating long semantic ids in parallel for recommendation,” in Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2, 2025, pp. 956–966.arxiv.org/abs/2506.05781
  29. [29]X. Shan, X. Tang, H. Chen, F. Lyu, L. Li, J. Jiang, D. Liu, and X. He, “From item scores to semantic tokens: Test-time collaborative adaptation for generative recommendation,” arXiv preprint arXiv:2610.32098, 2026.arxiv.org/abs/2610.32098
  30. [30]C. Huang, T. Gao, H. Huang, Q. Z. Sheng, and L. Yao, “Beyond item order: Temporal gap tokenization for generative recommendation with semantic ids,” arXiv preprint arXiv:2607.03918, 2026.arxiv.org/abs/2607.03918
  31. [31]B. Wu, Y. Cheng, H. Yuan, and Q. Ma, “When multi-behavior meets multi-interest: Multi-behavior sequential recommendation with multi-interest self-supervised learning,” in 2024 IEEE 40th International Conference on Data Engineering (ICDE). IEEE, 2024, pp. 845–858.
  32. [32]M. Ariannezhad, S. Jullien, M. Li, M. Fang, S. Schelter, and M. De Rijke, “Recanet: A repeat consumption-aware neural network for next basket recommendation in grocery shopping,” in Proceedings of the 45th international ACM SIGIR conference on research and development in information retrieval, 2022, pp. 1240–1250.DOI
  33. [33]Y. Cao, A. Ranjan, S. Subramanian, E. Korpeoglu, K. Nag, and K. Acham, “Case: Cadence-aware set encoding for large-scale next basket repurchase recommendation,” arXiv preprint arXiv:2604.06718, 2026.arxiv.org/abs/2604.06718
  34. [34]J. Deng, S. Wang, K. Cai, L. Ren, Q. Hu, W. Ding, Q. Luo, and G. Zhou, “Onerec: Unifying retrieve and rank with generative recommender and iterative preference alignment,” arXiv preprint arXiv:2502.18965, 2025.arxiv.org/abs/2502.18965
  35. [35]Q. Luo, E. Chen, Z. Shi, and B. Wang, “Anchor-based pairwise comparison via large language model for recommendation reranking,” in Proceedings of the 34th ACM International Conference on Information and Knowledge Management, 2025, pp. 5001–5005.
  36. [36]Y. Xi, J. Lin, W. Liu, X. Dai, W. Zhang, R. Zhang, R. Tang, and Y. Yu, “A bird’s-eye view of reranking: from list level to page level,” in Proceedings of the Sixteenth ACM International Conference on Web Search and Data Mining, 2023, pp. 1075–1083.arxiv.org/abs/2211.09303
  37. [37]S. Rendle, C. Freudenthaler, and L. Schmidt-Thieme, “Factorizing personalized markov chains for next-basket recommendation,” in Proceedings of the 19th International Conference on World Wide Web, Raleigh, North Carolina, USA, April 26-30, 2010. ACM, 2010, pp. 811–820.DOI
  38. [38]W.-C. Kang and J. McAuley, “Self-attentive sequential recommendation,” in 2018 IEEE international conference on data mining (ICDM). IEEE, 2018, pp. 197–206.
  39. [39]Z. Fan, Z. Liu, Y. Wang, A. Wang, Z. Nazari, L. Zheng, H. Peng, and P. S. Yu, “Sequential recommendation via stochastic self-attention,” in Proceedings of the ACM web conference 2022, 2022, pp. 2036–2047.arxiv.org/abs/2201.06035
  40. [40]Y. Yang, C. Huang, L. Xia, C. Huang, D. Luo, and K. Lin, “Debiased contrastive learning for sequential recommendation,” in Proceedings of the ACM web conference 2023, 2023, pp. 1063–1073.DOI
  41. [41]Z. Li, A. Sun, and C. Li, “Diffurec: A diffusion model for sequential recommendation,” ACM Transactions on Information Systems, vol. 42, no. 3, pp. 1–28, 2023.arxiv.org/abs/2304.00686
  42. [42]S. Liu, A. Zhang, G. Hu, H. Qian, and T.-s. Chua, “Preference diffusion for recommendation,” in International Conference on Learning Representations, vol. 2025, 2025, pp. 79 844–79 881.arxiv.org/abs/2410.13117

Paper details

vlnc:W_g7237gmt
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 11

downloads · 1

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents