DP-Rec: Towards Dynamic Patching for Efficient Long-Sequence Recommendation
Organizations: Capital One, AI Foundations McLean, VA, USA
Abstract
Transformers have redefined sequential recommendation by effectively modeling dynamic user behaviors and long-range dependencies. However, they remain inherently inefficient: standard architectures operate at a fixed rate, allocating comparable computation to every item in a user's history regardless of its information content. This leads to prohibitive computational overhead on long sequences and increased sensitivity to behavioral noise. To address this, practitioners often resort to lossy sequence compression, staged modeling, or truncation. This limits the model's ability to leverage the full context of long histories during inference. Inspired by the recent success of Byte Latent Transformer, we propose DP-Rec, a dynamic latent patching architecture for recommendation. DP-Rec shifts from item-level modeling to patch-level modeling by segmenting interaction sequences using contrastive entropy surprise to identify informative behavioral boundaries. A lightweight patch encoder compresses these temporally contextualized segments into a reduced set of dynamic latent behavior vectors, which are then processed by a larger latent transformer and decoded for next-item prediction. Extensive experiments show that, under constrained computational budgets, DP-Rec scales effectively to long sequences and achieves a superior efficiency-accuracy trade-off over both non-compressed and fixed-size compression baselines.
Figures & tables
| Symbol | Meaning |
|---|---|
| Set of users | |
| Set of items | |
| Mini-batch size | |
| Raw sequence length ( ) | |
| Interaction sequence of user , | |
| Item ID at position |
| Dataset | # Actions | Avg. Actions / User | ||
|---|---|---|---|---|
| KuaiRand ( Gao et al., 2022 ) | 27,285 | 13,222,181 | 122,052,626 | 4,473 |
| ML-1M ( Harper and Konstan, 2015 ) | 6,040 | 3,416 | 999,611 | 165 |
| ML-10M-L ( Harper and Konstan, 2015 ) | 3,683 | 10,632 | 3,114,710 | 844 |
| Fixed-Horizon Baselines | Compression-Based Models | ||||||
| Dataset | Metric | GRU4Rec ( Hidasi et al., 2015a ) | SASRec ( Kang and McAuley, 2018 ) | HSTU ( Zhai et al., 2024 ) | LONGER ( Chai et al., 2025 ) | DP-Rec | Rel Impr. |
| ML-1M ( ) | |||||||
| NDCG@10 | +16.0% | ||||||
| NDCG@20 | +14.2% | ||||||
| HR@5 | +17.7% | ||||||
| HR@10 | +15.2% | ||||||
| #Params | ML-1M | ML-10M-L | KuaiRand | |||||
| (non-emb) | NDCG@10 | TFLOPs | NDCG@10 | TFLOPs | NDCG@10 | TFLOPs | ||
| 32 | 1 | 137,920 | 0.2238 | 0.0284 ( ) | 0.2051 | 0.0740 ( ) | 0.4368 | 0.5431 ( ) |
| 16 | 1 | 99,616 | 0.1909 (-14.70%) | 0.0100 ( ) | 0.1927 (-6.05%) | 0.0235 ( ) | 0.4118 (-5.72%) | 0.1729 ( ) |
| 64 | 1 | 224,768 | 0.2389 (+6.75%) | 0.0989 ( ) | 0.2108 (+2.78%) | 0.2663 ( ) | 0.4405 (+0.85%) | 1.9523 ( ) |
| 32 | 2 | 159,168 | 0.2219 (-0.85%) | 0.0543 ( ) | 0.2095 (+2.15%) | 0.1447 ( ) | 0.4383 (+0.34%) | 1.0606 ( ) |
| 32 | 3 | 180,416 | 0.2145 (-4.16%) | 0.0800 ( ) | 0.2010 (-2.00%) | 0.2153 ( ) | 0.4407 (+0.89%) | 1.5782 ( ) |
| Variant | ML-1M | ML-10M-L | KuaiRand |
|---|---|---|---|
| DP-Rec (baseline) | 0.2238 | 0.2051 | 0.4368 |
| w/o Time-RoPE | 0.2018 (-9.83%) | 0.1933 (-5.75%) | 0.4281 (-1.99%) |
| w/o cross-attn | 0.2424 (+8.31%) | 0.2026 (-1.22%) | 0.4444 (+1.74%) |
| 0.2158 (-3.57%) | 0.2016 (-1.71%) | 0.4389 (+0.48%) | |
| 0.2302 (+2.86%) | 0.2012 (-1.90%) | 0.4344 (-0.55%) | |
| 0.1956 (-12.60%) | 0.1916 (-6.58%) | 0.4006 (-8.29%) |
| Dataset | Random | Fixed | CE |
|---|---|---|---|
| ML-1M | 0.2400 | 0.2437 | 0.2540 |
| ML-10M-L | 0.1946 | 0.1982 | 0.2029 |
| KuaiRand | 0.4588 | 0.4634 | 0.4761 |
| Target Patches ( ) | ML-1M | ML-10M-L | KuaiRand |
|---|---|---|---|
| 2 | 0.2346 | 0.2050 | 0.4405 |
| 5 | 0.2446 | 0.2026 | 0.4414 |
| 10 | 0.2414 | 0.2070 | 0.4504 |
| 50 | 0.2499 | 0.1996 | 0.4578 |
| 100 | 0.2486 | 0.1949 | 0.4502 |
| 250 | – | 0.2088 | 0.4417 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Configuration | Fixed-Horizon Models | Compression-Based Models | |||
|---|---|---|---|---|---|
| SASRec ( Huang, 2020 ) | HSTU ( MobileTeleSystems, 2024 ) | GRU4Rec ( MobileTeleSystems, 2024 ) | LONGER | DP-Rec | |
| Blocks ( ) | 3 | 3 | |||
| Hidden size ( ) | 64 | 64 | |||
| Seq. length ( ) | Matched | ||||
| Patch Budget ( ) | – | – | – | ||
| Pool Initialization | True | True | True | True | True |
| Model | FLOPs | vs. SASRec | Complexity |
|---|---|---|---|
| SASRec | |||
| HSTU | |||
| LONGER | |||
| DP-Rec |
Sequential Recommendation
Sequential recommendation predicts what a user will choose next from ordered interactions, adapting to changing interests and context.
See all 136 papers