Next Session Prediction in Recommender Systems
- Next Session Prediction (NSP) is a formulation that forecasts a complete session of positive interactions rather than predicting a single item.
- It employs hierarchical sequence encoding, using modules like ISE and SSE to aggregate item interactions into session-level representations, thereby reducing computational complexity.
- Empirical evaluations show that NSP enhances retrieval performance and scalability, with notable improvements in recall and hit rate over traditional next-item methods.
Next Session Prediction (NSP) is a recommendation formulation in which supervision is attached to a future session or request rather than to a single next interaction. In the recent generative recommendation literature, this shift is presented as a response to a “fundamental misalignment” between conventional next-item prediction and practical systems that answer one request by returning multiple items at once. Under this view, the target is either the set of items with which a user will positively interact in the next session or a session representation that can retrieve those items efficiently, rather than one next clicked item generated autoregressively (Huang et al., 14 Feb 2025, Liang et al., 16 Aug 2025).
1. Conceptual scope and definition
In the formulation introduced by SessionRec, the user set is , the item set is , and a user history is represented as
where is the session identifier and interactions include both positive interactions such as click, purchase, like, and effective view, and negative interactions such as exposure and dislike. The defining contrast is
versus
The first objective is multi-item and aligned with one future session; the second predicts only one next positive item. The paper’s core claim is that real recommendation requests are issued at the session or request level, so “all items that the user might be positive interacted with need to be predicted at once, and it is impossible to predict item by item” (Huang et al., 14 Feb 2025).
TBGRecall adopts the same shift for e-commerce retrieval, but operationalizes it as prediction of a future session representation rather than direct item-by-item generation. It reformulates user behavior into a multi-session sequence in which each session begins with a context token followed by item tokens, and the hidden state at the new session token becomes the user intent vector for ANN retrieval. This makes the dependency structure session-wise autoregressive rather than item-wise autoregressive, which the paper argues is better aligned with retrieval systems that must return an unordered set of items for one request session (Liang et al., 16 Aug 2025).
2. SessionRec and the next-session prediction paradigm
SessionRec defines a hierarchical sequence encoder with four parts: an embedding module, an Item-based Session Encoder (ISE) for intra-session aggregation, a Session-based Sequence Encoder (SSE) for inter-session modeling, and a session prediction module. Item ID and discrete side features are embedded, concatenated, and projected through an MLP: The ISE then compresses all item embeddings sharing a session identifier into one session embedding,
and the SSE maps the session sequence to a user representation,
The framework permits max pooling, mean pooling, RNNs, and Transformers for ISE; the reported best practice is mean pooling. For SSE, the framework is model-agnostic, but the best-performing instantiation uses HSTU, with a decoder-only Transformer-like architecture recommended to preserve causality and avoid temporal leakage (Huang et al., 14 Feb 2025).
The same hierarchy is also the efficiency argument. If the average number of items per session is , converting an item sequence into a session sequence shortens the encoder input by a factor of 0. For a Transformer-like encoder with 1 attention complexity, the paper states that complexity is reduced by approximately 2. This matters especially when many negative interactions are included, because negatives are folded into session tokens before long-range sequence modeling, making “full-interaction modeling” feasible (Huang et al., 14 Feb 2025).
Prediction is session-based retrieval. Each candidate item 3 is scored by
4
and the top-5 items are returned. The main training objective is a retrieval loss against all positive items in the next session,
6
together with a rank loss that compares positives against negative interaction items from the same next session,
7
The final objective is
8
The paper interprets this as analogous to an industrial “retrieval then ranking” cascade: random negatives ensure retrieval coverage, while in-session hard negatives refine ordering inside the predicted next session (Huang et al., 14 Feb 2025).
3. Industrial generative retrieval with session-level prediction
TBGRecall applies NSP to the retrieval stage of large-scale e-commerce recommendation, especially Taobao’s homepage “Guess You Like” scenario. Its input is a multi-session sequence
9
where 0 is the context token for session 1 and 2 is the context token of the newly arrived session. Token embeddings are constructed by summing item ID, action, side information, and scenario/context embeddings,
3
The hidden state at 4 becomes the final user latent representation for ANN retrieval, scored by
5
This is the paper’s operational definition of next-session prediction: predict the next session context embedding, then retrieve many items at once (Liang et al., 16 Aug 2025).
The architecture is based on HSTU and includes a Session Mask, session-wise RoPE, Token-Specific Network (TSN), Multi-Session Prediction (MSP), and DeepSeekMoE. The Session Mask is built on top of a causal mask and further renders interactions between items within the same session invisible. Session-wise RoPE assigns the same positional encoding to all tokens within one session, so the model captures relative dependencies at the session level rather than at the item index level. TSN uses token-specific linear layers because context tokens and item tokens have different semantics and distributions. MSP adapts multi-token prediction to the session dimension for context tokens. The MoE configuration uses 24 routed experts and 1 shared expert with top-2 experts activated per forward pass (Liang et al., 16 Aug 2025).
Its NSP loss is defined with Multi-Scene Normalization: 6 Here 7 contrasts all recommended items in session 8 against randomly sampled negatives, 9 distinguishes clicked items from merely exposed items, and 0 distinguishes purchased items from merely clicked items. The result is a session-level retrieval objective with a click and purchase cascade layered on top (Liang et al., 16 Aug 2025).
4. Empirical evidence, scaling, and deployment
SessionRec evaluates NSP under both leave-one-item-out and leave-one-session-out. On KuaiSAR under leave-one-session-out, the strongest baseline HSTU+ reaches 1 and 2, while SessionRec-HSTU reaches 3 and 4, improvements of 5 and 6. On RecFlow, HSTU+ obtains 7 and 8, while SessionRec-HSTU reaches 9 and 0, improvements of 1 and 2. Even under leave-one-item-out, SessionRec-HSTU improves RecFlow 3 from 4 to 5 (6). The paper also reports model-agnostic gains above 39% across datasets, mean pooling as the best session encoder, and a 7-day A/B test in Meituan App in which SessionRec improved Pay PV by 0.603% and PVCTCVR by 0.564%. Its scaling-law analysis on about 400 million users reports a “trend of linear increase” in Recall@500 as training data volume and computing power increase exponentially, which the paper describes as a power-law scaling law similar to LLMs (Huang et al., 14 Feb 2025).
TBGRecall reports gains on both RecFlow and a large-scale TaoBao dataset. On RecFlow, TBGRecall reaches HR@20 7, HR@100 8, HR@500 9, HR@1000 0, HR@2000 1, and HR@4000 2, while the best baseline HSTU reaches HR@4000 3. On TaoBao, TBGRecall reaches HR@20 4, HR@100 5, HR@500 6, HR@1000 7, HR@2000 8, and HR@4000 9; the strongest production baseline Online(DT) reaches HR@4000 0, so the paper states that TBGRecall gains about 1 absolute HR@4000 over the strongest production baseline on TaoBao. The paper further reports a clear scaling law trend with a linear relationship between log model parameters and model performance, and a 7-day online A/B test on 5% randomized traffic in which Transaction Count improved by 0.60% and Transaction Amount by 2.16% (Liang et al., 16 Aug 2025).
5. Relation to earlier session-based recommendation
NSP emerged against a background in which most session-based recommendation methods predicted the next item within the current session rather than the next session as a whole. In news recommendation, CHAMELEON addressed the next-click question “what is the next most likely article a user might read in a session?” and combined supervised CNN-learned article embeddings with an LSTM session encoder, recency, popularity, and user context features, but it explicitly ignored users’ past sessions and remained a current-session next-item predictor (Moreira et al., 2018).
Several later models preserved that within-session formulation while expanding the encoder. SR-SAN used self-attention over the current session and took the last latent vector as a joint representation of current and global interest, but it did not model cross-session behavior (Fang, 2021). SimCGNN built a session graph, used two stochastic forward passes as positive pairs, and selected negatives from sessions with the same last item to reduce “same last-item confusion,” again for next-item prediction inside the current anonymous session (Cao et al., 2023). STAR revised session representations with before- and after-interval embeddings derived from intra-session time gaps, thereby treating time intervals as a signal for momentary interests and mindset shifts, but the target remained the next clicked item (Yeganegi et al., 2022). GSN-IAS combined a global item graph, Graph Spring Network, informative anchors, and GRU-based session encoders to capture both local co-occurrence and global latent similarity for next-item prediction (Zhang et al., 2022).
Two adjacent lines moved closer to NSP without fully adopting it. ISCON inferred implicit session contexts by graph embedding and clustering, then predicted the current session’s latent context from previous sessions and the partial current session, but its final output was still next-item recommendation (Oh et al., 2022). HierSRec imposed a hierarchical multi-task structure in which next-category prediction feeds next-item prediction and also creates a compact candidate set such as 4% of total items, but it still predicted the next item within the current session (Oh et al., 2023). MISApp, finally, framed next app prediction as a profile-free session problem with multi-hop session graphs, temporal and spatial context, and intent evolution from recent interactions, but its target was the next app 2, not the next session contents (Yang et al., 23 Mar 2026). These models are best read as precursors that made session structure, context, hierarchy, and multi-step dependencies explicit before NSP redefined the prediction unit itself.
6. Terminological ambiguity, limitations, and open questions
The acronym NSP is heavily overloaded. In NLP, it may denote BERT-style Next Sentence Prediction, including prompt-based NSP-BERT and multilingual coherence benchmarks; it also appears in dialogue evaluation and text segmentation as a continuity classifier (Sun et al., 2021, Chavan et al., 29 Oct 2025, Zhao et al., 2023, Isidro et al., 7 Jan 2026). In other areas it denotes Next Symbol Prediction for formal languages, Next Sequence Prediction for fast weight LLMs, and Next Scene Prediction for unified video generation (Bhattamishra et al., 21 Oct 2025, Hwang et al., 18 Feb 2026, Li et al., 15 Dec 2025). These are distinct from recommendation-system Next Session Prediction.
Within recommendation, the current NSP literature leaves several issues open. SessionRec assumes that reliable session identifiers are available or can be constructed, and its datasets were chosen partly because many standard benchmarks do not contain session IDs or negative interactions. It also does not formalize the future session as an ordered sequence beyond in-session ranking; operationally it is closer to a set prediction problem with ranking constraints. Its scaling-law analysis is qualitative rather than quantitatively fit (Huang et al., 14 Feb 2025). TBGRecall, in turn, does not provide a clean head-to-head NSP-versus-NTP ablation table, reports no explicit latency benchmark numbers, relies on ANN indices, nearline caching, and massive sparse embedding systems, and gives only a limited formal probabilistic treatment of session-level likelihood (Liang et al., 16 Aug 2025).
A plausible implication is that future NSP research will be shaped by data availability as much as by model design. The current evidence favors settings with explicit session boundaries, multiple items per request, and rich positive and negative interaction logs. It also suggests that the unresolved question is not whether session structure matters, but how to represent a future session: as a positive item set, as a retrieved session representation, or as an explicitly ordered sequence.