Large-scale recommenders increasingly adopt the sequential generative recipe behind large language models, bringing the Transformer into recommendation along with design choices made for text, including Rotary Position Embedding (RoPE). In language models, RoPE encodes token indices for relative position reasoning, but in recommendation, an interaction index records only event order, saying nothing about elapsed time, behavioral cycles across scales, or calendar phase. We revisit this choice and propose T-RoPE, a time-aware RoPE for sequential generative recommendation that replaces index-only rotation with timestamp-based angles, learnable temporal coefficients, multiscale frequency banks, shifted query alignment, and non-stationary key rotation. We prove that standard RoPE, even on timestamps, remains time-translation invariant and cannot distinguish seasonal contexts, and that T-RoPE breaks this invariance while preserving the RoPE interface. Across five public benchmarks, T-RoPE achieves the best result on every metric on every dataset, improving over the strongest baseline by 78--130% in HR@10 on the sparse PixelRec data and 8--12% across metrics on Amazon Books. On an industrial-scale e-commerce dataset with more than 6B interactions, it improves every metric over the HSTU + Time RAB backbone by 13--82%, with ablations attributing the largest gains to multiscale frequencies (+56% NDCG@50) and non-stationary keys (+4%). An online A/B test in the Shop app yields positive lifts in conversion rate (+0.33%) and order count (+0.63%). We also provide forward and backward algorithms whose added cost is linear in sequence length and head dimension, keeping time-aware RoPE practical for large generative recommenders.
Figures & tables
Method
Timestamp
Learnable
Multiscale
Shifted
Non-stationary
Standard RoPE ( Su et al., 2024 )
×
×
×
×
×
TiSASRec ( Li et al., 2020 )
Partial
×
×
×
×
TO-RoPE ( Wei et al., 2025 )
✓
Partial
✓
×
×
T-RoPE (ours)
✓
✓
✓
✓
✓
Table 1: Temporal mechanisms explicitly provided by positional encoding methods.
Figure 1: Geometric intuition for T-RoPE rotations. a) Index RoPE places events at uniform sequence positions, hiding elapsed time. b) Timestamp RoPE uses event time, so bursty events cluster and dormant gaps spread on the rotation circle. c) Shifted queries place each query at the next-event timestamp (markers displaced from keys), matching training to the inference-time geometry.
Figure 2: Layer-wise visualization of T-RoPE. a) Per-layer RMS magnitude of learned query coefficients, with the selected layers highlighted. b) Temporal RoPE attention components for selected layers on a synthetic event sequence. Larger RMS values correspond to stronger temporal modulation.
Figure 3: Multigranular temporal encoding. a) Learned query and key temporal coefficients over frequency dimensions; shaded regions group dimensions by time period, from subhour to multiyear scales. Training upweights selected temporal bands rather than all frequencies uniformly. b) Representative resonance curves for those bands, where short-period dimensions oscillate rapidly while 30-day, 90-day, and yearly dimensions align with recurring user cycles.
Figure 4: Shifted query alignment. a) During training, each query at position m uses the next-event timestamp tm+1 , while the key keeps its historical timestamps tm ; the last slot is used only as a label. b) During inference, the final query slot is assigned the current session time tnow . Injecting different current times changes the temporal phase of the query while leaving the item history unchanged.
Method
Dataset
Metric
SASRec
TiSASRec
HSTU
HSTU+ Time RAB
HSTU+ TO-RoPE
HSTU+ T-RoPE (ours)
ML-20M
HR@10
31.36
31.97
30.87
32.05
31.19
32.37 +1.0%
HR@50
56.87
57.50
56.19
58.01
56.69
58.55 +0.9%
NDCG@10
18.04
18.38
17.84
18.47
17.93
18.62 +0.8%
NDCG@50
23.68
24.04
23.44
24.20
23.57
24.42 +0.9%
MRR
15.42
15.68
15.31
15.79
15.32
15.91 +0.8%
Table 2: Sequential recommendation results (%). Best per row in bold , second best underlined . The green value beside our result is its relative improvement (%) over the second-best method in that row.
Configuration
Recall@50
NDCG@50
Recall@200
NDCG@200
MRR
T-RoPE
31.41
22.94
41.77
24.82
23.14
- Non-Stationary (§ 3.5 )
30.97 ( − 1.40%)
22.02 ( − 4.01%)
40.49 ( − 3.06%)
23.29 ( − 6.16%)
21.88 ( − 5.45%)
- shifted (§ 3.4 )
30.90 ( − 1.62%)
20.59 ( − 10.24%)
40.92 ( − 2.03%)
22.55 ( − 9.15%)
20.90 ( − 9.68%)
- multiscale freq. bank (§ 3.3 )
25.36 ( − 19.26%)
13.23 ( − 42.33%)
36.98 ( − 11.47%)
15.42 ( − 37.87%)
11.96 ( − 48.31%)
- abs. time embedding (§ 3.1 + § 3.2 )
25.68 ( − 18.24%)
13.81 ( − 39.80%)
37.00 ( − 11.42%)
15.96 ( − 35.70%)
12.70 ( − 45.12%)
- Shifted Query RoPE
30.87 ( − 1.72%)
21.54 ( − 6.10%)
40.50 ( − 3.04%)
23.42 ( − 5.64%)
22.46 ( − 2.94%)
Table 3: Ablation study on the internal Shop e-commerce dataset. The shaded top row is the full T-RoPE model. Rows 2–5 remove components cumulatively down to the HSTU + Time RAB backbone, and rows 6–8 remove single components from the full model. Metric values are percentages, with the best value in each column shown in bold . Parenthetical values show each row’s relative change from the full model. Green indicates an improvement over T-RoPE, while red indicates a shortfall.
Metric
Definition
Relative lift
P-Value
CVR
Conversion rate
+0.33%
0.037
Shop orders
Count of orders placed on the Shop app
+0.63%
0.094
Table 4: Online A/B test results in the Shop app. Values are relative lifts against the control group.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Dataset example
Model
Training it/s
Validation it/s
Pixel1M
Baseline HSTU
17.58±0.01
58.59±0.87
Pixel1M
HSTU + TO-RoPE
16.84±0.05
57.33±0.74
Pixel1M
HSTU + T-RoPE
16.95±0.01
57.06±0.44
Shop
Baseline HSTU
37.19±0.20
92.66±0.69
Shop
HSTU + TO-RoPE
32.17±0.35
82.62±0.92
Shop
HSTU + T-RoPE
32.91±0.05
86.05±0.71
Appendix
Table 5: Static throughput snapshots for baseline HSTU, TO-RoPE, and T-RoPE. Values are mean ± sample standard deviation in iterations per second.
Dataset
#User
#Item
#Interaction
ML-20M ( Harper and Konstan, 2015 )
138,493
26,744
20,000,263
Amazon Books ( Hou et al., 2026 )
776,370
495,063
9,488,297
Pixel200K ( Cheng et al., 2024 )
200,000
96,282
3,965,656
Pixel1M ( Cheng et al., 2024 )
1,001,822
100,541
19,886,579
Pixel8M ( Cheng et al., 2024 )
8,886,078
407,082
158,488,682
Appendix
Table 6: Statistics of the five public benchmarks.
Method
d
H
A
RAB
Bkts
RoPE
SASRec
512
4
—
—
—
—
TiSASRec
512
4
—
—
—
—
HSTU
512
4
128
Pos
—
—
HSTU+Time RAB
512
4
128
T+P
128
—
HSTU+TO-RoPE
512
4
128
T+P
128
TO-RoPE
HSTU+T-RoPE
512
4
128
T+P
128
T-RoPE
Appendix
Table 7: Hyperparameter settings (defaults for all five datasets; see footnote for the sequence-length exception).
Figure 5: Attention geometry across T-RoPE design stages on a synthetic multiscale sequence. The sequence contains four event blocks whose internal spacing corresponds to day-, week-, month-, and year-scale behavior; red lines mark block boundaries. a) Index RoPE. b) Timestamp RoPE. c) Timestamp RoPE with shifted queries. d) Full T-RoPE with non-stationary keys and learned temporal coefficients. The full method separates the blocks by time geometry rather than only by sequence position.
Rotary positional embeddings (RoPE) encode token positions by rotating attention features, supporting relative-position reasoning in language and multimodal models.
Rajax Network Technology (Taobao Shangou of Alibaba) Beijing, China · Department of Biostatistics Yale School of Public Health New Haven, United States