Generative recommendation benefits from long interaction histories, but the cost of processing them directly grows with history length. We propose RecMem, a recurrent memory compression framework guided by three desiderata: space invariance, semantic fidelity, and lifelong evolvability. RecMem compresses historical segments into a fixed set of memory slots using a bifurcated encoder-decoder with shared lower layers and slot-wise forget-gated updates. Recommendation supervision trains the memory to preserve predictive information, while stream-consistency training aligns predictions from sequential and packed processing. By construction, the memory state and decoder context are independent of history length; under contraction and approximate semigroup consistency, we further derive a horizon-independent bound on the state discrepancy between these two processing orders. On MerRec, RecMem uses 16 memory slots and a 216-token decoder context, compared with 1,200 tokens for HSTU-1200, while retaining 87.9% of HSTU-1200's Recall@10 and 97.0% of its Recall@200. It outperforms PHSTU and the evaluated recent-only and retrieval baselines, and analyses of distant history show that archived interactions contribute predictive signal.
Figures & tables
Figure 1: Overview of RecMem. Top: U folds the K archived segments into a fixed-size memory state, one segment at a time. (a) In each update, the slot-wise forget gate is computed from the mask-aware mean of E(St) . (b) Both branches start from the same MK−2 , and the packed update uses repeated segment-local positions and a causal mask. The two final states are decoded with the same Xrec and candidates; sg denotes stop-gradient. (c) Recent tokens attend to all memory slots and causally to each other. The decoder outputs at all recent positions, Hrec , enter the NCE loss with shifted positives Y+ and sampled negatives Y− ; at inference, the last row of Hrec scores candidate items. Blue, green, and orange mark shared, encoder-side, and decoder-side components.
Method
Dec. context
R@10
R@50
N@10
R@200
HSTU-1200
1200
48.18
63.88
31.62
74.44
HSTU-FullPrefix
t
48.98
65.64
32.32
—
PHSTU
215–227
32.74
48.58
20.45
61.10
HSTU-Recent-200
200
40.93
56.59
26.16
67.74
Ret-HSTU-16
216
41.03
57.54
26.53
68.84
RecMem-Main
216
42.27
59.95
26.66
71.96
Table 1: Recommendation quality on MerRec under the standard protocol, t∈[1200,2000) . Scores are percentages, displayed to two decimal places. Decoder context counts tokens processed per prediction. A dash denotes an unreported metric.
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
Parameter
Value
Embedding dimension d
256
Unique HSTU backbone blocks
24
Active blocks per path
16
Shared lower layers
8
Encoder upper layers
8
Decoder upper layers
8
Appendix
Table 2: Full hyperparameter configuration for RecMem on MerRec.
Method
Dec. context
R@5
R@10
R@50
R@100
R@200
N@5
N@10
N@50
N@100
N@200
HSTU-1200
1200
39.69
48.18
63.88
69.45
74.44
28.86
31.62
35.15
36.05
36.75
PHSTU
215–227
25.56
32.74
48.58
54.99
61.10
18.13
20.45
23.99
25.03
25.88
RecMem-Main
216
33.41
42.27
59.95
66.30
71.96
23.79
26.66
30.63
31.66
32.45
RecMem-Stream
216
33.48
42.36
60.12
66.51
72.20
23.87
26.74
30.73
31.77
32.56
Appendix
Table 3: All evaluated cutoffs for HSTU-1200, PHSTU, and RecMem under the standard protocol, t∈[1200,2000) . Scores are percentages. Best per metric in bold ; best among compressed methods underlined .
Model
Params. (M)
Unique blocks
Active/path
R@10
R@50
N@10
R@200
PHSTU
327.217
16
16
32.740
48.580
20.450
61.100
SharedStack-16
327.283
16
16
41.568
58.611
26.505
70.556
SplitTop-6/5/5
327.342
16
11
42.055
59.471
26.326
71.354
SplitTop-8/8/8 (default)
329.906
24
16
42.362
60.119
26.743
72.196
Appendix
Table 4: Capacity controls under the standard protocol. Scores are percentages; parameter counts are in millions. Shared parameters are counted once.
Anchors
Count
Main Δ R@10 [CI]
Stream Δ R@10 [CI]
Archived-newest
2 898 654
+4.413 [4.368, 4.460]
+4.576 [4.532, 4.623]
Archived-middle
7 593 974
+2.169 [2.145, 2.194]
+2.353 [2.327, 2.378]
Archived-oldest
1 044 050
+0.984 [0.931, 1.037]
+1.188 [1.133, 1.241]
Archived-only
11 536 678
+2.626 [2.605, 2.647]
+2.806 [2.785, 2.827]
No-recurrence
20 786 602
+0.318 [0.309, 0.327]
+0.433 [0.423, 0.443]
Appendix
Table 5: Recall@10 differences relative to HSTU-Recent-200 on matched anchors, in percentage points. Brackets give 95% confidence intervals from 2 000 user-clustered bootstrap resamples. Archived-only aggregates the three archived-history strata; no-recurrence anchors have no prior target-item occurrence in the visible prefix.
Condition
Infer L
R@5
R@10
R@50
N@10
RecMem (full)
1 000
33.32
41.48
57.88
26.72
RecMem (no memory)
1 000
22.03
28.62
44.84
17.78
RecMem (full)
2 000
33.23
41.35
57.69
26.63
RecMem (no memory)
2 000
15.17
20.23
34.14
12.10
Appendix
Table 6: Memory importance ablation. The no-memory variant zeros out all memory slots at inference, retaining only the recent window.
Method
Dec. context
R@5
R@10
R@50
R@100
R@200
N@5
N@10
N@50
N@100
N@200
HSTU-1200
1200
39.80
48.12
63.43
68.92
73.87
29.00
31.70
35.15
36.04
36.73
PHSTU
215–227
30.29
37.64
52.62
58.48
64.02
21.79
24.17
27.52
28.48
29.25
RecMem-Main
216
32.81
41.45
58.71
65.01
70.67
23.41
26.21
30.08
31.10
31.89
RecMem-Stream
216
32.92
41.58
58.94
65.27
70.96
23.50
26.31
30.20
31.23
32.03
Appendix
Table 7: Extended evaluation on MerRec (test positions t∈[1200,3000) , 1 800 steps, up to 2.5 × training horizon). Best per metric in bold ; best among compressed methods underlined .
Positions t
R@10
R@50
N@10
R@200
1200–1999
40.519
57.736
25.632
69.867
2000–4999
40.644
57.911
25.744
70.032
5000–7499
40.684
57.999
25.741
70.154
7500–9999
40.689
58.137
25.726
70.379
Appendix
Table 8: Long-history evaluation of the same RecMem-Stream checkpoint on a fixed cohort of 6 442 users. Scores are percentages aggregated within each positional interval. Memory size remains fixed at 16 slots, and no retraining is performed.
Figure 2: Recall@200 of RecMem-Stream through 10 000 interactions on a fixed cohort of 6 442 users, using the same trained checkpoint and 16 memory slots without retraining. The light curve shows per-position values; the dark curve is a centered 50-position moving average, using only available positions at the boundaries.
Seed
Variant
R@10
R@50
N@10
R@200
42
Main
42.273
59.952
26.659
71.962
42
Stream
42.362
60.119
26.743
72.196
123
Main
42.457
60.156
26.791
72.152
123
Stream
43.270
60.848
27.440
72.729
Appendix
Table 9: Individual Main/Stream runs under the standard protocol. Scores are percentages.
Diagnostic
Scope
Value
Sampled directional gain
Original probe: Main / Stream
0.630 / 0.638
Composition-gap median
K=5 , variants and seeds
0.079–0.103
Composition-gap p95
K=5 , variants and seeds
0.111–0.147
Composition-gap median
K∈{5,9,14} , variants and seeds
0.079–0.105
Spearman correlation
Evaluated checkpoints and horizons
0.02–0.45
Appendix
Table 10: Empirical update diagnostics. Composition gaps are normalized by Md . Ranges span evaluated variant/seed cells or checkpoint/horizon cells as indicated; they are not confidence intervals or uniform bounds.
Model
Latency (ms)
Users/s
Peak GPU (GB)
State/user (KiB)
RecMem
7.653
8363
1.585
8
PHSTU
9.245
6923
1.586
432
HSTU-1200
106.613
600
6.285
None
Appendix
Table 11: Warm full prediction at batch size 64 and available history length 2 000. Throughput is batch size divided by median latency. Peak GPU memory is allocated memory in decimal GB; retained user state is in KiB ( 210 bytes). HSTU-1200 uses its latest 1 200 interactions and has no retained recurrent user state.
Model
History H
Cold (ms)
Update (ms)
Warm (ms)
State (KiB)
RecMem
1200
23.1
4.57
3.82
8
RecMem
2000
41.4
4.61
3.81
8
PHSTU
1200
19.8
4.11
3.99
240
PHSTU
2000
35.8
4.09
4.03
432
Appendix
Table 12: Separate model-computation phases at batch size 1. Cold denotes history-state construction; update processes one 200-item segment; warm includes decoder, full-catalog scoring, and top-200. History H is the post-update horizon; updates advance from H−200 to H . Latencies are in ms, and retained state sizes are in KiB per user after the update.
Write Mechanism
R@10
R@50
Slot Cos
Collapse?
Gated-residual (ours)
40.92
59.10
0.891
No
Attention-write
40.33
58.23
≈ 1
Yes
Attention-write ( τ=0.5 )
40.27
58.10
≈ 1
Yes
Erase-write [ Graves et al., 2014 ]
40.38
58.45
≈ 1
Yes
Appendix
Table 13: Comparison of memory write mechanisms. Slot cosine similarity (Slot Cos) measures pairwise similarity among memory slots; values near 1 indicate effective collapse.
Table 14: (a) Effect of memory slot count M . (b) Effect of curriculum training.
Generative recommendation (GR) represents items as semantic identifiers (SIDs) and autoregressively generates the next item's SID from interaction history. However, most methods assign the same SID length to all items despite highly unequal interaction frequencies. This uniform design repeatedly incurs the cost of fine-grained codes for popular items, while shortening codes to reduce this cost also compresses the semantic representations of long-tail items. Inspired by the compact forms of frequent expressions in natural language, we propose JevRec to encode items as variable-length words and generate the next item from interaction context. Linguistic encoding retains frequency-dependent semantic prefixes from shared codebooks, producing shorter SIDs for popular items and richer descriptions for long-tail items. Yet predicting a sequence-level length and generating token-level content impose different optimization requirements that may conflict under a shared output head. Our Jev-like decision modeling component therefore predicts a length distribution with a dedicated head and generates content conditioned on length through a separate head while sharing the interaction-history representation. Experiments on three public datasets show that JevRec outperforms all compared baselines across the evaluated recommendation metrics. Further analyses show lower training and inference time than TIGER and reduced gradient conflict between length and content prediction.
Long interaction histories are central to modern recommender systems, yet training with long sequences is often dismissed as impractical under realistic memory and latency budgets. This work demonstrates that it is not only practical but also effective-at academic scale. We release a complete, end-to-end framework that implements industrial-style long-sequence training with sliding windows, including all data processing, training, and evaluation scripts. Beyond reproducing prior gains, we contribute two capabilities missing from earlier reports: (i) a runtime-aware ablation study that quantifies the accuracy-compute frontier across windowing regimes and strides, and (ii) a novel k-shift embedding layer that enables million-scale vocabularies on commodity GPUs with negligible accuracy loss. Our implementation trains reliably on modest university clusters while delivering competitive retrieval quality (e.g., up to +6.04% MRR and +6.34% Recall@10 on Retailrocket) with ∼4× training-time overheads. By packaging a robust pipeline, reporting training time costs, and introducing an embedding mechanism tailored for low-resource settings, we transform long-sequence training from a closed, industrial technique into a practical, open, and extensible methodology for the community.
Sayak Chakrabarty, Souradip Pal
Department of Computer Science, Northwestern University, Evanston, IL 60208, USA · School of Electrical and Computer Engineering, Purdue University, West Lafayette, IN 47906, USA
Long-history recommenders often compress each user's history into a compact, candidate-independent memory that is cached and reused to score large candidate pools. We show that real user histories exhibit multi-scale semantic structure, with short-lived intent, medium-term interests, and long-term preferences coexisting in one sequence, and that monolithic cached memories preserve these scales unevenly: linear probes recover recent and mid-range content far worse than long-range content. We call this failure mode temporal aliasing. We propose MARS, a multi-resolution user memory that writes the full history into recurrent state tracks anchored to different half-lives, and a sparse routing reader that materializes compact seed memories by selecting the relevant temporal resolutions for each seed, preserving fixed-size candidate scoring. MARS outperforms strong baselines on three public datasets, with gains that grow with history length. Component-matched ablations with paired tests show that temporal diversity and selective routing each contribute beyond what hard-window memories or added capacity provide. The advantage of MARS over its interface-matched baseline also widens after within-user behavioral shifts, at about 1.02× that baseline's warm-cache serving latency for 1,000 candidates per user.