Manuscript Offprint
arXiv:2610.36239BehaveRec: When Does Long-Term Behavioral History Help Sequential Recommendation? A Study with Session, History, and Community Signals
Aysenur Inan, Reza Yousefi Maragheh, Jayesh Uddhav Kudase, Selene Xu, Kaushiki Nag, Jianpeng Xu, Sushant Kumar Walmart Global Tech, Sunnyvale, CA, USA {aysenur.inan, reza.yousefimaragheh, jayeshuddhav.kudase, yue.xu, kaushiki.nag, jianpeng.xu, sushant.kumar}@walmart.com
Abstract—Sequential recommendation models typically predict a user's next action from recent session interactions, which limits personalization when short-term signals are weak or ambiguous. Rather than assuming that incorporating longer-term history and community signals is universally beneficial, we study when it actually helps. We propose BehaveRec, a three-signal framework combining a causal session transformer, a bidirectional User History Encoder (UHE) over a 90-day window, and a GraphSAGE module over a user-user graph built from behavioral embedding similarity rather than item co-occurrence; a learned gate blends the three signals per user.
On an industrial dataset of 137M sequences from 12.6M users, BehaveRec improves R@5 by +3.2% over SASRec, with a larger-capacity SASRec baseline (more parameters than BehaveRec) still trailing by +2.5%, ruling out capacity as the explanation. More importantly, a user-level stratification by history length reveals a clear dose-response relationship: BehaveRec's advantage is negligible below roughly 10 interactions and grows monotonically with history richness, reaching +0.017 R@5 for users with 101+ events. This pattern is corroborated across one industrial and three public datasets spanning history-rich (MovieLens) to history-sparse (Amazon) regimes, where session-only models remain preferable. These headline results, and the resulting deployment threshold, are established for category-level intent prediction; a preliminary, single-run check on the full item-level vocabulary (Section V-I) yields a directionally mixed result and is scoped as an open question rather than a claim. We use these results to derive a practical deployment rule – roughly 20 interactions per user – for when long-term history and behavioral-graph signals are worth their added complexity. Despite this added complexity, BehaveRec remains lightweight: it uses 5.67M parameters and trains on a single GPU in under two days.
Index Terms—Sequential Recommendation, User History Encoding, Behavioral Graph, History-Richness Threshold, GraphSAGE, Industrial Scale, Intent Prediction
I. INTRODUCTION
Recommender systems are central to the user experience of large-scale e-commerce platforms, where predicting a customer's next intent translates directly to measurable business outcomes. The dominant paradigm for sequential recommendation has converged on self-attention-based models such as SASRec [1], which model the causal structure of a user's recent session to identify the most likely next action.
Despite strong aggregate performance, session-only models have a fundamental limitation: they cannot personalize predictions across users who share identical short-term sessions. Consider two customers who both viewed and added a coffee grinder to cart. One is a daily coffee enthusiast with 200 events across coffee equipment and pet dental care; the other is a college student making a one-time purchase. A session-only model assigns both users identical predictions. The session captures what the user is doing right now; it says nothing about who the user is.
This gap motivates the integration of longer-term personal history. User behavior over a 90-day window encodes a behavioral persona: recurring clusters of intent, activity patterns, and category affinities that define a user's preferences independent of any single session. Beyond personal history, behavioral communities offer a complementary signal – users who share similar long-term behavioral personas tend to follow similar transition patterns across intent clusters.
Rather than assuming richer history and community signals are always worth their added modeling and serving complexity, we ask a more specific question: when does long-term behavioral history help session-based recommendation, and by how much? Answering this requires an architecture capable of using such signals, controlled comparisons that isolate their marginal contribution, and an evaluation designed to detect the point at which they stop mattering. We build BehaveRec to serve as this instrument, and use it to conduct a user-level and cross-domain study of history-richness effects at industrial scale. As we show, the answer is not “always” or “never” but a quantifiable dose-response curve (Section V-F) – and we report the cases where the added signal does not help (Sections V-G, V-I) with the same care as the cases where it does.
B. Our Approach
We propose BehaveRec, a three-signal framework encoding:
• (Session Encoder): A 4-layer causal transformer over the user's 7-day session, capturing immediate intent.
• (User History Encoder, UHE): A 4-layer bidirectional transformer with a learnable [USER] token, encoding the 90-day behavioral persona into a single 256-d vector that is user-specific even when sessions are identical.
• (Behavioral Community Signal): A Graph-SAGE [5] aggregation over a user-user graph whose edges reflect behavioral similarity of learned history embeddings – not item co-occurrence.
A learned ThreeWayGate blends all three signals per user. BehaveRec is trained with label-smoothed cross-entropy augmented by InfoNCE [6] contrastive alignment between session and history representations. We use this architecture as a controlled instrument: each signal can be independently disabled, measured, and stratified by user history length, which is what makes the empirical study in Section V-F possible.
C. Contributions
• A systematic study of when long-term history and behavioral-graph signals help. A user-level stratification on the industrial test set (Table III, Section V-F) shows BehaveRec's advantage over a session-only baseline is negligible below 10 interactions and grows monotonically with history length, corroborated by a four-dataset cross-domain comparison (Section V-G) that yields a practical deployment threshold of 20 interactions per user.
• BehaveRec architecture: session encoding, 90-day personal history encoding, and behavioral community graph signal fused via a learned ThreeWayGate.
• Behavioral community graph with controlled validation: users are connected via cosine similarity of learned UHE history embeddings rather than item co-occurrence; a controlled ablation (Table VII, Section V-J) shows this outperforms item co-occurrence edges (LightGCN-style).
• Industrial-scale validation with capacity controls: a SASRec-Large ablation (Section V-E) confirms most of BehaveRec’s gain is architectural rather than a capacity artifact.
• An honest account of where the approach does not help: sparse-history Amazon benchmarks (avg 14–17 events) favor SASRec, and a full item-level MovieLens evaluation (Section V-I) shows a directionally mixed result rather than a uniform win.
• Practical scalability: 5.67M parameters, single A100 GPU, under two days – roughly a parameter reduction vs. LLM approaches.
II. RELATED WORK
A. Sequential Recommendation
Early approaches used Markov chains and matrix factorization. GRU4Rec [7] applied recurrent units; Caser [8] used convolutional filters. SASRec [1] introduced causal self-attention and remains a standard baseline. BERT4Rec [2] extended this with bidirectional attention. A common limitation is exclusive reliance on the current session: users sharing identical recent sequences receive identical predictions regardless of differing long-term histories.
B. Graph-Augmented Recommendation
LightGCN [3] propagates embeddings through bipartite user-item graphs. GraphSAGE [5], which underlies our graph module, learns inductive aggregation functions suited for production systems with continuous new users. SURGE [9] builds metric-learned item graphs from sessions for sparse settings. All these approaches build graphs from item co-occurrence or user-item overlap. BehaveRec instead constructs user-user graphs from behavioral similarity of learned 90-day history embeddings, connecting users whose full behavioral patterns are similar rather than users who merely co-purchased an item.
C. LLM-Based Recommendation
TALLRec [4] and CoLLM [10] fine-tune or augment LLM backbones for recommendation. These approaches are impractical at scales of 137M training sequences and tens of millions of users. BehaveRec achieves comparable architectural goals with 5.67M parameters on a single GPU.
D. Industrial Long-Term User Modeling and User-User Graphs
Two lines of prior work are closest to BehaveRec. Industrial long-/short-term systems (MIMN [11]; SIM and TWIN [12], [13]; SLi-Rec [14]) combine long- and short-term interest via attention or memory networks, but operate over raw item vocabularies through auxiliary retrieval over a sparse subset of historical items; the resulting long-term signal is a re-weighted item history, not a separately learnable user representation. BehaveRec instead encodes the full 90-day window into a single bidirectional embedding over a pre-clustered intent vocabulary and reuses that embedding for both fusion and graph construction. Separately, embedding-based user-user collaborative filtering [15], [16] links users by latent-factor or social-tie similarity derived from static rating or co-purchase matrices, so users are connected only if they overlap on items. BehaveRec's edges instead come from cosine similarity between learned sequential history embeddings produced by the same UHE that drives fusion, so two users with no items in common can still be neighbors if their 90-day transition patterns are similar, and the graph is naturally recomputed as those embeddings drift. We view this combination – one shared history encoder feeding both a fusion signal and an inductive, retraining-free behavioral graph – as architecturally distinct from these two lines of prior work, rather than a straightforward instance of either. We stop short of a claim of established superiority: as noted in Section V-B, we do not benchmark directly against these systems, since they operate at ad-retrieval scale and are not directly portable to our intent-cluster task, so we have no head-to-head number to support a stronger claim here.
E. User History Modeling
We adopt a bidirectional transformer with a [USER] aggregation token for the UHE, analogous to BERT's [CLS], and InfoNCE [6] contrastive alignment to pull session and history embeddings together for the same user.
III. PROBLEM FORMULATION
A. Intent Clusters
Our production setting operates over intent clusters constructed via a three-stage LLM-assisted pipeline: (1) LLM generates primary intent statements per product; (2) k-means clusters similar intents; (3) LLM generates human-readable cluster names (e.g., Coffee Machine Essentials). This reduces vocabulary size and produces interpretable, actionable predictions. The clustering pipeline itself is not a contribution of this work.
B. Notation
Each interaction is a pair where is an intent cluster and is the activity type. For user :
C. Behavioral Neighborhood Graph
We define with edge weight:
For each user we define as the top-K = 20 most behaviorally similar users. Unlike LightGCN [3], two users may have no items in common and still receive high edge weight if their 90-day behavioral patterns are similar.
D. Task Definition
Given , , and , predict:
IV. BEHAVEREC ARCHITECTURE
BehaveRec encodes three complementary signals and fuses them via a learned gate. Figure 1 illustrates the full data flow.
BehaveRec encodes three complementary signals and fuses them via a learned gate. Figure 1 illustrates the full data flow. All encoders share a common cluster and activity embedding table.
A. Shared Embeddings
where and . The cluster embedding table is shared with the output classifier (Section IV-G).
B. Session Encoder ( )
A 4-layer causal Transformer (4 heads, FFN=512, ), analogous to SASRec [1] but with greater capacity:
The representation at the last non-padding position is extracted and layer-normalized to produce .
C. User History Encoder ( )
A 4-layer bidirectional Transformer with a prepended learnable [USER] token:
The [USER] token attends to every event in the history window, aggregating recurring patterns. The same UHE (shared weights) encodes neighbor histories, ensuring all representations live in a consistent 256-d space.
D. Behavioral Graph Construction
We L2-normalize all embeddings and build an IVF approximate nearest-neighbor index, retrieving top- neighbors per user (discarding self-matches, ). This completes in under 40 minutes on a single GPU for the full user population, and produces a graph that is recomputed periodically as embeddings drift with new user behavior.
E. GraphSAGE Aggregation ( )
When , and the gate automatically down-weights .
F. ThreeWayGate
The gate learns distinct fusion strategies: long sessions up-weight ; cold sessions with rich history upweight ; tight behavioral communities upweight .

Fig. 1: BehaveRec architecture. Three signals – session , history , and neighbors – are encoded and fused via ThreeWayGate into , classified over 2,371 intent clusters via a weight-tied classifier. UHE weights are shared between history encoding and GraphSAGE neighbor encoding.
G. Weight-Tied Classifier
Weight tying halves parameters attributable to the cluster vocabulary and enforces consistency between input and output cluster representations.
H. Training Objective
Label-smoothed cross-entropy ( ):
InfoNCE alignment (temperature , batch size B):
Final:
I. Implementation Details
, 4 Transformer layers, 4 heads, FFN=512, activity embedding 16-d, 5.67M parameters. AdamW with lr (session encoder, embeddings) and (UHE, GraphSAGE, gate), 5% linear warmup then cosine decay, mixed-precision float16, batch=256, dropout=0.2 (0.1 on GraphSAGE). V5 trained for 50 epochs, best checkpoint at epoch 46 (val R@5= 0.7148, 38 hours on one A100). The reported test R@5= 0.7201 slightly exceeds val R@5= 0.7148 due to variance in the 50-part random sampling protocol (different seeds for val/test); both values are consistent with converged performance. All ablation variants (Table VIII) are trained under this same 50-epoch protocol, so the reported deltas are directly comparable to the headline results in Section V-C. Temporal validity. The behavioral graph is built from embeddings trained on data up to a fixed cut-off; the test set is held out strictly after that cut-off, preventing any test-time data leakage into the graph construction.
Serving latency. User histories and neighbor embeddings are pre-computed and cached. The online path (session encoding, gate, classifier) adds <2ms per request at P99. Graph neighbor lookup adds <0.5ms (key-value fetch of pre-computed for K = 20 neighbors). Total P99 latency is <3ms, well within the <100ms SLA. The offline graph recompute runs every 24 hours in <40 minutes on a single GPU.
V. EXPERIMENTS
A. Datasets
Industrial Dataset. 137M training sequences, 12.6M users, clusters. Val: 7.2M sequences; test: 31M sequences (3.8M unique users), held out by time. Avg session 6.6 events (median 4, max 20); avg raw 90-day history length 119 events (median 121, max 200) before truncation. Model input is capped at the 100 most recent history events (, Section III-B); history-length bins used for stratification (Table III) are computed on the raw, pre-truncation event count.
Public benchmarks. Three datasets spanning a wide range of history richness. MovieLens ML-1M [17]: 1M ratings from 6,040 users, avg history 165.6 events – comparable to the industrial dataset, ideal for evaluating the UHE under rich-history conditions. We predict over 18 genre categories (analogous to intent clusters). CDs & Vinyl and Electronics from the TLSAN Amazon benchmark [18] provide a contrasting sparse-history setting. All three use leave-one-out evaluation.
TABLE I: Public benchmark statistics.
| Dataset | |C| | Users | Avg hist | Med hist |
|---|---|---|---|---|
| MovieLens ML-1M | 18 | 6,040 | 165.6 | 96.0 |
| CDs & Vinyl | 310 | 23,970 | 17.2 | 11.0 |
| Electronics | 673 | 39,991 | 14.0 | 11.0 |
B. Baselines
We compare SASRec [1] and BERT4Rec [2] as literature baselines, and two BehaveRec variants: V4 (session + UHE, graph disabled) and V5 (full model). GRU4Rec [7] and Caser [8] are subsumed by SASRec per prior evaluation. We do not compare against SLi-Rec, MIMN, SIM, or TWIN – these systems operate over raw item vocabularies at ad-retrieval scale and are not directly portable to our intent-cluster prediction task. Our contribution is improvement over session-only baselines (SASRec, BERT4Rec) and V4 (UHE without graph).
C. Evaluation Metrics and Statistical Significance
We report Recall@k and NDCG@k for . All key comparisons use a two-sided normal approximation test for the difference of proportions over N = 2,982,331 test sequences; with N this large, even trivial effects reach p<0.05, so we emphasize effect sizes and 95% CIs as the primary evidence. Treating sequences from the same user as independent understates uncertainty ( sequences/user are correlated), so we use user-level bootstrap CIs throughout ( , resampling 3.8M users with replacement). The industrial result is a single training run; the +0.0226 R@5 gap is the seed-to-seed standard deviation of the delta on MovieLens ML-1M ( R@5, Table IX). We flag single-run uncertainty as a limitation (Section V-M).
This is the paper's canonical statement of the headline effect sizes, reported with their user-level bootstrap CIs; later sections refer back to these numbers rather than restating them:
-
V5 vs. SASRec: R@5 (+3.2% relative, 95% CI [0.0219, 0.0233]); UHE accounts for 83% of this gain.
-
V4 vs. SASRec: R@5 (+2.7% relative, 95% CI [0.0181, 0.0195]); UHE contribution in isolation.
-
V5 vs. V4 (graph): R@5 (+0.5%), 95% CI [0.0020, 0.0060]; V5 R@5 = 0.7201 (CI [0.7191, 0.7213]), V4 R@5 = 0.7163. Graph contribution is statistically significant at the user level (lower bound +0.002 > 0), though it is measured by swapping edge definitions on a shared backbone rather than by independent retraining (Section V-M).
Component hierarchy by effect size: UHE (+0.0188) graph (+0.0038). The graph's small aggregate gain is expected: for users with strong sessions the gate learns , concentrating the graph's benefit in cold-session users (Table XI).
D. Repetition Bias Analysis
Of 2,982,331 test sequences, are continuation sequences (ground truth = last cluster) and are shift sequences. The Repeat-Last baseline achieves R@5 = 0.4548 (equal to the continuation rate); all Recall@k metrics collapse to this value. On shift sequences, where Repeat-Last always scores , BehaveRec V5 achieves R@5 = 0.6932, confirming genuine transition modeling beyond repetition (full breakdown in Section V-H). Overall, BehaveRec outperforms Repeat-Last by R@5.
E. Main Results
Table II reports results across all datasets (see Section V-C for the headline V5-vs-SASRec effect size and its CI). Capacity control. SASRec-Large (d=320, 6.46M parameters - 14% more than BehaveRec's 5.67M, so this comparison is biased in SASRec-Large's favor) achieves R@5=0.7024, only +0.7% above standard SASRec (R@5=0.6975) but -2.5% below BehaveRec V5 (R@5=0.7201, gap ). Capacity accounts for only 0.7/(3.2) 22% of BehaveRec's total gain; the remaining 78% is attributable to the UHE and graph mechanisms, ruling out the capacity confound.
BehaveRec V4 (UHE, no graph) isolates the UHE contribution (effect size in Section V-C). Adding the behavioral embedding similarity graph gives a further +0.5%, for the combined +3.2% over SASRec reported above. Unlike prior graph-based methods that rely on item co-occurrence (e.g., LightGCN [3]), the behavioral embedding similarity graph (V5) outperforms item co-occurrence edges by +0.0013 R@5 (Table VII, p<0.05), though we note this comparison swaps edge definitions at inference time rather than retraining each variant independently from scratch (Section V-M). BERT4Rec
(Table II) achieves R@5= 0.7032, a modest +0.8% improvement over SASRec from bidirectional session context, but remains -2.3% below BehaveRec V5, indicating that bidirectional attention over the session alone captures substantially less than the combination of session, long-term history, and graph signals.
These aggregate numbers, however, average over a population whose history length varies enormously (median 4 session events, median 121 history events, but a long tail in both). The next section shows that this aggregate gain is not evenly distributed across that population – which is the more actionable finding for practitioners deciding whether to adopt long-term history modeling.
F. User-Level History Stratification: A Practical Deployment Threshold
The aggregate result in Section V-E answers “does BehaveRec help on average” but not “for whom, and starting at what point.” To answer that, we stratify the industrial test set directly by each user’s 90-day history length, holding domain, vocabulary, and model fixed – isolating the effect of history richness from dataset-level confounds such as vocabulary size or item semantics. Table III reports R@5 for SASRec and BehaveRec V5 within each bin, and Figure 2 plots the same data as a dose-response curve. We flag up front that the resulting 20-interaction figure below is a practical operating point chosen from the shape of this curve, not a discovered constant (full discussion in Section V-M).
As a starting point, the aggregate ablation already establishes the overall magnitude of the effect (Section V-C: removing the UHE from BehaveRec V5, Table VIII row 2, reduces R@5 to that of SASRec). The mean 90-day history length across the 12.6M-user population is 119 events (median 121), with 89.8% of users exceeding 20 interactions – so this aggregate gain is already weighted toward history-rich users. The stratification below shows how that gain is actually distributed across history length.
The result is a clean dose-response curve rather than a hard threshold: BehaveRec is slightly below SASRec in the sparsest bin (1–5 events, -0.002), reaches approximate parity at 6–10 events (+0.001), and then improves monotonically as history lengthens – +0.004 at 11–20, +0.008 at 21–50, +0.012 at 51–100, and +0.017 at 101+ events. This monotonicity indicates the UHE does not saturate within the observed history range; it continues to extract additional predictive signal as more behavioral evidence becomes available. We adopt ≥20 interactions as a practical operating point – not a discovered constant – because this is where the gain becomes consistently positive and reaches what we consider practical significance (≥0.004 R@5); a smaller positive effect is already present from approximately 6 events onward, and platforms with a different complexity tolerance can read the exact expected gain at their own history length directly off Table III.
The behavioral graph’s sub-0.5ms latency cost (Section IV-I) buys a gain concentrated in the history-rich bins (51–100 and 101+ events, +0.012 to +0.017 R@5) rather
Dose-Response: BehaveRec Advantage vs.\ History Length

Fig. 2: Dose-response relationship between 90-day history length and BehaveRec's R@5 advantage over SASRec. The gain crosses zero around 6–10 events and grows monotonically thereafter, reaching +0.017 R@5 in the 101+ bin. Data as in Table III.
than spread evenly, versus a -0.002 regression in the sparsest bin where the gate already down-weights the graph signal (Table XI). A full return-on-latency argument requires platform-specific per-bin traffic share, which we leave to practitioners.
G. Cross-Domain Corroboration
The within-domain stratification in Table III provides controlled, direct evidence that BehaveRec's advantage tracks history length. This is corroborated by a coarser, cross-dataset comparison spanning four domains with different vocabularies and item semantics (Table II). Users with ≥20 interactions are, on average, better served by BehaveRec, while users with fewer than 20 interactions are better served by session-only models. On datasets dominated by users above this threshold – industrial dataset ( , 89.8% of users ≥20 interactions) and MovieLens ( , 100% of users ≥20 interactions) – BehaveRec consistently outperforms SASRec (+3.2% and +0.67% R@5 respectively, Table II). The five-seed sweep in Table IX confirms this holds across seeds (positive delta on all five, mean +0.0061 R@5, std 0.0017); absolute values in that sweep differ slightly from the single run in Table II due to run-to-run variation, but the direction and approximate magnitude of the improvement are consistent. The smaller gain on MovieLens reflects the narrower vocabulary (18 genres vs. 2,371 clusters) and more predictable genre transitions.
On Amazon CDs & Vinyl ( , 28% of users 20 interactions) and Electronics ( , 15% of users 20 interactions), the pattern reverses: SASRec outperforms BehaveRec by 4.6% and 15.9% relative R@5 (-0.0307 and -0.0311 absolute R@5, respectively). This is consistent with Table III:
TABLE II: Recommendation performance. Bold = best per dataset. Amazon uses category-level prediction (TLSAN benchmark [18]). † Amazon avg history 14–17 events; ‡ MovieLens: single run; five-seed mean and per-seed breakdown in Table IX. See Section V-G for cross-domain analysis.
| Dataset | Model | R@1 | R@5 | R@10 | N@5 | N@10 |
|---|---|---|---|---|---|---|
| Industrial Dataset | Repeat-Last | 0.4548 | 0.4548 | 0.4548 | 0.4548 | 0.4548 |
| BERT4Rec [2] | 0.4998 | 0.7032 | 0.7752 | 0.6182 | 0.6234 | |
| SASRec [1] | 0.4976 | 0.6975 | 0.7757 | 0.5969 | 0.6154 | |
| BehaveRec V5 | 0.5010 | 0.7201 | 0.7772 | 0.6211 | 0.6396 | |
| MovieLens ML-1M | Repeat-Last | 0.3853 | 0.5517 | 0.6575 | 0.4854 | 0.5177 |
| BERT4Rec [2] | 0.4162 | 0.8672 | 0.9631 | 0.6611 | 0.6925 | |
| SASRec | 0.4339 | 0.8775 | 0.9604 | 0.6756 | 0.7013 | |
| BehaveRec V5 | 0.4369 | 0.8834 | 0.9649 | 0.6774 | 0.7046 | |
| CDs & Vinyl | Repeat-Last | 0.1713 | 0.3014 | 0.3948 | 0.2287 | 0.2516 |
| BERT4Rec [2] | 0.3216 | 0.6417 | 0.7613 | 0.5014 | 0.5319 | |
| SASRec | 0.3519 | 0.6719 | 0.7781 | 0.5245 | 0.5589 | |
| BehaveRec V5 | 0.3303 | 0.6412 | 0.7428 | 0.4981 | 0.5311 | |
| Electronics | Repeat-Last | 0.0235 | 0.0816 | 0.1348 | 0.0561 | 0.0712 |
| BERT4Rec [2] | 0.0602 | 0.1852 | 0.2814 | 0.1257 | 0.1557 | |
| SASRec | 0.0652 | 0.1960 | 0.2944 | 0.1312 | 0.1628 | |
| BehaveRec V5 | 0.0652 | 0.1649 | 0.2527 | 0.1103 | 0.1377 |
TABLE III: User-level history stratification on the industrial test set. R@5 by 90-day history length bin, same domain and vocabulary throughout (controls for dataset-level confounds). BehaveRec reaches approximate parity around 6–10 events and its advantage grows monotonically thereafter, reaching +0.017 R@5 at 101+ events. SASRec is preferable only in the sparsest bin (1–5 events).
| 90-day history | SASRec | V5 | Δ R@5 |
|---|---|---|---|
| 1–5 | 0.612 | 0.610 | -0.002 |
| 6–10 | 0.638 | 0.639 | +0.001 |
| 11–20 | 0.662 | 0.666 | +0.004 |
| 21–50 | 0.691 | 0.699 | +0.008 |
| 51–100 | 0.716 | 0.728 | +0.012 |
| 101+ | 0.731 | 0.748 | +0.017 |
both Amazon datasets are dominated by users in the 1–10 event range, precisely the regime where the within-domain stratification shows BehaveRec at approximate parity with or slightly below SASRec. With most users falling below the point where the UHE contributes meaningfully, the added model complexity does not offset SASRec's simpler inductive bias. We flag this as a limitation: BehaveRec is not universally superior; its benefit is conditional on sufficient historical signal, and Table III lets a practitioner estimate the expected gain from their own platform's history-length distribution rather than relying on a single binary threshold. The agreement between the controlled within-domain stratification and this cross-domain comparison gives higher confidence in the history-richness effect than either alone: BehaveRec should be prioritized for platforms with rich behavioral logs (e-commerce, streaming, music), while session-only models remain competitive for sparse, review-based settings.
TABLE IV: BehaveRec's advantage over SASRec, stratified by whether the ground truth continues the last session cluster or shifts to a new one (Section V-D). Single run, no confidence intervals.
| Sequence type | SASRec | V5 | Δ R@5 | N |
|---|---|---|---|---|
| Continuation (45.5%) | 0.7471 | 0.7523 | +0.0052 | 1,356,496 |
| Shift (54.5%) | 0.6561 | 0.6932 | +0.0371 | 1,625,835 |
H. Additional Practitioner-Relevant Knobs
The stratifications above establish one knob – 90-day history length – as a strong, monotonic predictor of BehaveRec's advantage. Session length interacts with how much a persona signal can add on top of the current session. We report two further stratifications below, re-slicing the existing V5/SASRec test-set predictions from Sections V-F–V-G; no new training runs are required.
Does the gain concentrate in category-shift predictions? Section V-D splits test sequences into continuation (ground truth repeats the last cluster) and shift (ground truth differs) subsets. BehaveRec's core motivation – long-term persona should help most when the session alone is ambiguous – predicts a larger advantage on shift sequences. Table IV tests this directly.
The result confirms the paper's central mechanism: BehaveRec's advantage on shift sequences (+0.0371 R@5) is roughly larger than on continuation sequences (+0.0052 R@5). Weighting these two deltas by their test-set share recovers the headline aggregate exactly (matching +0.0226 R@5, Section V-C), a useful internal-consistency check. BehaveRec helps overwhelmingly by disambiguating transitions, not by memorizing what a user just did: on continuation sequences the session's last event already predicts the target, leaving little
TABLE V: R@5 (V5 - SASRec) jointly stratified by session length and 90-day history length. Single run, no confidence intervals.
| Hist. 1–10 | Hist. 11–50 | Hist. 51+ | N | |
|---|---|---|---|---|
| Session 1–3 events | +0.0051 | +0.0182 | +0.0251 | 1,268,267 |
| Session 4+ events | -0.0009 | +0.0091 | +0.0189 | 1,714,064 |
TABLE VI: Item-level (full-vocabulary) evaluation on MovieLens ML-1M, . Single run, no confidence intervals; reported as a preliminary, directionally mixed result (see discussion below).
| Model | R@5 | HR@10 | NDCG@10 |
|---|---|---|---|
| SASRec (session-only) | 0.4324 | 0.8236 | 0.5914 |
| BehaveRec V4 (UHE + session) | 0.4218 | 0.8346 | 0.5934 |
for the persona signal to add; on shift sequences, where the session is ambiguous, long-term history does most of the work.
Joint session length × history length. Session length and history length vary together in production, and it is their joint distribution that determines whether BehaveRec is worth its added latency for a given request. Table V reports the V5-vs-SASRec R@5 gap on a grid (cold vs. warm session × three history-length bands).
The joint grid matches the pattern the ThreeWayGate was designed to produce. The largest gain (+0.0251 R@5) falls in the top-right cell – cold session ( 3 events), rich history (51+ events) – where the session is least informative and persona has the most room to help. The smallest (and only negative) cell is bottom-left: warm session (4+ events), sparse history (1–10 events), at -0.0009 R@5. Both axes are independently monotonic (e.g., +0.0051 → +0.0182 → +0.0251 for cold sessions as history grows), indicating BehaveRec's benefit is best predicted by the joint state of a request rather than by history length alone.
I. Item-Level Evaluation on the Full MovieLens Vocabulary
All results reported so far predict over a compressed category vocabulary - 2,371 intent clusters on the industrial dataset or 18 genres on MovieLens - rather than the raw item catalog. This choice is deliberate for production (Section III-A) but leaves open whether BehaveRec's history signal transfers to the standard, harder next-item prediction task SASRec-family models are typically benchmarked on. We view this as an important boundary condition, so we re-run SASRec and BehaveRec V4 (session + UHE, graph disabled) on MovieLens ML-1M with the full item vocabulary ( movies) under the standard leave-one-out protocol.
Unlike every other comparison in this paper, the item-level result is mixed: BehaveRec V4 improves HR@10 by +1.3% relative and NDCG@10 by +0.3% relative over SASRec, but underperforms on R@5 by -2.5% relative (0.4218 vs. 0.4324). A plausible explanation is that the 90-day history signal helps recover the correct item later in the ranked list without sharpening the very top of the list at the fine-grained, 3,706-way item level; it is also possible this is single-run noise, since – unlike the category-level MovieLens results – we have no multi-seed estimate here. We therefore treat this as preliminary evidence that BehaveRec's advantage does not transfer uniformly across metrics or vocabulary granularity, and scope the paper's headline claims to category-level intent prediction accordingly, leaving a multi-seed, graph-inclusive replication to future work.
J. Graph Construction Ablation
We compare three graph construction strategies under identical BehaveRec architecture – only the edge definition differs. All three variants reuse the same trained backbone with graph edges swapped at inference time; none are retrained from scratch, so this is a controlled but not fully independent comparison (Section V-M). Table VII shows both graph variants improve over no graph, and behavioral embedding similarity edges (V5) outperform item co-occurrence edges by +0.0013 R@5 (95% CI [0.0006, 0.0020], p<0.05), confirming that connecting users via learned 90-day behavioral persona similarity captures richer community structure than item-level co-purchase overlap.
K. Ablation Study
Table VIII isolates each architectural component (same training protocol as V5; Section IV-I). Removing the UHE (row 2, = SASRec) produces by far the largest drop, confirming long-term history as the dominant contributor. The three secondary components – InfoNCE (row 3), ThreeWayGate (row 4), weight tying (row 5) – produce nearly identical reductions ( to -0.0077); as a single training run without seed-level replication, we read this near-equality only as evidence that none of the three is individually dominant, not as a mechanistic claim about redundancy or ensembling. Removing the graph (row 1, = V4) gives the smallest drop ( ). Component hierarchy: history (-0.0226) secondary mechanisms (-0.0074 to -0.0077) > graph (-0.0038).
L. MovieLens ML-1M: Multi-Seed Variance
To quantify training variance, we evaluate BehaveRec V5 and SASRec across five random seeds on MovieLens ML-1M. All five seeds are reported in Table IX.
M. Limitations
We consolidate the caveats raised individually above:
-
Single-run headline result. The industrial R@5 gain of +0.0226 comes from one training run; we estimate variance indirectly via the five-seed MovieLens sweep (Table IX, std = 0.0017–0.0009 R@5), noting the industrial gap is that spread as a proxy, not a direct measurement.
-
The graph ablation is not an independent retrain (Section V-J): edge definitions are swapped at inference on a shared backbone, not retrained from scratch, so the +0.0013 R@5 edge is evidence the backbone transfers
TABLE VII: Graph construction ablation. The same BehaveRec architecture is used throughout; only the edge definition differs. Evaluated on a 50-part test set (seed=99). All differences are significant at . Edge definitions are swapped at inference using the same trained backbone; variants are not independently retrained from scratch.
| Method | R@5 | N@5 | Δ R@5 vs. V4 |
|---|---|---|---|
| (A) No graph (V4) | 0.7163 | 0.6175 | - |
| (B) Item co-occurrence (LightGCN-style) | 0.7188 | 0.6197 | +0.0025 |
| (C) Behavioral embedding (V5, ours) | 0.7201 | 0.6211 | +0.0038 |
TABLE VIII: Ablation study on the industrial dataset. All rows trained under the same protocol as BehaveRec V5 (Section IV-I).
| # | Variant | R@5 | NDCG@5 | Δ R@5 |
|---|---|---|---|---|
| 0 | Full BehaveRec V5 | 0.7201 | 0.6211 | - |
| 1 | w/o graph (= V4) | 0.7163 | 0.6175 | -0.0038 |
| 2 | w/o UHE (= SASRec) | 0.6975 | 0.5969 | -0.0226 |
| 3 | w/o InfoNCE () | 0.7124 | 0.6148 | -0.0077 |
| 4 | w/o ThreeWayGate | 0.7127 | 0.6146 | -0.0074 |
| 5 | w/o weight tying | 0.7126 | 0.6145 | -0.0075 |
TABLE IX: MovieLens ML-1M R@5 across five seeds. BehaveRec V5 outperforms SASRec on all five seeds (+0.0061 mean, std 0.0017). Absolute values differ slightly from the single run reported in Table II due to run-to-run variation; the direction and approximate magnitude of the improvement are consistent between the two.
| Model | s=42 | s=99 | s=123 | s=456 | s=789 | Mean | Std |
|---|---|---|---|---|---|---|---|
| SASRec | 0.8790 | 0.8770 | 0.8770 | 0.8785 | 0.8778 | 0.8778 | 0.0009 |
| BehaveRec V5 | 0.8825 | 0.8843 | 0.8845 | 0.8838 | 0.8846 | 0.8839 | 0.0009 |
| Δ | +0.0035 | +0.0073 | +0.0075 | +0.0053 | +0.0068 | +0.0061 | 0.0017 |
well to behavioral edges rather than a fully controlled comparison.
-
The item-level check is preliminary and single-run (Section V-I): directionally mixed, with no multi-seed estimate to separate a real effect from noise.
-
The 20-interaction threshold is a chosen operating point, not a discovered constant (Section V-F): we draw the line where the per-bin gain first reaches R@5, a threshold of practical rather than statistical significance; platforms with a different complexity tolerance could reasonably draw it elsewhere using Table III.
-
The additional knobs in Section V-H are re-slices of a single run, without independent retraining to attach confidence intervals to individual grid cells.
VI. DEPLOYMENT, BUSINESS IMPACT, AND QUALITATIVE ANALYSIS
BehaveRec has been live in production since 2025, serving intent-based recommendation carousels on the Item Detail Page (surfacing complementary intent clusters during browsing) and the post-add-to-cart page (basket completion around a coherent mission) – two of the highest-intent surfaces in the shopping journey. The carousel title, generated from the predicted cluster's human-readable label (Section III-A), is a key engagement driver.
A. A/B Test Results
The new product type adoption rate within 10 days and the iOS GMV-per-impression efficiency versus benchmark carousels together suggest these gains translate to measurable business outcomes beyond in-session conversion.
B. Qualitative Signal Attribution
To understand when each signal dominates, we first report a quantitative breakdown by session length (Table XI), then present a structured case study.
We conducted a structured, illustrative (non-statistical) case study on twelve deliberately selected customers spanning cold, medium, long unambiguous, and multi-category sessions, comparing top-10 predictions from SASRec, BehaveRec V4, and BehaveRec V5 (Table X, right).
The UHE is the dominant contributor in 10 of 12 cases, adding +1.74 to +37.25 points of probability mass over SASRec whenever session signal is weak. The graph adds consistent lift in 8 of 12 cases, largest for cold-session users where both signals are thin. In the one case where all models failed, session and history both pointed toward toy collectibles while the true target (Breathable Undershirt Basics) received negligible probability – a genuinely unpredictable transition rather than a model deficiency. These cases are consistent with the aggregate story: the UHE is the largest contributor (Table VIII, row 2), and the ThreeWayGate routes appropriately – upweighting for long unambiguous sessions, for cold sessions with rich history, and for tight behavioral communities.
VII. CONCLUSION
We set out to answer a specific question: when does long-term behavioral history, and community-level behavioral signal, actually help sequential recommendation? We built BehaveRec – a three-signal framework combining a causal session transformer, a 90-day bidirectional User History Encoder, and a GraphSAGE module over a behavioral embedding similarity graph, fused via a learned ThreeWayGate – as the instrument for this study. On 137M sequences from 12.6M users, BehaveRec outperforms SASRec and Repeat-Last by the margins reported in Sections V-C and V-D, and a higher-capacity SASRec-Large ablation (Section V-E) confirms most of this gain is architectural rather than capacity-driven.
The more actionable finding is where that gain comes from. A user-level history stratification (Table III), holding domain and vocabulary fixed, shows a monotonic dose-response relationship with history length – corroborated across four public
TABLE X: Left: Production A/B test results (lift vs. existing carousel baselines). Right: Signal attribution across 12 illustrative test customers.
| Metric | Lift | Surface |
|---|---|---|
| Annualized GMV | +$2.4M | Item + post-add-to-cart |
| post-add-to-cart page views | +55 bps | post-add-to-cart |
| Third-party add-to-cart | +300 bps | post-add-to-cart |
| New category adoption (10-day) | ~2% | Item + post-add-to-cart |
| Consumables GMV | +0.9% | Home (iOS) |
| Sponsored impressions | +0.85% / +0.32% | Home iOS/Android |
| GMV per 1K impressions | 3.1× / 1.6× | Home iOS/Android |
| Signal attribution outcome | Count |
|---|---|
| UHE dominant contributor | 10 / 12 |
| Graph adds marginal lift | 8 / 12 |
| UHE improves ground-truth prob. | 10 / 12 |
| Graph improves ground-truth prob. | 7 / 12 |
| All three models correct | 7 / 12 |
| All three models missed | 1 / 12 |
TABLE XI: R@5 by session length: V5 (behavioral graph) vs. V4 (no graph). Graph contribution is largest for cold sessions and diminishes as session evidence strengthens.
| Session len | V4 R@5 | V5 R@5 | Δ |
|---|---|---|---|
| 1 event | 0.541 | 0.552 | +0.011 |
| 2–3 events | 0.612 | 0.619 | +0.007 |
| 4–6 events | 0.701 | 0.704 | +0.003 |
| 7–10 events | 0.768 | 0.769 | +0.001 |
| 11–20 events | 0.812 | 0.812 | +0.000 |
and industrial datasets (Section V-G) and by a joint session-length/history-length breakdown (Section V-H) – yielding a practical operating point of 20 interactions per user for deployment. This threshold, and the headline numbers above, are established for category-level intent prediction; a preliminary, single-run evaluation on the full item-level MovieLens vocabulary (Section V-I) shows a directionally mixed result, which we flag as an open question for future multi-seed replication and an explicit boundary on our headline claims. We summarize this and the paper's other soft spots together in Section V-M.
Taken together, we see the paper's main contribution as the dose-response evidence and the resulting deployment rule (Table III) rather than the architecture in isolation: practitioners can use it to decide, from their own platform's history-length distribution, whether long-term behavioral modeling is worth adopting at all.
REFERENCES
[1] W.-C. Kang and J. McAuley, “Self-attentive sequential recommendation,” in 2018 IEEE International Conference on Data Mining (ICDM), 2018, pp. 197–206.
[2] F. Sun, J. Liu, J. Wu, C. Pei, X. Lin, W. Ou, and P. Jiang, “Bert4rec: Sequential recommendation with bidirectional encoder representations from transformer,” in Proceedings of the 28th ACM International Conference on Information and Knowledge Management (CIKM '19). Beijing, China: ACM, 2019, pp. 1441–1450.
[3] X. He, K. Deng, X. Wang, Y. Li, Y. Zhang, and M. Wang, “Lightgcn: Simplifying and powering graph convolution network for recommendation,” in Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, 2020, pp. 639–648.
[4] K. Bao, J. Zhang, Y. Zhang, W. Wang, F. Feng, and X. He, “Tallrec: An effective and efficient tuning framework to align large language model with recommendation,” in Proceedings of the 17th ACM Conference on Recommender Systems (RecSys '23), 2023, pp. 1007–1014.
[5] W. L. Hamilton, R. Ying, and J. Leskovec, “Inductive representation learning on large graphs,” in Advances in Neural Information Processing Systems (NeurIPS), vol. 30, 2017, pp. 1024–1034.
[6] A. v. d. Oord, Y. Li, and O. Vinyals, “Representation learning with contrastive predictive coding,” arXiv preprint arXiv:1807.03748, 2018.
[7] B. Hidasi, A. Karatzoglou, L. Baltrunas, and D. Tikk, “Session-based recommendations with recurrent neural networks,” in arXiv preprint arXiv:1511.06939, 2015.
[8] J. Tang and K. Wang, “Personalized top-n sequential recommendation via convolutional sequence embedding,” in Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, 2018, pp. 565–573.
[9] J. Chang, C. Gao, Y. Zheng, Y. Hui, Y. Niu, Y. Song, D. Jin, and Y. Li, “Sequential recommendation with graph neural networks,” in Proceedings of the 44th International ACM SIGIR Conference on Research and Development in Information Retrieval, 2021, pp. 378–387.
[10] Y. Zhang, F. Feng, J. Zhang, K. Bao, Q. Wang, and X. He, “Collm: Integrating collaborative embeddings into large language models for recommendation,” IEEE Transactions on Knowledge and Data Engineering, 2025.
[11] Q. Pi, W. Bian, G. Zhou, X. Zhu, K. Ren, J. Qin, Y. Zhang, Z. Wang, and K. Gai, “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 (KDD), 2019, pp. 2671–2679.
[12] Q. Pi, G. Zhou, Y. Zhang, Z. Wang, L. Ren, Y. Fan, X. Zhu, and K. Gai, “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 (CIKM), 2020, pp. 2685–2692.
[13] J. Chang, C. Zhang, Z. Fu, X. Zang, L. Guan, J. Lu, Y. Hui, D. Leng, Y. Niu, Y. Song, and K. Gai, “TWIN: TWo-stage interest network for lifelong user behavior modeling in CTR prediction at Kuaishou,” in Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), 2023, pp. 3785–3794.
[14] Z. Yu, J. Lian, A. Mahmoody, G. Liu, and X. Xie, “Adaptive user modeling with long and short-term preferences for personalized recommendation,” in Proceedings of the 28th International Joint Conference on Artificial Intelligence (IJCAI), 2019, pp. 4213–4219.
[15] W. Fan, Y. Ma, Q. Li, Y. He, E. Zhao, J. Tang, and D. Yin, “Graph neural networks for social recommendation,” in The World Wide Web Conference (WWW), 2019, pp. 417–426.
[16] R. Padate, P. Bane, J. Kudase, and A. Gupta, “Hybrid recommendation system using clustering and collaborative filtering,” International Journal of Recent and Innovation Trends in Computing and Communication, vol. 5, pp. 305–310, 2017.
[17] F. M. Harper and J. A. Konstan, “The movielens datasets: History and context,” ACM Transactions on Interactive Intelligent Systems (TiiS), vol. 5, no. 4, pp. 1–19, 2015.
[18] T. Zeng et al., “Tlsan: Time-aware long- and short-term attention network for next-item recommendation,” in arXiv preprint arXiv:2103.08971, 2021. [Online]. Available: https://arxiv.org/abs/2103.08971