Source-linked AI summary

DP-Rec: Towards Dynamic Patching for Efficient Long-Sequence Recommendation

Dwipam Katariya, Thomas Caputo, Akshat Shreemali, Juan Manuel Origgi, Nikita Seleznev, Pranab Mohanty, Kalanand Mishra, Nam Nguyen, James Montgomery

arXiv:2609.32215v1cs.LGcs.AIcs.IR

TL;DR

Long-sequence recommendation must retain useful history while avoiding the cost of processing every item at a fixed rate. DP-Rec uses contrastive-surprise boundaries to form temporally contextualized latent patches, and reports superior efficiency–accuracy trade-offs over uncompressed and fixed-rate baselines across three benchmarks. Its practical throughput and evaluation at ultra-long horizons remain constrained.

  • Problem

    Transformer recommendation faces high costs on long histories, while common compression methods use fixed heuristics or partitions that do not adapt to behavioral information density.

    Source: §1 · p. 1
  • Method

    DP-Rec uses contrastive entropy surprise to find behavioral boundaries, compresses temporally contextualized segments into latent vectors, and models them for next-item prediction.

    Source: §1 · p. 2, §2.2 · p. 3
  • Results

    Across KuaiRand, ML-1M, and ML-10M-L, DP-Rec achieves Pareto-superior trade-offs over baselines, with higher efficiency at matched accuracy or higher accuracy within a fixed computational budget.

    Source: §1 · p. 2
  • Takeaways & Limitations

    Across three public benchmarks, computation can follow behavioral information density while DP-Rec retains a superior efficiency–accuracy trade-off over uncompressed and fixed-rate compression baselines.

    Source: §6 · p. 9

    Patch aggregation kernels lag optimized fixed-length serving systems in practical throughput, and hardware constraints precluded evaluation at horizons N > 500.

    Source: §5 · p. 9

Abstract

from arXiv · show

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.

1 Introduction

Long histories carry preference signals but make Transformer recommendation costly, while fixed-rate compression does not adapt to behavioral information density. DP-Rec introduces dynamic latent patching for recommendation and reports Pareto-superior efficiency–accuracy trade-offs across three benchmarks.

1 Introduction

  • Long histories preserve seasonality and recurring-interest signals, but Transformer self-attention has O(N^2d) computational and memory complexity, motivating lossy compression or truncation.Fixed heuristics and static partitions do not account for varying information density in user behavior.Source: §1 · p. 1
  • DP-Rec partitions interaction streams at contrastive-entropy peaks rather than fixed positions, using variable-length patches to focus computation on behavioral boundaries.Figure 1 contrasts adaptive red-circle boundaries with static green-square patches.Source: Figure 1 · p. 2, §1 · p. 2
  • BLT uses entropy-based dynamic patching, but its full-vocabulary softmax is costly at recommender-scale item vocabularies, and dynamic patching had not been investigated in RecSys.DP-Rec adapts dynamic latent patching to sequential recommendation.Source: §1 · p. 2
  • Across KuaiRand, ML-1M, and ML-10M-L, DP-Rec achieves Pareto-superior trade-offs: higher inference efficiency at matched accuracy or higher accuracy within a fixed computational budget.The paper identifies this as the first demonstration of dynamic latent patching’s viability for sequential recommendation.Source: §1 · p. 2

2 DP-Rec

DP-Rec turns item histories into temporally contextualized patches, models dependencies between their latent representations, and decodes those representations for next-item prediction. Its design uses temporal signals both to locate boundaries and to represent event and patch timing.

2 DP-Rec

  • DP-Rec maps raw item-and-timestamp sequences through boundary detection, temporal local encoding, a temporal latent Transformer, and local decoding to produce next-item scores.The encoder compresses variable-length patches into latent vectors; the latent Transformer models inter-patch dependencies.Source: §2 · p. 3

2.1 Temporal Rotary Positional Embeddings (Time-RoPE)

  • Time-RoPE makes attention scores depend on time lag, giving the detector and local and latent Transformers a continuous, lag-aware representation of behavioral timing.It adapts Rotary Positional Embeddings to absolute timestamps.Source: §2.1 · p. 3

2.2 Behavioral Boundary Detection

  • A lightweight detector uses contrastive next-item surprise as a tractable alternative to full-vocabulary entropy, then thresholds scores to select behavioral patch boundaries.The detector is pretrained and frozen; minibatch calibration can reallocate patch capacity across sequences, while validation and test use per-sequence thresholds.Source: §2.2 · pp. 3–4

2.3 Temporal Local Encoder

  • The temporal local encoder uses sliding-window attention and Time-RoPE to contextualize event states, then compresses each behavioral patch into a latent representation.Patch-restricted cross-attention refines the latent query using event states as keys and values.Source: §2.3 · p. 4

2.4 Temporal Latent Transformer

  • The causal temporal latent Transformer models dependencies across patches, anchoring each patch at its final event time; its cost scales with patch count M rather than raw sequence length N.Time-RoPE is applied in patch-level self-attention using the patch-level temporal anchors.Source: §2.4 · p. 4

2.5 Local Decoder

  • The local decoder uses event states as queries and patch representations as keys and values, injecting global context into event states before prediction.Next-item scoring matches event states against target and sampled-negative item embeddings using independent sigmoid scoring; the loss sums over non-padding positions.Source: §2.5 · p. 5

3 Experiments

Across three recommendation datasets, DP-Rec leads at matched inference budgets and traces a favorable efficiency–quality frontier. Ablations show that patching, local capacity, temporal encoding, and patch-budget choices shape its trade-offs.

3.1 Datasets; 3.3 Evaluation Metrics; 3.5 Implementation Details; 3.6 Results

  • The experiments use ML-1M, ML-10M-L, and KuaiRand with leave-one-out evaluation; headline comparisons match each dataset’s SASRec FLOPs budget, and Figure 4 sweeps model configurations.ML-10M-L retains users with at least 500 interactions; evaluation ranks one held-out target against 1,000 sampled negatives.Source: §3.1 · p. 5, §3.3 · p. 5, §3.6 · p. 6

3.6 Results

  • DP-Rec tops every dataset and metric at matched FLOPs, processing 4–5× longer histories and improving NDCG@10 by +21.1% on ML-10M-L and +11.0% on KuaiRand over the strongest baseline.Its advantage over LONGER is +24.8% NDCG@10 on ML-1M.Source: §3.6 · p. 6, Table 3 · p. 7

3.7 Model Efficiency

  • On the efficiency frontier, DP-Rec offers higher NDCG@10 at matched FLOPs or equivalent quality with lower cost; on ML-1M, NDCG@10 of 0.22 requires ≈7× fewer FLOPs than SASRec or HSTU.Figure 4 plots NDCG@10 against total inference FLOPs on a log10 scale.Source: §3.7 · p. 6, Figure 4 · p. 7

3.8.1 Local Module Capacity.

  • Local hidden size 16 degrades NDCG across datasets, while size 64 improves it at roughly 3.5× compute; size 32 with one local layer gives the best quality-efficiency trade-off.The size-64 gains are +6.75% on ML-1M, +2.78% on ML-10M-L, and +0.85% on KuaiRand.Source: §3.8.1 · pp. 7–8, Table 4 · p. 8

3.8.2 Architectural Ablations.

  • Time-RoPE removal reduces NDCG by −9.83% on ML-1M, −5.75% on ML-10M-L, and −1.99% on KuaiRand; sliding window 32 offers the best efficiency trade-off.A window of 8 causes substantial losses, while 64 gives gains at higher computational cost.Source: §3.8.2 · p. 8, Table 5 · p. 8
  • At extreme compression, max-pooling beats cross-attention on ML-1M (+8.31%) and KuaiRand (+1.74%), while cross-attention remains beneficial on ML-10M-L (−1.22% without it).Varying the number of latent queries has small, inconsistent effects at a target patch budget of 2.Source: §3.8.2 · p. 8

3.8.3 Impact of Patching Scheme.

  • Contrastive Entropy boundaries outperform random and fixed segmentation at the tested patch budgets; CE adds +4.2%, +2.4%, and +2.7% NDCG over Fixed on ML-1M, ML-10M-L, and KuaiRand.Fixed segmentation also beats Random by +1.5%, +1.8%, and +1.0%, respectively; these settings are not constrained to the headline FLOPs budget.Source: §3.8.3 · p. 8, Table 6 · p. 8

3.9 Sensitivity to Target Patch Budget

  • At patch budget 2, DP-Rec retains about 94% of peak NDCG@10 on ML-1M, 98% on ML-10M-L, and 96% on KuaiRand; the best budget varies by dataset.ML-1M and KuaiRand peak at 50 patches, while ML-10M-L continues improving through 250; cross-attention is disabled in this ablation.Source: §3.9 · p. 9, Table 7 · p. 9

4 Qualitative Analysis

DP-Rec adaptively segments user histories into variable-length behavioral patches, with contrastive entropy surprise tracking changes in behavioral complexity.

4 Qualitative Analysis

  • DP-Rec partitions user histories into variable-length behavioral patches rather than fixed temporal intervals.The visualized segmentation adapts patch allocation to behavioral complexity.Source: §4 · p. 9
  • Surprise scores remain suppressed during thematically stable episodes, allowing the local encoder to condense redundant interactions.Consistent genre engagement in ML-1M is one example.Source: §4 · p. 9
  • Sharp surprise spikes occur during out-of-distribution events such as abrupt genre shifts or changes in interaction rhythm.The authors describe contrastive entropy surprise as a robust proxy for latent transitions.Source: §4 · p. 9

5 Limitations and Future Work

The authors identify implementation, training, and evaluation-scope limitations, alongside open questions about boundary detection and richer behavioral signals.

5 Limitations and Future Work

  • Patch aggregation kernels need low-level optimization to match the practical throughput of highly optimized fixed-length serving systems.The authors note a gap between theoretical complexity and practical throughput.Source: §5 · p. 9
  • The boundary detector is pretrained and frozen, while joint learning of patch boundaries with the recommendation objective remains a future direction.The staged training approach is described as effective.Source: §5 · p. 9
  • Hardware constraints prevented study of ultra-long horizons with N > 500, where compression benefits may be more pronounced.Source: §5 · p. 9
  • The authors hypothesize that richer multi-channel behavioral signals could provide more informative boundaries for contextual segmentation.Source: §5 · p. 9
  • Identifying the best boundary-detection design across surprise signals, temporal cues, and training objectives remains open.Source: §5 · p. 9

6 Conclusions

The conclusion presents DP-Rec as a temporally adaptive latent-patching architecture for recommendation. Across three public benchmarks, it reports a superior efficiency–accuracy trade-off over uncompressed and fixed-rate compression baselines.

6 Conclusions

  • Across three public benchmarks, DP-Rec achieves a superior computational efficiency–accuracy trade-off over uncompressed and fixed-rate compression baselines.Source: §6 · p. 9
  • DP-Rec combines temporal signals with contrastive entropy surprise to adaptively determine patch boundaries.The architecture couples item-level processing with explicit temporal modeling.Source: §6 · p. 9
  • The conclusion frames computation as following user-behavior information density rather than fixed boundaries.Source: §6 · p. 9

A Relevant Work

Related work covers long-history recommendation, sequence compression in recommender systems and other domains, and temporal rotary embeddings. These strands address long-range modeling, compression, and behavioral timing.

A.1 Long Sequential Recommendation

  • Long-history recommendation faces quadratic self-attention costs and increasing interest heterogeneity, while richer implicit feedback further lengthens sequences.Prior work also notes that truncation can weaken cross-signal dependencies in multi-feedback settings.Source: §A.1 · p. 11

A.2 Sequence Compression in RecSys

  • RecSys compression methods reduce sequence length, but upstream compression may sacrifice signal fidelity and fixed-rate merging cannot adapt to uneven behavioral information density.DP-Rec is described as processing raw long-range sequences rather than relying on aggressive upfront compression or fixed windows and tokens.Source: §A.2 · pp. 11–12

A.3 Sequence Compressions in Other Domains

  • Other-domain approaches include multi-resolution patching, frequency-domain patch granularity, patch-level normalization, time-aware aggregation, and adaptive reassembly or motifs.EntroPE explored applying BLT to time series.Source: §A.3 · p. 12

B Temporal Rotary Positional Embeddings (Time-RoPE)

  • Time-RoPE adapts rotary positional embeddings to absolute timestamps so attention scores depend on time lag and encode behavioral timing.The passage describes a continuous, density-aware sense of timing for the local and latent Transformers.Source: B Temporal Rotary Positional… · p. 12

C Lemma - Patch-count calibration under distinct scores

Under a distinct-score assumption, the thresholding rule calibrates the average patch count to the target, up to rounding and the stated sequence-length condition.

C Lemma - Patch-count calibration under distinct scores

  • Choosing the k-th largest valid surprise score as the threshold yields exactly k detected boundaries when scores are distinct.The boundary budget is k = round((M_eff − 1)B).Source: C Lemma - Patch-count calibration… · p. 12
  • The average patch count equals M_eff and matches the target M-hat when the average sequence length is sufficient.The calibration result is combinatorial and does not establish the semantic quality of the detected boundaries.Source: C Lemma - Patch-count calibration… · p. 12

D Robustness to Item Popularity Tiers

DP-Rec performs strongly across item-popularity tiers, with the reported comparison varying between sparse and high-frequency items.

D Robustness to Item Popularity Tiers

  • DP-Rec establishes the NDCG@10 performance ceiling across the item-popularity spectrum.Figure 6 reports recommendation quality by item popularity across three benchmark datasets.Source: D Robustness to Item Popularity Tiers · p. 12, Figure 6 · p. 13
  • For items with fewer than 25 interactions, DP-Rec is more resilient than standard baselines, including SASRec and HSTU.The passage attributes this pattern to adaptive boundary detection extracting meaningful patterns from sparse interaction data.Source: D Robustness to Item Popularity Tiers · p. 12
  • For items with more than 100 interactions, DP-Rec and LONGER outperform fixed-horizon baselines in ML-10M-Long and KuaiRand.LONGER closely trails DP-Rec in KuaiRand, while DP-Rec has a wider margin over competitors in ML-1M's mid-to-head tiers.Source: D Robustness to Item Popularity Tiers · pp. 12–13

E Performance across Temporal Lag Bins

Temporal performance differs by dataset: DP-Rec leads across the temporal spectrum in ML-10M-Long, while ML-1M and KuaiRand show strong recency bias.

E Performance across Temporal Lag Bins

  • In ML-10M-Long, DP-Rec maintains a nearly flat, dominant performance trajectory and the performance ceiling across temporal bins, including T3.The passage describes significant utility persisting in T3, unlike the other datasets.Source: E Performance across Temporal Lag Bins · p. 13
  • In ML-1M and KuaiRand, predictive utility for all models effectively collapses by T3, while DP-Rec has superior peak performance in T1.At T2, LONGER has a slight edge in ML-1M but collapses to zero in KuaiRand; HSTU is more robust in the middle range.Source: E Performance across Temporal Lag Bins · p. 13
  • DP-Rec demonstrates gains across all item-popularity cohorts by preserving informative intent transitions rather than uniformly truncating sequences.The analysis is motivated by the possibility that older interactions retain useful preference signal in sparse, long-tail settings.Source: E Performance across Temporal Lag Bins · p. 13

F Experimental Configuration

Table 8 summarizes experimental configurations and hyperparameter search spaces across the evaluated models.

F Experimental Configuration

  • Table 8 provides the experimental configurations and hyperparameter search spaces for all models.The passage describes the table's scope but does not report specific configurations.Source: F Experimental Configuration · p. 13

G Detailed FLOPs Accounting

The section accounts for inference FLOPs per forward pass across Transformer and patch-based architectures, specifying how attention context, model structure, and implementation choices affect the budget.

G Detailed FLOPs Accounting

  • The per-layer FLOPs account for FFN, Q/K/V/O projections, and attention scoring plus value aggregation; full causal attention uses m = n, while sliding-window attention uses m = w.The analysis sets d_ff = 4 throughout.Source: G Detailed FLOPs Accounting · p. 13
  • HSTU uses the same causal backbone as the Transformer accounting with a 1.1× gating overhead.Source: G Detailed FLOPs Accounting · p. 13
  • LONGER uses full causal attention within k-token groups and across G groups, with an additional token-to-group cross-attention cost of 2nGh_g.G is the ceiling of n/k.Source: G Detailed FLOPs Accounting · p. 13
  • Table 8 describes experimental configurations and search spaces, while Table 9 specifies FLOPs configurations at n = 200 for SASRec/HSTU, LONGER, and DP-Rec.For direct efficiency comparisons, iso-capacity variants use a 1/1/1 block structure with d = 64 to parameter-match SASRec at d = 64 and L = 3.Source: Table 8 · p. 14, Table 9 · p. 14
  • DP-Rec's total cost includes boundary detection, local encoding and decoding, and latent-transformer processing, with the global cost amortized across n_p tokens per patch.The default gather-add bridge has zero cost, and boundary-detector inference cost is counted despite the detector being frozen during training.Source: G Detailed FLOPs Accounting · p. 14
Loading 2609.32215v1…