Paper deep dive
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
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 93%
Last extracted: 9/29/2026, 12:59:14 PM
Summary
The paper introduces DP-Rec, a dynamic latent patching architecture for sequential recommendation that addresses the computational inefficiency of standard Transformers on long user sequences. By using a lightweight boundary detector based on contrastive entropy surprise, DP-Rec dynamically segments interaction histories into variable-length patches, which are then compressed and processed by a temporal latent transformer. This approach achieves superior efficiency-accuracy trade-offs compared to static compression and non-compressed baselines on datasets like ML-1M, ML-10M-L, and KuaiRand.
Entities (10)
Relation Signals (8)
DP-Rec → evaluatedon → ML-1M
confidence 100% · Extensive experiments show that... DP-Rec scales effectively to long sequences... across KuaiRand, ML-1M, and ML-10M-L
DP-Rec → evaluatedon → KuaiRand
confidence 100% · Extensive experiments show that... DP-Rec scales effectively to long sequences... across KuaiRand, ML-1M, and ML-10M-L
DP-Rec → evaluatedon → ML-10M-L
confidence 100% · Extensive experiments show that... DP-Rec scales effectively to long sequences... across KuaiRand, ML-1M, and ML-10M-L
DP-Rec → uses → Contrastive Entropy Surprise
confidence 95% · DP-Rec shifts from item-level modeling to patch-level modeling by segmenting interaction sequences using contrastive entropy surprise
Byte Latent Transformer → inspirationfor → DP-Rec
confidence 90% · Inspired by the recent success of Byte Latent Transformer, we propose DP-Rec
DP-Rec → uses → Time-RoPE
confidence 90% · We adapt Rotary Positional Embeddings (Su et al., 2024) to absolute timestamps Tt... This makes the attention score... a function of their time lag
DP-Rec → outperforms → GRU4Rec
confidence 85% · DP-Rec achieves a superior efficiency-accuracy trade-off over both non-compressed and fixed-size compression baselines.
DP-Rec → →
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
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.
Tags
Links
- Source: https://arxiv.org/abs/2609.32215v1
- Canonical: https://arxiv.org/abs/2609.32215v1
Trouble viewing inline? Open PDF directly →
Full Text
88,229 characters extracted from source content.
Expand or collapse full text
DP-Rec: Towards Dynamic Patching for Efficient Long-Sequence Recommendation Conference: 20th ACM Conference on Recommender Systems; September 27-October 02, 2026; Minneapolis, MN, USA20th ACM Conference on Recommender Systems (RecSys ’26), September 27-October 02, 2026, Minneapolis, MN, USADOI: 10.1145/3773078.3831823ISBN: 979-8-4007-2284-4/2026/09CCS: Computing methodologies Machine learningCCS: Information systems Recommender systemsCCS: Computing methodologies Knowledge representation and reasoningCCS: Information systems Temporal data Dwipam Katariya Note: Core Contributors Affiliation: Capital One, AI Foundations, McLean, VA, USA , Thomas Caputo Affiliation: Capital One, AI Foundations, McLean, VA, USA , Akshat Shreemali Affiliation: Capital One, AI Foundations, New York, NY, USA , Juan Manuel Origgi Affiliation: Capital One, AI Foundations, New York, NY, USA , Nikita Seleznev Affiliation: Capital One, AI Foundations, Boston, MA, USA , Pranab Mohanty Affiliation: Capital One, AI Foundations, Seattle, WA, USA , Kalanand Mishra Affiliation: Capital One, AI Foundations, San Jose, CA, USA , Nam Nguyen Affiliation: Capital One, AI Foundations, New York, NY, USA and James Montgomery Affiliation: Capital One, AI Foundations, McLean, VA, USA © c 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. Keywords: personalization, long user sequence modeling, transformers, recommender systems †c-license: by 1. Introduction Figure 1. Dynamic vs Static Patching. Unlike static patching (green square), DP-Rec adaptively partitions interaction streams at contrastive entropy peaks (e.g., Interstellar, The Conjuring) (red circle). These peaks signify shifts in latent user intent. Optimized threshold τ (red dashed line) results in variable-length patching, focusing computational resources on informative behavioral boundaries rather than redundant items to maximize recommendation efficiency.A line graph of entropy over a user interaction stream. A dashed line marks threshold tau. Red circles mark high-entropy peaks for Dynamic Patching; a green square marks a Fixed-size Patching interval Modern recommendation systems (RecSys) are undergoing a paradigm shift, moving from traditional feature-based architectures toward generative sequential models capable of processing long user behavior histories. These extended contexts are critical for capturing multifaceted user preferences such as long-term seasonality and recurring interests, which are often discarded by shorter lookback windows or static user embeddings (Zhai et al., 2024; Chai et al., 2025; He et al., 2023; YongjiWu et al., 2021; Chitlangia et al., 2023; Zhang et al., 2025b). Further, scaling sequence length in tandem with other parameters is essential to avoid performance plateaus (Guo et al., 2024). Beyond raw performance gains, larger models are inherently more "sample-efficient," as they extract a higher volume of useful information from individual training examples than smaller models (Zhang et al., 2024a; Zivic et al., 2024; Guo et al., 2024). However, the scalability of Transformer-based architectures is fundamentally constrained by the quadratic computational and memory complexity, denoted as O(N2d)O(N^2d), of the self-attention mechanism relative to sequence length N and embedding dimension d (Vaswani et al., 2017; Zhang et al., 2025b). In industrial settings, where inference must be executed for every impression within a user session, this burden is often exacerbated by the inclusion of rich item attributes (e.g., categories, brands, and textual descriptions) (Zhai et al., 2024; Katariya et al., 2024; Xia et al., 2025). To mitigate this, practitioners often resort to lossy sequence compression such as embeddings (Katariya et al., 2025; Pancha et al., 2022) or staged modeling. Representative industrial solutions include TWIN V2 (Si et al., 2024), which employs hierarchical clustering to compress life-cycle behaviors. Recent works such as LONGER (Chai et al., 2025) have introduced token-merging schemes to compress sequence lengths. However, these methods often rely on fixed heuristics or static partitioning schemes that fail to account for the varying information density of user behavior. We argue that such compression is inherently dependent on information density; naively merging tokens based on a global length or fixed rate is sub-optimal for the varied rhythms of human behavior, requiring dynamic compression solutions as shown in Figure 1. Dynamic compression strategies have recently demonstrated significant potential across diverse sequential domains (Pagnoni et al., 2025; Nie et al., 2022; Wu et al., 2026a; Wu et al., 2026b). Specifically, the Byte Latent Transformer (BLT) (Pagnoni et al., 2025) uses a Perceiver-style architecture (Jaegle et al., 2021) for dynamic sequence patching. While BLT establishes the advantage of adaptive, entropy-based patching over static (fixed-vocabulary) tokenization, it derives boundaries from a full next-token softmax that is inexpensive over its 256-symbol byte vocabulary but becomes prohibitive at the million-item vocabularies of production recommender systems. Similarly, PatchTST (Nie et al., 2022) utilizes patching mechanisms to capture local semantic patterns in multivariate time-series data. Despite its success in other fields, dynamic patching has yet to be investigated within the context of RecSys. We argue that a tailored latent architecture is essential to capture the idiosyncratic behavioral dynamics of recommendation data, and introduce DP-Rec, which adapts dynamic latent patching for sequential recommendation. Our contributions are as follows: • To our knowledge, we are the first to establish the viability of dynamic latent patching for sequential recommendation. Across KuaiRand, ML-1M, and ML-10M-L, DP-Rec achieves Pareto-superior trade-offs, delivering either higher inference efficiency under matched accuracy, or higher accuracy within a fixed computational budget. • Dynamic Contrastive Patching: We introduce Contrastive Entropy Surprise, a lightweight surrogate for Shannon entropy that resolves the computational intractability of full-vocabulary softmax in recommendations, while providing the dynamic boundary adaptability missing in static models like LONGER (Chai et al., 2025). This formulation demonstrates a propensity to align boundaries with shifts in interaction patterns rather than uniform positions, effectively grouping thematically coherent interaction "bursts". • Temporal-Aware Behavioral Context: We incorporate inter-event temporal signals as first-class features within the patching mechanism. By leveraging interaction rhythms and temporal gaps alongside item-ID transitions, DP-Rec establishes temporal dynamics as an important determinant of behavioral context to detect informative segment boundaries. Table 1. Notations Symbol Meaning U Set of users V Set of items B Mini-batch size N Raw sequence length (Nmax,NrawN_max,N_raw) us_u Interaction sequence of user u, (v1,…,vN)(v_1,…,v_N) vtv_t Item ID at position t TtT_t Absolute timestamp at position t ve_v Latent embedding vector for item v (∈ℝd ^d) ϕu,t _u,t Contrastive entropy surprise score at step t τ Global boundary threshold Binary boundary indicator matrix (∈0,1B×N∈\0,1\^B× N) μ Sequence padding mask matrix (∈0,1B×N∈\0,1\^B× N) P Set of behavioral patches P1,…,PM\P_1,…,P_M\ M Realized patch count for a sequence M M Target average patch budget PmP_m Behavioral patch m=[lm,rm]m=[l_m,r_m] m(t)m(t) Patch index containing event t npn_p Average patch size tb_t Boundary detector hidden state at position t (∈ℝdbbd ^d_bbd) th_t Event state from temporal local encoder (∈ℝdloc ^d_loc) mz_m Input latent representation for patch m (∈ℝd ^d) mg_m Inter-patch representation from Latent Transformer (∈ℝd ^d) to_t Decoded output event state at position t (∈ℝd ^d) d Latent embedding dimension dbbdd_bbd Boundary detector hidden dimension dffd_f Feed-forward expansion dimension dlocd_loc Local module hidden dimension w Local attention sliding window size wew_e Boundary detector sliding window size LlocL_loc Depth of local modules (Lenc=Ldec=LlocL_enc=L_dec=L_loc) LlatL_lat Layer count for Temporal Latent Transformer fbbdf_bbd Behavioral boundary detector function fencf_enc Temporal local encoder function flatentf_latent Temporal latent transformer function fdecf_dec Local decoder function 2. DP-Rec Figure 2. Overall architecture of DP-Rec. A frozen detector computes contrastive-entropy scores, enabling an adaptive threshold optimizer to partition sequences into M variable-length behavioral patches. These are contextualized by a temporal local encoder and modeled via a temporal latent transformer before a local decoder projects representations back to the item space for next-item prediction.Fully described in the caption and main text. DP-Rec follows the high-level latent patching paradigm of BLT (Pagnoni et al., 2025) and Perceiver (Jaegle et al., 2021), but adapts the architecture for sequential recommendation. Given a raw interaction sequence of item IDs and Unix timestamps, the behavioral boundary detector identifies patch boundaries used by the temporal local encoder to compress low-surprisal, variable-length segments into latent patch representations. The temporal latent transformer processes these patches, which a local decoder then projects back to item-level states for next-item prediction (Figure 2). Formally, DP-Rec maps a raw interaction sequence to next-item scores through four stages: Boundaries: u→fbbd,Alg. 1(,) _u \,f_bbd,\ Alg.~ alg:threshold_optimization\,( ,P) Encode: →fencmm=1M \,f_enc\,\z_m\_m=1^M Latent: m→flatentmm=1M \z_m\ \,f_latent\,\g_m\_m=1^M Decode: m→fdect→y^u,t+1 \g_m\ \,f_dec\,\o_t\→ y_u,t+1 where the boundary detector (fbbdf_bbd) scores contrastive surprise and Algorithm 1 turns it into boundaries and patches P; the temporal local encoder (fencf_enc) compresses each patch into a latent mz_m; the temporal latent Transformer (flatentf_latent) models inter-patch dependencies as mg_m; and the local decoder (fdecf_dec) projects back to event states to_t for scoring. 2.1. Temporal Rotary Positional Embeddings (Time-RoPE) To encode interaction rhythms, we adapt Rotary Positional Embeddings (Su et al., 2024) to absolute timestamps TtT_t. For a latent vector ∈ℝdx ^d, the transformation ℛ(,Tt)R(x,T_t) rotates d/2d/2 dimension pairs in the query-key space: (1) ℛ(,Tt)=⊙cos(Tt)+~⊙sin(Tt),R(x,T_t)=x ( T_t)+ x ( T_t), where ~ x denotes the vector obtained by rotating each (x2i−1,x2i)(x_2i-1,x_2i) pair by 90∘90 , i.e., x~2i−1=−x2i,x~2i=x2i−1 x_2i-1=-x_2i,\ x_2i=x_2i-1, and =θi=10000−2i/di=1d/2 =\ _i=10000^-2i/d\_i=1^d/2 are the inverse frequencies. This makes the attention score between two interactions at times TtT_t and Tt′T_t a function of their time lag (Tt−Tt′)(T_t-T_t ), giving the boundary detector, local and latent Transformers a continuous, lag-aware sense of behavioral timing. 2.2. Behavioral Boundary Detection Algorithm 1 Adaptive Global Threshold Optimization Input: Surprise scores ϕ∈ℝB×Nφ ^B× N, padding mask ∈0,1B×N μ∈\0,1\^B× N, target average patch count M M Output: Boundary indicators ∈0,1B×N ∈\0,1\^B× N, global threshold τ Φ←ϕu,t∣u,t=1 ←\ _u,t μ_u,t=1\; NΦ←|Φ|N_ ←| |; N¯←NΦ/B N← N_ /B; Meff←min(M^,N¯)M_eff← ( M, N); κ←round((Meff−1)⋅B)κ ((M_eff-1)· B); κ←max(0,min(κ,NΦ))κ← (0, (κ,N_ )); if κ=0κ=0 then τ←+∞τ←+∞; u,t←0∀(u,t) _u,t← 0 ∀(u,t); else Sort Φ in descending order to obtain Φ↓ ; τ←Φκ↓τ← _κ; u,t←[ϕu,t≥τ]⋅u,t∀(u,t) _u,t [ _u,t≥τ]· μ_u,t ∀(u,t); return (,τ)( ,τ); To capture behavioral transitions (such as shifts in user intent or interaction rhythm), we employ a lightweight boundary detector that identifies patch boundaries prior to the primary recommendation model. While Byte-Latent Transformers (Pagnoni et al., 2025) derive boundaries from full-vocabulary next-token entropy, this approach is computationally prohibitive in sequential recommendation due to the massive item vocabulary |||V|. Consequently, we utilize a tractable surrogate based on contrastive next-item surprise. The detector encodes the interaction sequence using a lightweight causal Transformer architecture featuring sliding-window attention and Time-RoPE applied to centered timestamps ΔTt=Tt−T1 T_t=T_t-T_1, where T1T_1 is the timestamp of the first event in the sequence. Let t∈ℝdbbdb_t ^d_bbd denote the detector’s hidden state at step t. The detector is a self-contained module, pre-trained then frozen, with its own parameters and item embeddings at a small hidden size dbbdd_bbd (set to 88 in our experiments); within this subsection tb_t and ve_v denote these detector-internal representations, distinct from the recommendation embeddings (∈ℝd ^d) used for scoring in Eq. 4. To estimate surprise, we define a binary contrastive objective utilizing the ground-truth next item vt+1v_t+1 and a sampled negative item vt−v_t^-. The contrastive surprise score ϕu,t _u,t is calculated as: (2) ϕu,t=−pu,t+logpu,t+−pu,t−logpu,t−, _u,t=-p^+_u,t p^+_u,t-p^-_u,t p^-_u,t, where (3) pu,t+=exp(t⊤vt+1)exp(t⊤vt+1)+exp(t⊤vt−),pu,t−=1−pu,t+.p^+_u,t= (b_t e_v_t+1) (b_t e_v_t+1)+ (b_t e_v_t^-), p^-_u,t=1-p^+_u,t. A high ϕu,t _u,t indicates that the model assigns roughly equal probability to the positive and negative item, signaling a behavioral boundary. Boundary selection is formulated as an Adaptive Threshold Optimization (Algorithm 1), where a global threshold τ is derived from the empirical surprise distribution to yield binary boundary indicators . Contextual Calibration Figure 3. Impact of batch size on patch budget adherence (ML-1M, M^=50 M=50) for N≥100N≥ 100. While both configurations maintain the target mean, the Batch Size BS=128BS=128 distribution shows the effect of cross-sequence budget reallocation within mini-batches, contrasted with the high-precision adherence of the BS=1BS=1 caseHistogram of patches per sequence. Blue bars (batch size 1) show low variance; yellow bars (batch size 128) show higher variance. A dashed vertical line marks the target patch count controlled by tau. The optimization context varies by phase: we utilize mini-batch distributions (B>1B>1) during training and independent sequence distributions (B=1B=1) during inference. We establish a combinatorial lemma (see supplementary material for details), which characterizes this behavior; notably, batch-level calibration allows high-entropy sequences to “borrow” capacity from lower-entropy sequences within the same mini-batch. As illustrated in Figure 3, increasing the batch size introduces higher variance in per-sequence patch counts while maintaining the target mean. To ensure deterministic computational control and consistent evaluation, we employ per-sequence thresholding for all validation and test phases. We further note that while ties in surprise scores ϕu,t _u,t may lead to minor deviations from the exact cardinality M M, the procedure serves as a robust practical mechanism for behavioral compression across varying sequence lengths. 2.3. Temporal Local Encoder The local patch encoder transforms event-level sequences into compressed latent representations. We first compute event states =[1,…,N]H=[h_1,…,h_N] via a lightweight causal Transformer fencf_enc utilizing sliding-window attention and Time-RoPE applied to centered timestamps ΔTt=Tt−T1 T_t=T_t-T_1. For each behavioral patch Pm=[lm,rm]P_m=[l_m,r_m], an initial latent patch query m(0)z_m^(0) is constructed via global max pooling over event states: m(0)=Winit(maxt∈Pmt).z_m^(0)=W_init ( _t∈ P_mh_t ). These queries are iteratively refined through LencL_enc patch-restricted cross-attention layers, where latent representations act as queries and event states serve as keys and values: m(ℓ)=m(ℓ−1)+CrossAttn(WQm(ℓ−1),WKt,WVtt∈Pm).z_m^( )=z_m^( -1)+CrossAttn (W_Qz_m^( -1),\W_Kh_t,W_Vh_t\_t∈ P_m ). After LencL_enc layers, the final representation m=m(Lenc)z_m=z_m^(L_enc) serves as the input latent representation for patch PmP_m to the Temporal Latent Transformer. 2.4. Temporal Latent Transformer Given the latent patch representations 1,…,Mz_1,…,z_M, the temporal latent Transformer models dependencies across behavioral patches autoregressively. We use a causal patch-level Transformer, where each patch attends only to previous patches and the current patch. Unlike the local encoder, where time is defined at the event level, the temporal latent Transformer uses a single temporal anchor per patch. For a patch Pm=[lm,rm]P_m=[l_m,r_m], we preserve its patch-end timestamp TrmT_r_m and use the last centered event time in that patch, ΔTrm T_r_m, in Time-RoPE. Thus, each latent patch is temporally anchored by the time of its final event. The temporal latent Transformer computes: 1,…,M=flatent(1,…,M,ΔTr1,…,ΔTrM),g_1,…,g_M=f_latent\! (z_1,…,z_M;\, T_r_1,…, T_r_M ), where m∈ℝdg_m ^d is the inter-patch representation, and Time-RoPE is applied in patch-level self-attention using these patch-level temporal anchors. Because the temporal latent Transformer operates on the compressed patch sequence rather than the full interaction history, its cost scales with the number of patches M rather than the raw sequence length N. 2.5. Local Decoder The local decoder projects patch representations back to event-level states for scoring. It reverses the encoder’s cross-attention roles (Pagnoni et al., 2025), using event states as queries and patch representations mg_m as keys and values. At layer ℓ∈1,…,Ldec ∈\1,…,L_dec\, event states t(ℓ)o_t^( ) are updated via: t(ℓ)=t(ℓ−1)+CrossAttn(WQt(ℓ−1),WKm(t),WVm(t))o_t^( )=o_t^( -1)+CrossAttn (W_Qo_t^( -1),W_Kg_m(t),W_Vg_m(t) ) where m(t)m(t) is the patch index for event t. This injects global context into the event stream before a final causal Transformer yields representations to_t for prediction. Next-item scoring. Hidden states to_t are matched against the target item embedding vt+1e_v_t+1 and a sampled negative vt−e_v_t^- via independent sigmoid scoring. We minimize the loss: (4) ℒ=−∑(u,t):vt+1≠0[logσ(t⊤vt+1)+logσ(−t⊤vt−)],L=- _(u,t):\,v_t+1≠ 0 [ σ\! (o_t e_v_t+1 )+ σ\! (-o_t e_v_t^- ) ], where σ(⋅)σ(·) is the sigmoid function and the sum is over all non-padding positions. 3. Experiments 3.1. Datasets Table 2. Dataset Summary Dataset U V # 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 We evaluate DP-Rec on three datasets: ML-1M (Harper and Konstan, 2015), ML-10M-L (Harper and Konstan, 2015), and KuaiRand (Gao et al., 2022). Due to the scarcity of public long-horizon benchmarks, we curated ML-10M-Long (ML-10M-L), a long-sequence variant retaining only users with ≥500≥ 500 interactions from ML-10M. Following standard protocols (Kang and McAuley, 2018; Yang et al., 2024), we apply 5-core filtering and chronological sorting. For KuaiRand, we retain only clicked interactions following standard implicit feedback practice, yielding 4,473 average actions per user. We adopt a leave-one-out split, reserving the final and penultimate interactions for testing and validation, respectively. Preprocessed statistics are detailed in Table 2. 3.2. Baselines • GRU4Rec (Hidasi et al., 2015a): A standard RNN-based baseline utilizing Gated Recurrent Units for sequential modeling. • SASRec (Kang and McAuley, 2018): A representative and widely adopted self-attention architecture employing a causal (unidirectional) Transformer. • HSTU (Zhai et al., 2024): A point-wise Transducer-based model incorporating relative temporal information. We evaluate it in a unimodal, causal configuration to maintain architectural parity. • LONGER (Chai et al., 2025): A hierarchical baseline that compresses sequences into fixed-size blocks via an InnerTransformer, specifically designed for long-range dependency modeling. 3.3. Evaluation Metrics We report widely used NDCG@K=[10, 20] and HR@K=[5, 10, 20]. Across all datasets, and for both validation and test, we adopt sampled evaluation: for each user we score the held-out target item against 1,0001,000 uniformly sampled negatives and rank it within the resulting 10011001-item candidate set. While the model is trained over all timesteps (Eq. 4), evaluation follows the leave-one-out protocol and scores a single held-out target per user. For each test user u, rank(yu)rank(y_u) denotes the rank of the held-out target yuy_u among these 10011001 candidates under the model’s scores. We compute NDCG@K @K =1||∑u∈[rank(yu)≤K]log2(rank(yu)+1), = 1|U| _u I[rank(y_u)≤ K] _2(rank(y_u)+1), HR@K @K =1||∑u∈[rank(yu)≤K]. = 1|U| _u I[rank(y_u)≤ K]. 3.4. FLOPs Accounting Inference efficiency is measured by FLOPs per forward pass, following (Hoffmann et al., 2022) but excluding non-arithmetic costs (normalization, residuals, and embedding lookup). For a Transformer with sequence length N, context c, hidden dimension d, expansion dffd_f, and LblockL_block layers, the base complexity is defined as: (5) FLOPs(N,c)=NLblock(4d2dff+8d2+2d(c+1)).FLOPs(N,c)=NL_block (4d^2d_f+8d^2+2d(c+1) ). The terms represent the feed-forward network, projections (Q/K/V/OQ/K/V/O), and attention aggregation, respectively. Per-user FLOPs are calculated using actual sequence lengths. We set dff=1d_f=1 across all models. For SASRec, the quadratic causal context c=(N+1)/2c=(N+1)/2 yields: (6) FLOPsSAS=NLblock(4d2dff+8d2+d(N+1)).FLOPs_SAS=NL_block(4d^2d_f+8d^2+d(N+1)). HSTU utilizes the same backbone with a 1.1×1.1× overhead factor to account for gating operations. LONGER with compression ratio r and G=⌈N/r⌉G= N/r groups is modeled as the sum of inner-group encoding, cross-attention, and global self-attention: (7) FLOPsLNG=G⋅FLOPs(r,r)+2NGd+FLOPs(G,G).FLOPs_LNG=G·FLOPs(r,r)+2NGd+FLOPs(G,G). DP-Rec Complexity: With M latent patches, average patch size npn_p, boundary window wew_e, and local window w, we decompose DP-Rec cost into boundary detection (fbbdf_bbd), temporal latent modeling (flatentf_latent), local encoding/decoding (flocf_loc), and bridge cross-attention (fbrgf_brg): (8) FLOPsDP=N(fbbd(we)+flatent(M)np+floc(w)+fbrg).FLOPs_DP=N (f_bbd(w_e)+ f_latent(M)n_p+f_loc(w)+f_brg ). Each component is instantiated via Eq. 10 using its respective architecture. Notably, the boundary detector cost is included in the total inference budget despite being frozen during primary training. 3.5. Implementation Details Training Configuration All models were implemented in PyTorch and trained on an NVIDIA A100 GPU (40GB). Following established benchmarks (Kang and McAuley, 2018; Hidasi et al., 2015a), we trained ML-1M and ML-10M-L for 500 epochs, while KuaiRand was trained for 200 epochs. We use Adam optimizer with a learning rate of 10−310^-3 and a batch size of 128. To control for confounding factors during hyperparameter optimization, we set dropout to 0.00.0 and disable L2L_2 regularization. Best-performing checkpoints are selected based on the highest validation NDCG@10, evaluated every 10 epochs. We do not employ early stopping. Evaluation Protocols We adopt two complementary evaluation regimes: • Headline Comparison: We report a single FLOPs-budgeted operating point per dataset, selected by the best validation NDCG@10 under the corresponding FLOPs budget (see Table 3). • Pareto Frontier: We characterize the efficiency–quality trade-off by sweeping architectures for models whose inference cost can be varied naturally through sequence length or latent compression, namely SASRec (Kang and McAuley, 2018), HSTU (Zhai et al., 2024), LONGER (Chai et al., 2025), and DP-Rec—we perform a wide architecture and compression sweep to characterize the efficiency–quality frontier (see Figure 4). Model Specifications We adopt the training pipeline from (Huang, 2020) and model components from RecTools (MobileTeleSystems, 2024) for GRU4Rec and HSTU. LONGER is a custom implementation due to unavailability of open-source code. For DP-Rec, we implement the architecture as described in Section 2. • Fixed-Horizon Models: SASRec and HSTU employ 3 blocks with hidden dimensions d∈32,64d∈\32,64\. The maximum input length NmaxN_ is selected from 25,50,100,200\25,50,100,200\ for ML-1M and 25,50,100,250,500\25,50,100,250,500\ for KuaiRand and ML-10M-L. HSTU specifically enables relative-time and relative-position encodings to give it temporal information comparable to DP-Rec. GRU4Rec utilizes 1,3\1,3\ stacks with d=64d=64 and Nmax=50N_ =50 for ML-1M and Nmax=100N_ =100 for KuaiRand and ML-10M-L. • Compression-Based Models: For LONGER and DP-Rec, the input horizon NrawN_raw and patch budget M are swept across dataset-specific ranges: 100,200\100,200\ and 2,…,100\2,…,100\ for ML-1M, and 250,500\250,500\ and 2,…,250\2,…,250\ for KuaiRand and ML-10M-L. LONGER utilizes a 1-block inner and 3-block outer Transformer. DP-Rec employs a 1-block local encoder and a 3-block latent Transformer (d∈16,32,64d∈\16,32,64\); to maintain parameter parity with SASRec, FFN expansion layer is omitted. We evaluate both max-pooling and cross-attention (k=8k=8) for patch aggregation. The boundary detector is implemented as a 1-block Transformer with a minimal 8 hidden dimension across all datasets. Both boundary detector and temporal local encoder are implemented with we=w=32w_e=w=32 (see supplementary material for the full configuration details). Unless otherwise stated, all models use ReLU activation, and all reported results correspond to the best validation-selected configuration for each model and dataset. Total FLOPs are computed post-hoc from the realized inference configurations on the test set to ensure a precise efficiency analysis. 3.6. Results Table 3. Test results under a fixed FLOPs budget matched to best-validation SASRec, reported as mean ± 95% CI across 10 seeds. Bold and underline denote the best overall and baseline performers, and Rel Impr. measures relative gain over the top baseline. 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 (Nmax=50,Nraw=200N_max=50,N_raw=200) NDCG@10 0.1961±0.00230.1961± 0.0023 0.2176±0.00310.2176± 0.0031 0.2078±0.00510.2078± 0.0051 0.2022±0.00420.2022± 0.0042 0.2523±0.00170.2523± 0.0017 +16.0% NDCG@20 0.2308±0.00260.2308± 0.0026 0.2525±0.00290.2525± 0.0029 0.2410±0.00490.2410± 0.0049 0.2355±0.00350.2355± 0.0035 0.2883±0.00130.2883± 0.0013 +14.2% HR@5 0.2329±0.00570.2329± 0.0057 0.2628±0.00450.2628± 0.0045 0.2535±0.00680.2535± 0.0068 0.2445±0.00540.2445± 0.0054 0.3092±0.00240.3092± 0.0024 +17.7% HR@10 0.3545±0.00250.3545± 0.0025 0.3846±0.00550.3846± 0.0055 0.3696±0.00800.3696± 0.0080 0.3637±0.00390.3637± 0.0039 0.4430±0.00440.4430± 0.0044 +15.2% HR@20 0.4914±0.00500.4914± 0.0050 0.5227±0.00550.5227± 0.0055 0.5010±0.00860.5010± 0.0086 0.4956±0.00470.4956± 0.0047 0.5855±0.00270.5855± 0.0027 +12.0% ML-10M-L (Nmax=100,Nraw=500N_max=100,N_raw=500) NDCG@10 0.1566±0.00250.1566± 0.0025 0.1474±0.00220.1474± 0.0022 0.1389±0.00510.1389± 0.0051 0.1661±0.00580.1661± 0.0058 0.2011±0.00240.2011± 0.0024 +21.1% NDCG@20 0.1863±0.00200.1863± 0.0020 0.1766±0.00170.1766± 0.0017 0.1673±0.00600.1673± 0.0060 0.1977±0.00560.1977± 0.0056 0.2322±0.00320.2322± 0.0032 +17.5% HR@5 0.1890±0.00360.1890± 0.0036 0.1766±0.00270.1766± 0.0027 0.1676±0.00710.1676± 0.0071 0.1991±0.00800.1991± 0.0080 0.2393±0.00280.2393± 0.0028 +20.2% HR@10 0.2788±0.00430.2788± 0.0043 0.2681±0.00300.2681± 0.0030 0.2534±0.00700.2534± 0.0070 0.2984±0.00890.2984± 0.0089 0.3547±0.00430.3547± 0.0043 +18.9% HR@20 0.3967±0.00490.3967± 0.0049 0.3838±0.00490.3838± 0.0049 0.3658±0.01190.3658± 0.0119 0.4238±0.00900.4238± 0.0090 0.4894±0.00730.4894± 0.0073 +15.5% KuaiRand (Nmax=100,Nraw=500N_max=100,N_raw=500) NDCG@10 0.3842±0.00600.3842± 0.0060 0.3795±0.00720.3795± 0.0072 0.3825±0.01000.3825± 0.0100 0.3858±0.00930.3858± 0.0093 0.4284±0.01310.4284± 0.0131 +11.0% NDCG@20 0.4052±0.00580.4052± 0.0058 0.4012±0.00670.4012± 0.0067 0.4022±0.00960.4022± 0.0096 0.4059±0.00980.4059± 0.0098 0.4492±0.01220.4492± 0.0122 +10.7% HR@5 0.4585±0.00570.4585± 0.0057 0.4565±0.01260.4565± 0.0126 0.4619±0.01430.4619± 0.0143 0.4640±0.00950.4640± 0.0095 0.5145±0.01410.5145± 0.0141 +10.9% HR@10 0.5562±0.00520.5562± 0.0052 0.5515±0.01400.5515± 0.0140 0.5429±0.01560.5429± 0.0156 0.5534±0.00870.5534± 0.0087 0.6125±0.01260.6125± 0.0126 +10.1% HR@20 0.6387±0.00470.6387± 0.0047 0.6370±0.00950.6370± 0.0095 0.6210±0.01380.6210± 0.0138 0.6324±0.01190.6324± 0.0119 0.6941±0.01020.6941± 0.0102 +8.7% Table 3 compares all models at a matched, per-dataset inference budget: we fix the FLOPs budget to the SASRec configuration with the best validation NDCG@10 (a fixed horizon of Nmax=50N_ =50 on ML-1M and 100100 on ML-10M-L and KuaiRand), and report every other model at its strongest validation-selected configuration within that budget. GRU4Rec is the sole exception: because its recurrent cost is largely insensitive to horizon and already sits within the budget, we report its overall best configuration. This design places fixed-horizon truncation and latent compression on equal computational footing, and under these conditions DP-Rec is the top performer on every dataset and metric. Since it can process 44–5×5× longer histories at the same cost, it recovers signal that truncation discards, improving over the strongest baseline by +21.1%+21.1\% on ML-10M-L and +11.0%+11.0\% on KuaiRand in NDCG@10. Its advantage over LONGER, the fixed-block compression baseline, is largest on ML-1M (+24.8%+24.8\% NDCG@10) consistent with the advantage of aligning patch boundaries to behavioral shifts over uniform, static segmentation. Taken together, these results indicate that DP-Rec turns behavioral-driven compression into consistent gains across every dataset and metric we evaluate. 3.7. Model Efficiency (a) ML-1M (b) ML-10M-L (c) KuaiRand Figure 4. Efficiency trends for budgeted inference FLOPs. We plot NDCG@10 against total inference FLOPs (log10 _10 scale). DP-Rec (red line) consistently defines the upper-left frontier, demonstrating its ability to either (i) achieve higher recommendation quality at the same inference cost, or (i) reach equivalent quality levels with a significantly reduced computational footprint compared to baselines.Line plot showing the Pareto curve for each model. The y-axis is Normalized Discounted Cumulative Gain at 10 (NDCG@10), the x-axis is total inference Floating Point Operations on a log base 10 scale. Each model is a different color with a red line for DP-Rec above the others, indicating better accuracy when controlling for compute To analyze the utility–efficiency trade-off, we map test NDCG@10 against total inference FLOPs across all model configurations. We derive the Pareto frontier for each family by sorting configurations by ascending FLOPs (breaking ties with higher utility) and retaining only those whose NDCG@10 exceeds all lower-cost predecessors. This ensures every frontier point is non-dominated, representing the maximum achievable quality for any given computational budget. The plotted Pareto curves connect only these frontier points identifying non-dominated configurations for each model family. Pareto Dominance and Efficiency Gains As illustrated in Figure 4, DP-Rec (red curve) consistently defines or expands the Pareto frontier across all benchmarks, shifting the operational envelope toward the upper-left quadrant. This dominance is characterized by two primary phenomena: • Iso-compute Quality Gains: At equivalent FLOP budgets, DP-Rec yields superior utility. For instance, on KuaiRand (Figure 4c), where at 1011.510^11.5 FLOPs, DP-Rec achieves an NDCG@10 of ≈0.45≈ 0.45, maintaining a clear lead over the nearest baseline, LONGER. • Iso-quality Efficiency Gains: Conversely, DP-Rec satisfies target utility levels at a substantially reduced computational footprint. Due to the log10 _10 scale of the x-axis, small horizontal shifts represent multifold reductions in FLOPs. For example, in ML-1M (Figure 4a), reaching an NDCG@10 of 0.220.22 requires ≈7×≈ 7× fewer FLOPs with DP-Rec (≈109.5≈ 10^9.5) compared to fixed-horizon models like SASRec or HSTU (≈1010.3≈ 10^10.3). Efficiency and Adaptive Data Distribution The Pareto frontiers also reveal a dataset-dependent pattern: LONGER’s uniform, fixed-block compression is far more competitive on KuaiRand than on the MovieLens variants, and DP-Rec’s margin over it shrinks accordingly (from +24.8% on ML-1M to +21.1% on ML-10M-L to +11.0% on KuaiRand). We attribute this to how interaction structure differs across domains: KuaiRand is a dense, high-frequency short-video feed in which recent context is strongly predictive, so uniformly compressed representations still capture most of the relevant signal, whereas the MovieLens variants accumulate over long time spans with sparser, more diverse engagement, spreading informative interactions throughout the history where uniform compression more easily blurs them. DP-Rec’s adaptive boundaries preserve this dispersed signal, which is why its advantage over uniform compression is largest on the more heterogeneous MovieLens histories. 3.8. Ablations Unless otherwise noted, all ablations fix the base architecture at Llat=3L_lat=3, d=64d=64, Lloc=1L_loc=1, dloc=32d_loc=32, w=32w=32, k=8k=8, and M^=2 M=2. 3.8.1. Local Module Capacity Table 4. Ablation on local module capacity. Bold denotes the base configuration (1.00×1.00× compute). Parentheses denote relative change (Δ% \%) for NDCG and compute scale for TFLOPs. dlocd_loc LlocL_loc #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 (1.00×1.00×) 0.2051 0.0740 (1.00×1.00×) 0.4368 0.5431 (1.00×1.00×) 16 1 99,616 0.1909 (-14.70%) 0.0100 (0.35×0.35×) 0.1927 (-6.05%) 0.0235 (0.32×0.32×) 0.4118 (-5.72%) 0.1729 (0.32×0.32×) 64 1 224,768 0.2389 (+6.75%) 0.0989 (3.48×3.48×) 0.2108 (+2.78%) 0.2663 (3.60×3.60×) 0.4405 (+0.85%) 1.9523 (3.59×3.59×) 32 2 159,168 0.2219 (-0.85%) 0.0543 (1.91×1.91×) 0.2095 (+2.15%) 0.1447 (1.96×1.96×) 0.4383 (+0.34%) 1.0606 (1.95×1.95×) 32 3 180,416 0.2145 (-4.16%) 0.0800 (2.82×2.82×) 0.2010 (-2.00%) 0.2153 (2.91×2.91×) 0.4407 (+0.89%) 1.5782 (2.91×2.91×) The local encoder and decoder facilitate long-horizon compression via sliding-window attention. To examine how local capacity affects quality and efficiency, we ablate hidden size (dlocd_loc) and depth (LlocL_loc) while fixing all other parameters to the base configuration above. Reducing dlocd_loc to 16 causes substantial degradation across all datasets (−14.70%-14.70\%, −6.05%-6.05\%, −5.72%-5.72\%), confirming that a minimum local capacity is necessary for effective patch compression. Expanding to dloc=64d_loc=64 yields meaningful gains on ML-1M (+6.75%+6.75\%) and ML-10M-L (+2.78%+2.78\%) and modest gains on KuaiRand (+0.85%+0.85\%), though at roughly 3.5×3.5× the compute cost. Increasing depth reveals a dataset-dependent pattern: Lloc=2L_loc=2 and Lloc=3L_loc=3 cause mild degradation on ML-1M (−0.85%-0.85\%, −4.16%-4.16\%) and ML-10M-L (+2.15%+2.15\%, −2.00%-2.00\%), but provide marginal gains on KuaiRand (+0.34%+0.34\%, +0.89%+0.89\%), suggesting that denser interaction sequences can leverage deeper local context. Together, dloc=32d_loc=32 with Lloc=1L_loc=1 offers the best quality-efficiency trade-off across datasets, though higher capacity configurations may be worth exploring for dense, high-frequency domains. 3.8.2. Architectural Ablations Table 5. Architectural ablations under extreme compression (M^=2 M=2). Parentheses denote relative change (Δ% \%) from the base configuration. 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%) k=2k=2 0.2158 (-3.57%) 0.2016 (-1.71%) 0.4389 (+0.48%) k=32k=32 0.2302 (+2.86%) 0.2012 (-1.90%) 0.4344 (-0.55%) w=8w=8 0.1956 (-12.60%) 0.1916 (-6.58%) 0.4006 (-8.29%) w=16w=16 0.2162 (-3.40%) 0.1988 (-3.07%) 0.4253 (-2.63%) w=64w=64 0.2243 (+0.22%) 0.2065 (+0.68%) 0.4527 (+3.64%) We evaluate the sensitivity of DP-Rec to local design choices under extreme compression (M^=2 M=2), fixing all other parameters to the base configuration above. Time-RoPE removal causes consistent degradation across all datasets (Table 5), with losses of −9.83%-9.83\% and −5.75%-5.75\% on ML-1M and ML-10M-L, and a smaller −1.99%-1.99\% on KuaiRand, confirming that continuous temporal encoding is important for capturing interaction timing, particularly on sparser MovieLens sequences. Cross-attention aggregator (k, the number of latent queries per patch): its effect is consistently dataset-dependent at extreme compression. On ML-1M, removing cross-attention in favour of max-pooling yields +8.31%+8.31\%, and on KuaiRand it similarly yields +1.74%+1.74\%, suggesting that at M^=2 M=2 with only two coarse patches, max-pool aggregation is sufficient or preferable for both short and dense sequences. Only on ML-10M-L does cross-attention remain beneficial (−1.22%-1.22\% without it). Varying k shows small, inconsistent effects across datasets at M^=2 M=2, with marginal gains for k=32k=32 on ML-1M (+2.86%+2.86\%) and near-neutral results elsewhere, confirming k=8k=8 as a reasonable default but suggesting cross-attention capacity matters more at higher patch budgets. Sliding-window size (w) exhibits a clear threshold effect: w=8w=8 causes substantial utility loss across all datasets (up to −12.60%-12.60\% on ML-1M and −8.29%-8.29\% on KuaiRand), as insufficient local context prevents accurate resolution of behavioral shifts. w=64w=64 yields consistent gains across all three datasets (+0.22%+0.22\%, +0.68%+0.68\%, +3.64%+3.64\%) but at higher computational cost; w=32w=32 offers the best efficiency trade-off. 3.8.3. Impact of Patching Scheme Table 6. Patching-scheme ablation (Random, Fixed, Contrastive-Entropy) at M^=50 M=50 for ML-1M and M^=100 M=100 for ML-10M-L and KuaiRand, varying only the boundary selection rule. Single-seed NDCG@10 scores are reported; bold marks the best per dataset. 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 To isolate whether DP-Rec’s gains stem from dynamic boundary placement rather than sequence compression alone, we vary only the boundary selection rule: Random (uniform random), Fixed (equal-sized blocks, matching LONGER’s chunking (Chai et al., 2025)), and Contrastive Entropy (CE) (boundaries at high-surprisal transitions; Section 2.2). We evaluate at M^=50 M=50 for ML-1M and M^=100 M=100 for ML-10M-L and KuaiRand, providing sufficient patch granularity for the three boundary rules to express meaningful behavioral differences. CE consistently outperforms both baselines across all three datasets (Table 6). Fixed improves over Random on all three datasets (+1.5%+1.5\%/+1.8%+1.8\%/+1.0%+1.0\% on ML-1M/ML-10M-L/KuaiRand) by preserving temporal locality. CE adds a further +4.2%+4.2\%/+2.4%+2.4\%/+2.7%+2.7\% over Fixed by aligning boundaries with genuine intent shifts, confirming that high-surprisal boundary detection captures meaningful behavioral transitions across all three domains. Note that these configurations are not constrained to the headline FLOPs budget and are thus not directly comparable to Table 3. 3.9. Sensitivity to Target Patch Budget Table 7. Mean test NDCG@10 vs. target patch budget M M, at fixed Nraw=50N_raw=50 for ML-1M and Nraw=100N_raw=100 for ML-10M-L and KuaiRand. Cross-attention is disabled to isolate patch budget sensitivity from cross-attention capacity effects. Bold marks best per dataset. Target Patches (M M) 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 The target patch budget M M controls the bottleneck between local interaction processing and the temporal latent transformer. Table 7 reports test NDCG@10 at each budget, at fixed Nraw=50N_raw=50 for ML-1M and Nraw=100N_raw=100 for ML-10M-L and KuaiRand. Cross-attention aggregation is disabled for this ablation to isolate patch budget sensitivity from the confounding effect of cross-attention capacity becoming degenerate when k>npk>n_p at high M M (Section 3.8.2). Both ML-1M and KuaiRand peak at M^=50 M=50, while ML-10M-L continues to improve up to M^=250 M=250, consistent with its longer interaction histories requiring finer-grained segmentation. Despite this variation, DP-Rec is highly resilient to aggressive compression: even at M^=2 M=2 it retains ∼94% 94\% of peak NDCG@10 on ML-1M, ∼98% 98\% on ML-10M-L, and ∼96% 96\% on KuaiRand, confirming that the contrastive boundary detector packs the most salient behavioral shifts into very few patches. 4. Qualitative Analysis Figure 5. Qualitative analysis of contrastive entropy surprise (red) and item views (blue) for ML-1M. Entropy remains low during stable genre engagement but spikes sharply at out-of-distribution transitions, demonstrating how DP-Rec adaptively allocates boundaries to salient behavioral shifts.Table of viewed movies with title, genre, entropy, and views columns shown as inline bars. Green brackets group genre-stable rows with low entropy; red brackets mark genre shifts with high entropy. Visualizations of interaction sequences in Figure 5 confirm that DP-Rec functions as an adaptive segmentation module, partitioning user histories into variable-length behavioral patches. We observe that contrastive entropy surprise serves as a robust proxy for these latent transitions: scores remain suppressed during thematically stable episodes, such as consistent genre engagement in ML-1M, allowing the local encoder to condense redundant interactions. Conversely, sharp entropy spikes occur during “out-of-distribution” events, including abrupt genre shifts or changes in interaction rhythm. This dynamic alignment ensures that latent representations are allocated according to behavioral complexity rather than fixed temporal intervals. 5. Limitations and Future Work While DP-Rec demonstrates strong efficiency gains under FLOPs-matched comparisons, several limitations remain. First, a gap exists between theoretical complexity and practical throughput, as the patch aggregation kernels require further low-level optimization to match highly optimized fixed-length serving systems. Second, in our staged training pipeline, the boundary detector is pre-trained and frozen. While this approach to staged training is effective, learning patch boundaries jointly with the recommendation objective is a promising direction. Third, hardware constraints precluded study of ultra-long horizons (N > 500), where compression benefits may be even more pronounced. We hypothesize that richer multi-channel behavioral signals would provide more informative boundaries for contextual segmentation. More broadly, our contrastive-entropy detector is one effective instantiation of the boundary module, and identifying the best boundary-detection design (spanning alternative surprise signals, temporal cues, and training objectives) remains an open direction for future work. 6. Conclusions In this study we introduced DP-Rec, a dynamic latent patching architecture with temporally adaptive boundary detection. DP-Rec couples item-level processing with explicit temporal modeling, combining temporal signals with contrastive entropy surprise to adaptively determine patch boundaries. This allows the model to overcome the quadratic constraints of standard Transformers while preserving high-fidelity representations of extended user histories. Experiments across three widely known public benchmarks confirm a superior computational efficiency–accuracy trade-off over both uncompressed and fixed-rate compression baselines, demonstrating that computation can follow the information density of user behavior rather than the arbitrary constraints of fixed boundaries. We invite future research to build upon this work to explore the potential of adaptive sequence modeling in recommender systems. 11 1 In preparing this paper, the authors utilized Gemini to improve the clarity, grammar, and presentation of the manuscript. No AI tools were used for model design, experimentation, or analysis; all technical contributions remain exclusively those of the authors. Acknowledgements. We sincerely thank Giri Iyengar and Bayan Bruss for their sponsorship, productive discussions, and critical reviews of this work. References Abeywickrama et al. (2025) S. Abeywickrama, E. Eldele, M. Wu, X. Li, and C. Yuen EntroPE: entropy-guided dynamic patch encoder for time series forecasting. arXiv preprint arXiv:2509.26157. Cited by: §A.3. Cao et al. (2025) Y. Cao, Z. Tian, W. Guo, and X. Liu MSPatch: a multi-scale patch mixing framework for multivariate time series forecasting. Expert Systems with Applications 273, p. 126849. Cited by: §A.3. Chai et al. (2025) Z. Chai, Q. Ren, X. Xiao, H. Yang, B. Han, S. Zhang, D. Chen, H. Lu, W. Zhao, L. Yu, et al. Longer: scaling up long sequence modeling in industrial recommenders. In Proceedings of the Nineteenth ACM Conference on Recommender Systems, p. 247–256. Cited by: §A.2, 2nd item, §1, 4th item, 2nd item, §3.8.3, Table 3. Chang et al. (2023) J. Chang, C. Zhang, Z. Fu, X. Zang, L. Guan, J. Lu, Y. Hui, D. Leng, Y. Niu, Y. Song, et al. 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, p. 3785–3794. Cited by: §A.2. Chitlangia et al. (2023) S. Chitlangia, K. R. Kesari, and R. Agarwal Scaling generative pre-training for user ad activity sequences. Cited by: §1. Chitsazan et al. (2021) N. Chitsazan, S. Sharpe, D. Katariya, Q. Cheng, and K. Rajasethupathy Dynamic customer embeddings for financial service applications. arXiv preprint arXiv:2106.11880. Cited by: §A.2. Deng et al. (2025) J. Deng, S. Wang, K. Cai, L. Ren, Q. Hu, W. Ding, Q. Luo, and G. Zhou Onerec: unifying retrieve and rank with generative recommender and iterative preference alignment. arXiv preprint arXiv:2502.18965. Cited by: §A.1. Ding et al. (2026) K. Ding, F. Fan, C. Hou, Z. Wang, L. Wang, Z. Yang, and J. Zhan Timemosaic: temporal heterogeneity guided time series forecasting via adaptive granularity patch and segment-wise decoding. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 40, p. 20790–20798. Cited by: §A.3. Fan et al. (2022) Z. Fan, D. Ou, Y. Gu, B. Fu, X. Li, W. Bao, X. Dai, X. Zeng, T. Zhuang, and Q. Liu Modeling users’ contextualized page-wise feedback for click-through rate prediction in e-commerce search. In Proceedings of the fifteenth ACM international conference on web search and data mining, p. 262–270. Cited by: §A.1. Gao et al. (2022) C. Gao, S. Li, Y. Zhang, J. Chen, B. Li, W. Lei, P. Jiang, and X. He Kuairand: an unbiased sequential recommendation dataset with randomly exposed videos. In Proceedings of the 31st ACM international conference on information & knowledge management, p. 3953–3957. Cited by: §3.1, Table 2. Guan et al. (2025) L. Guan, J. Yang, Z. Zhao, B. Zhang, B. Sun, X. Luo, J. Ni, X. Li, Y. Qi, Z. Fan, et al. Make it long, keep it fast: end-to-end 10k-sequence modeling at billion scale on douyin. arXiv preprint arXiv:2511.06077. Cited by: §A.1. Guo et al. (2024) W. Guo, H. Wang, L. Zhang, J. Y. Chin, Z. Liu, K. Cheng, Q. Pan, Y. Q. Lee, W. Xue, T. Shen, et al. Scaling new frontiers: insights into large recommendation models. arXiv preprint arXiv:2412.00714. Cited by: §1. Hansen et al. (2020) C. Hansen, C. Hansen, L. Maystre, R. Mehrotra, B. Brost, F. Tomasi, and M. Lalmas Contextual and sequential user embeddings for large-scale music recommendation. In Proceedings of the 14th ACM Conference on Recommender Systems, p. 53–62. Cited by: §A.1, §A.2. Harper and Konstan (2015) F. M. Harper and J. A. Konstan The movielens datasets: history and context. Acm transactions on interactive intelligent systems (tiis) 5 (4), p. 1–19. Cited by: §3.1, Table 2, Table 2. He et al. (2017) X. He, L. Liao, H. Zhang, L. Nie, X. Hu, and T. Chua Neural collaborative filtering. In Proceedings of the 26th international conference on world wide web, p. 173–182. Cited by: §A.1. He et al. (2023) Z. He, W. Liu, W. Guo, J. Qin, Y. Zhang, Y. Hu, and R. Tang A survey on user behavior modeling in recommender systems. arXiv preprint arXiv:2302.11087. Cited by: §1. Hidasi et al. (2015a) B. Hidasi, A. Karatzoglou, L. Baltrunas, and D. Tikk Session-based recommendations with recurrent neural networks. arXiv preprint arXiv:1511.06939. Cited by: 1st item, §3.5, Table 3. Hidasi et al. (2015b) B. Hidasi, A. Karatzoglou, L. Baltrunas, and D. Tikk Session-based recommendations with recurrent neural networks. arXiv preprint arXiv:1511.06939. Cited by: §A.1. Hoffmann et al. (2022) J. Hoffmann, S. Borgeaud, A. Mensch, E. Buchatskaya, T. Cai, E. Rutherford, D. Casas, L. A. Hendricks, J. Welbl, A. Clark, et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556 10. Cited by: Appendix G, §3.4. Huang et al. (2024) Q. Huang, L. Shen, R. Zhang, J. Cheng, S. Ding, Z. Zhou, and Y. Wang Hdmixer: hierarchical dependency with extendable patch for multivariate time series forecasting. In Proceedings of the AAAI conference on artificial intelligence, Vol. 38, p. 12608–12616. Cited by: §A.3. Huang (2020) Z. HuangSASRec.pytorch(Website) External Links: Link Cited by: Table 8, §3.5. Jaegle et al. (2021) A. Jaegle, F. Gimeno, A. Brock, O. Vinyals, A. Zisserman, and J. Carreira Perceiver: general perception with iterative attention. In International conference on machine learning, p. 4651–4664. Cited by: §1, §2. Kang and McAuley (2018) W. Kang and J. McAuley Self-attentive sequential recommendation. In 2018 IEEE international conference on data mining (ICDM), p. 197–206. Cited by: §A.1, 2nd item, 2nd item, §3.1, §3.5, Table 3. Katariya et al. (2024) D. Katariya, J. M. Origgi, Y. Wang, and T. Caputo Timesync: temporal intent modelling with synchronized context encodings for financial service applications. arXiv preprint arXiv:2410.12825. Cited by: §1. Katariya et al. (2025) D. Katariya, S. Varma, A. Shreemali, B. Wu, K. Mishra, and P. Mohanty FinTRec: transformer based unified contextual ads targeting and personalization for financial applications. arXiv preprint arXiv:2511.14865. Cited by: §A.1, §A.2, §1. Liu et al. (2025) K. Liu, Z. Duan, C. Chen, Y. Wang, D. Cheng, and Y. Liang AdaPatch: adaptive patch-level modeling for non-stationary time series forecasting. In Proceedings of the 34th ACM International Conference on Information and Knowledge Management, p. 1882–1891. Cited by: §A.3. Liu et al. (2026) X. Liu, X. Qiu, X. Wu, Z. Li, C. Guo, J. Hu, and B. Yang Rethinking irregular time series forecasting: a simple yet effective baseline. In Proceedings of the AAAI Conference on Artificial Intelligence, Vol. 40, p. 23873–23881. Cited by: §A.3. Lu et al. (2025) H. Lu, Z. Chai, Y. Zheng, Z. Chen, D. Xie, P. Xu, X. Zhou, and D. Wu Large memory network for recommendation. In Companion Proceedings of the ACM on Web Conference 2025, p. 1162–1166. Cited by: §A.2. Lv et al. (2022) F. Lv, M. Li, T. Guo, C. Yu, F. Sun, T. Jin, and W. Ng Xdm: improving sequential deep matching with unclicked user behaviors for recommender system. In International Conference on Database Systems for Advanced Applications, p. 364–376. Cited by: §A.1. Lv et al. (2024) X. Lv, J. Cao, S. Guan, X. Zhou, Z. Qi, Y. Zang, M. Li, B. Wang, K. Gai, and G. Zhou Marm: unlocking the future of recommendation systems through memory augmentation and scalable complexity. arXiv preprint arXiv:2411.09425. Cited by: §A.2. MobileTeleSystems (2024) MobileTeleSystems RecTools: library to build recommendation systems. GitHub. Note: https://github.com/MobileTeleSystems/RecTools Cited by: Table 8, Table 8, §3.5. Nie et al. (2022) Y. Nie, N. H. Nguyen, P. Sinthong, and J. Kalagnanam A time series is worth 64 words: long-term forecasting with transformers. arXiv preprint arXiv:2211.14730. Cited by: §1. Ouyang et al. (2019) W. Ouyang, X. Zhang, L. Li, H. Zou, X. Xing, Z. Liu, and Y. Du Deep spatio-temporal neural networks for click-through rate prediction. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, p. 2078–2086. Cited by: §A.1. Pagnoni et al. (2025) A. Pagnoni, R. Pasunuru, P. Rodriguez, J. Nguyen, B. Muller, M. Li, C. Zhou, L. Yu, J. E. Weston, L. Zettlemoyer, et al. Byte latent transformer: patches scale better than tokens. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), p. 9238–9258. Cited by: §1, §2.2, §2.5, §2. Pancha et al. (2022) N. Pancha, A. Zhai, J. Leskovec, and C. Rosenberg Pinnerformer: sequence modeling for user representation at pinterest. In Proceedings of the 28th ACM SIGKDD conference on knowledge discovery and data mining, p. 3702–3712. Cited by: §A.1, §A.2, §1. Pi et al. (2019) Q. Pi, W. Bian, G. Zhou, X. Zhu, 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, p. 2671–2679. Cited by: §A.2. Pi et al. (2020) 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, p. 2685–2692. Cited by: §A.2. Qin et al. (2020) J. Qin, W. Zhang, X. Wu, J. Jin, Y. Fang, and Y. Yu User behavior retrieval for click-through rate prediction. In Proceedings of the 43rd international ACM SIGIR conference on research and development in information retrieval, p. 2347–2356. Cited by: §A.2. Rendle et al. (2012) S. Rendle, C. Freudenthaler, Z. Gantner, and L. Schmidt-Thieme BPR: bayesian personalized ranking from implicit feedback. arXiv preprint arXiv:1205.2618. Cited by: §A.1. Rendle et al. (2010) S. Rendle, C. Freudenthaler, and L. Schmidt-Thieme Factorizing personalized markov chains for next-basket recommendation. In Proceedings of the 19th international conference on World wide web, p. 811–820. Cited by: §A.1. Si et al. (2024) Z. Si, L. Guan, Z. Sun, X. Zang, J. Lu, Y. Hui, X. Cao, Z. Yang, Y. Zheng, D. Leng, et al. Twin v2: scaling ultra-long user behavior sequence modeling for enhanced ctr prediction at kuaishou. In Proceedings of the 33rd ACM International Conference on Information and Knowledge Management, p. 4890–4897. Cited by: §A.2, §1. Su et al. (2024) J. Su, M. Ahmed, Y. Lu, S. Pan, W. Bo, and Y. Liu Roformer: enhanced transformer with rotary position embedding. Neurocomputing 568, p. 127063. Cited by: Appendix B, §2.1. Sun et al. (2019) 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, p. 1441–1450. Cited by: §A.1. Vaswani et al. (2017) A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin Attention is all you need. Advances in neural information processing systems 30. Cited by: §1. Woo et al. (2024) G. Woo, C. Liu, A. Kumar, C. Xiong, S. Savarese, and D. Sahoo Unified training of universal time series forecasting transformers. In Forty-first International Conference on Machine Learning, Cited by: §A.3. Wu et al. (2025) X. Wu, X. Qiu, H. Cheng, Z. Li, J. Hu, C. Guo, and B. Yang Enhancing time series forecasting through selective representation spaces: a patch perspective. arXiv preprint arXiv:2510.14510. Cited by: §A.3. Wu et al. (2026a) X. Wu, X. Qiu, H. Cheng, Z. Li, J. Hu, C. Guo, and B. Yang Enhancing time series forecasting through selective representation spaces: a patch perspective. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, External Links: Link Cited by: §1. Wu et al. (2026b) Y. Wu, S. K. Ankireddy, S. Sharpe, N. Seleznev, D. Yuan, H. Kim, and N. H. Nguyen Dynamic tokenization via reinforcement patching: end-to-end training and zero-shot transfer. arXiv preprint arXiv:2603.26097. Cited by: §1. Xia et al. (2023) X. Xia, P. Eksombatchai, N. Pancha, D. D. Badani, P. Wang, N. Gu, S. V. Joshi, N. Farahpour, Z. Zhang, and A. Zhai Transact: transformer-based realtime user action model for recommendation at pinterest. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, p. 5249–5259. Cited by: §A.1, §A.2. Xia et al. (2025) X. Xia, S. Joshi, K. Rajesh, K. Li, Y. Lu, N. Pancha, D. Badani, J. Xu, and P. Eksombatchai TransAct v2: lifelong user action sequence modeling on pinterest recommendation. In Proceedings of the 34th ACM International Conference on Information and Knowledge Management, p. 6881–6882. Cited by: §A.1, §A.2, §1. Xie et al. (2021) R. Xie, C. Ling, Y. Wang, R. Wang, F. Xia, and L. Lin Deep feedback network for recommendation. In Proceedings of the twenty-ninth international conference on international joint conferences on artificial intelligence, p. 2519–2525. Cited by: §A.1. Xin et al. (2025) H. Xin, Y. Sun, C. Wang, and H. Xiong Llmcdsr: enhancing cross-domain sequential recommendation with large language models. ACM Transactions on Information Systems 43 (5), p. 1–33. Cited by: §A.1. Yang et al. (2024) J. Yang, Y. Li, J. Zhao, H. Wang, M. Ma, J. Ma, Z. Ren, M. Zhang, X. Xin, Z. Chen, et al. Uncovering selective state space model’s capabilities in lifelong sequential recommendation. arXiv preprint arXiv:2403.16371. Cited by: §3.1. YongjiWu et al. (2021) L. Y. YongjiWu, D. Lian, M. Yin, N. Z. Gong, J. Zhou, and H. Yang Rethinking lifelong sequential recommendation with incremental multi-interest attention. arXiv preprint arXiv:2105.14060. Cited by: §1. Zhai et al. (2024) J. Zhai, L. Liao, X. Liu, Y. Wang, R. Li, X. Cao, L. Gao, Z. Gong, F. Gu, M. He, et al. Actions speak louder than words: trillion-parameter sequential transducers for generative recommendations. arXiv preprint arXiv:2402.17152. Cited by: §A.1, §A.2, §1, 3rd item, 2nd item, Table 3. Zhang et al. (2024a) G. Zhang, Y. Hou, H. Lu, Y. Chen, W. X. Zhao, and J. Wen Scaling law of large sequential recommendation models. In Proceedings of the 18th ACM Conference on Recommender Systems, p. 444–453. Cited by: §1. Zhang et al. (2023) H. Zhang, C. Meng, W. Guo, H. Guo, J. Zhu, G. Zhao, R. Tang, and X. Li Time-aligned exposure-enhanced model for click-through rate prediction. arXiv preprint arXiv:2308.09966. Cited by: §A.1. Zhang et al. (2025a) L. Zhang, K. Song, Y. Q. Lee, W. Guo, H. Wang, Y. Li, H. Guo, Y. Liu, D. Lian, and E. Chen Killing two birds with one stone: unifying retrieval and ranking with a single generative recommendation model. In Proceedings of the 48th International ACM SIGIR Conference on Research and Development in Information Retrieval, p. 2224–2234. Cited by: §A.1. Zhang et al. (2025b) Q. Zhang, H. Yu, I. Ji, C. Yuan, Y. Zhang, C. Liu, X. Wang, C. E. Lambert, R. Chen, C. Kovacs, et al. Efficient sequential recommendation for long term user interest via personalization. In 2025 IEEE International Conference on Data Mining (ICDM), p. 913–922. Cited by: §A.2, §1. Zhang et al. (2024b) W. Zhang, D. Li, C. Liang, F. Zhou, Z. Zhang, X. Wang, R. Li, Y. Zhou, Y. Huang, D. Liang, et al. Scaling user modeling: large-scale online user representations for ads personalization in meta. In Companion Proceedings of the ACM Web Conference 2024, p. 47–55. Cited by: §A.2. Zhou et al. (2019) G. Zhou, N. Mou, Y. Fan, Q. Pi, W. Bian, C. Zhou, X. Zhu, and K. Gai Deep interest evolution network for click-through rate prediction. In Proceedings of the AAAI conference on artificial intelligence, Vol. 33, p. 5941–5948. Cited by: §A.1. Zhou et al. (2026) R. Zhou, Q. Jia, B. Chen, P. Xu, Y. Sun, S. Lou, C. Fu, M. Fu, G. Shen, Z. Zhou, et al. A survey of user lifelong behavior modeling: perspectives on efficiency and effectiveness. Cited by: §A.1. Zivic et al. (2024) P. Zivic, H. Vazquez, and J. Sánchez Scaling sequential recommendation models with transformers. In Proceedings of the 47th international ACM SIGIR conference on research and development in information retrieval, p. 1567–1577. Cited by: §1. Appendix A Relevant Work A.1. Long Sequential Recommendation Sequential recommendation has attracted substantial attention in both academia and industry (Katariya et al., 2025; Pancha et al., 2022; Hansen et al., 2020; Deng et al., 2025; Xin et al., 2025; Zhang et al., 2025a; Xia et al., 2025; Guan et al., 2025; Xia et al., 2023; Zhai et al., 2024). Transformer based models, especially SASRec (Kang and McAuley, 2018) and BERT4Rec (Sun et al., 2019), have become foundational in this area by demonstrating the effectiveness of self attention for modeling user behavior sequences. These methods significantly advanced the state of the art over earlier sequential models such as GRU4Rec (Hidasi et al., 2015b), FPMC (Rendle et al., 2010), and CASER, as well as non sequential approaches including BPR-MF (Rendle et al., 2012) and NCF (He et al., 2017). Nevertheless, most existing methods are designed for relatively short or truncated interaction histories. Scaling these architectures to lifelong user logs is restricted not only by the quadratic complexity of self-attention but also by the increasing heterogeneity of user interests. These factors render assumptions of signal homogeneity and limited temporal scope increasingly unrealistic in large-scale settings (Zhou et al., 2026). Early work in this area focused primarily on explicit feedback, such as numerical ratings. Subsequent studies, however, established that Click-Through Rate (CTR) prediction—the estimation of a user’s probability of engagement—benefits from jointly modeling heterogeneous behavioral signals. Specifically, these models incorporate both positive signals, such as successful clicks, and negative signals, such as unclicked impressions where an item was exposed to the user but failed to elicit an interaction. In particular, DSTN (Ouyang et al., 2019), DFN (Xie et al., 2021), DIEN (Zhou et al., 2019), and XDM (Lv et al., 2022) demonstrated the importance of incorporating such multi-feedback information. Because implicit signals such as views and impressions are substantially more abundant than clicks, their inclusion greatly increases sequence length and makes full long-range sequence modeling computationally infeasible. To better exploit richer behavioral information, RACP (Fan et al., 2022) introduced a hierarchical attention architecture that captures both intra-page dependencies among co displayed items and inter-page interest transitions across sessions. Despite these advances, prior studies largely overlook the impact of sequence truncation in multi-feedback settings, where truncation can weaken cross-signal dependencies and limit the joint modeling of different feedback types. TEM4CTR (Zhang et al., 2023) addresses this issue through a three-stage framework that first retrieves unclicked records near clicked ones, then applies attention to identify relevant exposure information, and finally jointly extracts latent user interests from clicked and unclicked sequences for CTR prediction. Hence, recent practice increasingly favors integrating a broader range of user behavioral signals into recommendation models. While this enriches user representation, it also leads to substantial sequence length growth, thereby making efficient sequence processing a critical requirement. A.2. Sequence Compression in RecSys Under strict inference budget constraints, industrial RecSys often rely on staged compression pipelines to make long behavioral histories tractable. These include two stage retrieval methods such as TWIN (Chang et al., 2023), TWIN V2 (Si et al., 2024), and SIM (Pi et al., 2020), pre trained embedding approaches such as PINNERFORMER (Pancha et al., 2022), SUM (Zhang et al., 2024b), DCE (Chitsazan et al., 2021), CoSeRNN (Hansen et al., 2020), and FinTRec (Katariya et al., 2025), as well as memory augmented methods such as LMN (Lu et al., 2025), Marm (Lv et al., 2024), MIMN (Pi et al., 2019). While these methods differ in design, they share a common goal of reducing sequence length before downstream modeling. For example, TWIN V2 (Si et al., 2024) compresses histories through clustering, whereas TWIN (Chang et al., 2023), UBR4CTR (Qin et al., 2020), SIM (Pi et al., 2020), and TransAct (Xia et al., 2023) retrieve a target relevant subset of interactions followed by lightweight self attention. Although effective in reducing computation, these strategies often sacrifice signal fidelity. Because compression is performed upstream, they are typically not optimized end-to-end with downstream item relevance, and may therefore miss important real-time behavioral signals (Xia et al., 2025). This separation between compression and recommendation also limits the model’s ability to preserve the fine-grained structure of long behavioral histories. In addition, staged designs introduce operational overhead by requiring coordination between upstream retraining and downstream serving. Recent work has attempted to address these limitations more directly. TransAct V2 (Xia et al., 2025) demonstrates the benefit of combining lifelong histories with real time signals, but restricts the lifelong component to high signal explicit interactions, keeping the final sequence length at approximately 10210^2 and still discarding fine-grained information. Another direction explores generative architectures such as HSTU (Zhai et al., 2024), though these often require extremely large models and substantial compute budgets (Xia et al., 2023). LONGER (Chai et al., 2025) reduces computation through fixed window token merging followed by a lightweight Transformer over adjacent tokens. While this lowers FLOPs without hurting baseline accuracy, fixed-rate merging cannot adapt to the uneven information density of heterogeneous user behaviors. Recently, PerRec (Zhang et al., 2025b) introduced learnable tokens for sequence compression; however, it still relied on a fixed set of learnable tokens. In contrast, DP-Rec processes raw long-range sequences directly with Transformer architecture, reducing reliance on aggressive upfront compression and fixed set of assumed windows and/or learnable tokens. A.3. Sequence Compressions in Other Domains Recent research has increasingly focused on relaxing fixed-length constraints through adaptive or multi-scale segmentation strategies. Frameworks such as MSPatch (Cao et al., 2025) and HDMixer (Huang et al., 2024) leverage multi-resolution patching and extendable interpolation, respectively, while MOIRAI (Woo et al., 2024) determines patch granularity within the frequency domain. Other approaches address sequence non-stationarity and irregular intervals; for example, AdaPatch (Liu et al., 2025) introduces patch-level normalization, and APN (Liu et al., 2026) employs time-aware aggregation driven by data-density regularization. More granular architectures like SRSNet (Wu et al., 2025) and TimeMosaic (Ding et al., 2026) utilize selective reassembly or motif-based adaptation to enhance representation efficiency and decoding specialization. EntroPE(Abeywickrama et al., 2025), recently explored application of BLT to timeseries demonstrating strong efficiency and performance gains. Appendix B Temporal Rotary Positional Embeddings (Time-RoPE) To encode interaction rhythms, we adapt Rotary Positional Embeddings (Su et al., 2024) to absolute timestamps TtT_t. For a latent vector ∈ℝdx ^d, the transformation ℛ(,Tt)R(x,T_t) rotates d/2d/2 dimension pairs in the query-key space: (9) ℛ(,Tt)=⊙cos(Tt)+~⊙sin(Tt)R(x,T_t)=x ( _t)+ x ( _t) where =θi=10000−2i/di=1d/2 =\ _i=10000^-2i/d\_i=1^d/2 are the inverse frequencies. This makes the attention score between two interactions at times TtT_t and Tt′T_t a function of their time lag (Tt−Tt′)(T_t-T_t ), giving both the local and latent Transformers a continuous, density-aware sense of behavioral timing. Appendix C Lemma - Patch-count calibration under distinct scores The following lemma formalizes the calibration property of the proposed thresholding rule under an idealized no-tie condition. Specifically, it shows that when all valid surprise scores are distinct, selecting the threshold as the k-th largest valid score yields exactly the intended number of detected boundaries, and hence matches the target average patch budget up to rounding. The result is purely combinatorial and serves to justify the thresholding mechanism, rather than the semantic quality of the resulting boundaries. Lemma C.1 (Patch-count calibration under distinct scores). Let ϕ∈ℝB×Nφ ^B× N denote the surprise scores, ∈0,1B×N μ∈\0,1\^B× N the padding mask, and Φ=ϕu,t∣u,t=1 =\ _u,t μ_u,t=1\ the multiset of valid scores. Let M M be the target average number of patches, N¯=|Φ|/B N=| |/B the average sequence length, and Meff=min(M^,N¯)M_eff= ( M, N). Define the boundary budget as: k=round((Meff−1)B).k=round((M_eff-1)B). Assume all values in Φ are distinct and 0≤k≤|Φ|0≤ k≤| |. Let τ be the k-th largest element of Φ , and u,t=[ϕu,t≥τ]⋅u,t _u,t=I[ _u,t≥τ]· μ_u,t. Then the total number of detected boundaries is exactly k, and the total number of patches is: Total Patches=k+B=round(MeffB).Total Patches=k+B=round(M_effB). Consequently, the average number of patches per sequence equals MeffM_eff. Proof. Since all scores in Φ are distinct, the k-th largest value τ is unique. By definition of the k-th order statistic, there are exactly k elements in Φ with ϕu,t≥τ _u,t≥τ. Thus the total boundary count is: ∑u=1B∑t=1Nu,t=k. _u=1^B _t=1^N _u,t=k. Each sequence u∈1,…,Bu∈\1,…,B\ is partitioned into Mu=γu+1M_u= _u+1 patches, where γu=∑tu,t _u= _t _u,t is its boundary count. The total number of patches across the batch is: ∑u=1BMu=∑u=1B(γu+1)=(∑u=1Bγu)+B=k+B. _u=1^BM_u= _u=1^B( _u+1)= ( _u=1^B _u )+B=k+B. Substituting k=round((Meff−1)B)=round(MeffB−B)k=round((M_eff-1)B)=round(M_effB-B) and using that B is an integer: k+B=round(MeffB)−B+B=round(MeffB).k+B=round(M_effB)-B+B=round(M_effB). Dividing by B yields the average patch count MeffM_eff, which equals the target M M whenever the average sequence length N¯ N is sufficient. ∎ Appendix D Robustness to Item Popularity Tiers (a) ML-1M (b) ML-10M-LONG (c) KuaiRand Figure 6. Recommendation Quality (NDCG@10) by Item Popularity across three benchmark datasets. The analysis of recommendation utility across item frequency tiers reveals that while all models benefit from increased interaction density, their ability to handle "tail" versus "head" items varies significantly. Across all three datasets, we observe a monotonic increase in NDCG@10 as item frequency rises, confirming that higher-resolution signals for popular items naturally facilitate more accurate predictions. DP-Rec consistently establishes the performance ceiling across the entire popularity spectrum. Specifically, in low-frequency bins (<25<25 interactions), DP-Rec exhibits greater resilience than standard baselines, suggesting that its adaptive boundary detection effectively extracts meaningful patterns even from sparse interaction data where fixed-horizon models like SASRec and HSTU struggle to isolate a clear signal. In the high-frequency regime (>100>100 interactions), the advantage of compression-based architectures becomes even more pronounced. In ML-10M-Long and KuaiRand, both DP-Rec and LONGER significantly outperform fixed-horizon baselines. This indicates that for popular items, relevant behavioral context is likely distributed across a much longer temporal window; while fixed-horizon models are limited by rigid truncation, the adaptive patching of DP-Rec allows it to aggregate information from the entire user history without signal dilution. Notably, in KuaiRand, LONGER performs exceptionally well, closely trailing DP-Rec, whereas in ML-1M, DP-Rec maintains a wider margin over all competitors in the mid-to-head tiers. Collectively, these results demonstrate that DP-Rec provides a robust architectural advantage that scales effectively from sparse tail items to dense head items, outperforming both traditional attention-based models and uniform compression strategies. Appendix E Performance across Temporal Lag Bins (a) ML-1M (b) ML-10M-LONG (c) KuaiRand Figure 7. Recommendation Quality(NDCG@10) by Time Lag between the last item and the item in the test to be ranked. Temporal analysis across the experimental suite clarifies how the distribution of target signals modulates model performance over time. In ML-1M and KuaiRand, we observe a significant recency bias, where predictive utility for all models effectively collapses by the most distal bin (T3). In these scenarios, DP-Rec demonstrates superior peak performance in the immediate temporal bin (T1), indicating its efficacy in capturing high-entropy signals within recent interactions. However, model behavior diverges in the transition to T2: while LONGER maintains a slight edge in ML-1M, it suffers a catastrophic collapse to zero in KuaiRand, whereas HSTU exhibits higher middle-range robustness. This suggests that while uniform compression or fixed horizons can occasionally capture specific temporal windows, they are inherently prone to failure when the underlying signal density shifts. The results for ML-10M-Long provide the most compelling evidence for DP-Rec’s architectural advantage in long-range scenarios. Unlike the other datasets, ML-10M-Long exhibits remarkable signal persistence, with significant utility maintained even in the T3 bin. Here, DP-Rec consistently defines the performance ceiling across the entire temporal spectrum, maintaining a nearly flat and dominant trajectory compared to baselines. Its ability to preserve distal signals—while models like SASRec and LONGER struggle to close the gap—confirms that the entropy-driven boundary detector successfully identifies and retains informative behavioral shifts regardless of their sequence position. Collectively, these results highlight that while baseline models are often constrained by a dataset’s inherent temporal decay, DP-Rec’s adaptive patching provides a robust efficiency advantage across both high-recency and signal-persistent environments. Long-sequence recommendation is particularly relevant in sparse and long-tail settings, where a user’s older interactions may still contain useful preference signal. We therefore analyze performance stratified by item popularity to assess whether DP-Rec is especially beneficial for long-tail recommendation. Because adaptive patching preserves informative intent transitions rather than truncating the sequence uniformly, DP-Rec demonstrates gains across all the item popularity cohorts(refer Figure 6). Appendix F Experimental Configuration Table 8 provides a comprehensive overview of the experimental configurations and hyperparameter search spaces across all models. Table 8. Summary of experimental configurations and hyperparameter search spaces. For direct efficiency comparisons, Iso-capacity variants utilize a 1/1/11/1/1 block structure (d=64d=64) to parameter-match SASRec (d=64,L=3d=64,L=3). Configuration Fixed-Horizon Models Compression-Based Models SASRec (Huang, 2020) HSTU (MobileTeleSystems, 2024) GRU4Rec (MobileTeleSystems, 2024) LONGER DP-Rec Blocks (L) 3 3 1,3\1,3\ Linner,Louter∈1,3L_inner,L_outer∈\1,3\ Lenc=1,Ldec=1,Llat∈1,3L_enc=1,L_dec=1,L_lat∈\1,3\ Hidden size (d) 32,64\32,64\ 64 64 16,32,64\16,32,64\ 16,32,64\16,32,64\ Seq. length (N) 25,…,500\25,…,500\ Matched 50,100\50,100\ 100,…,500\100,…,500\ 100,…,500\100,…,500\ Patch Budget (M M) – – – 2,…,250\2,…,250\ 2,…,250\2,…,250\ Pool Initialization True True True True True Attention Heads 1 1 – 1 1 Architecture Specifics Iso-capacity L – – – Linner=Louter=1L_inner=L_outer=1 Lenc=Ldec=Llat=1L_enc=L_dec=L_lat=1 Bridge Mechanism – – – Cross-Attn Cross-Attn / Gather-Add Boundary Detector – – – – dbbd=8,Lbbd=1,we=32d_bbd=8,L_bbd=1,w_e=32 Training Specifics (Common to all models) Optimizer Adam (Learning Rate = 10−310^-3, Weight Decay = 0) Batch Size 128 Max Epochs 500 Validation Interval 10 epochs Early Stopping No Gradient Clipping No Appendix G Detailed FLOPs Accounting Inference efficiency is measured by FLOPs per forward pass, following (Hoffmann et al., 2022) but excluding non-arithmetic costs (normalization, residuals, and lookups). For a Transformer with sequence length n, average attention context m, hidden dimension h, feed-forward expansion dffd_f, and ℓ layers: (10) FLOPs(n,m)=nℓ(4h2dff+8h2+2h(m+1)).FLOPs(n,\,m)=n \! (4h^2d_f+8h^2+2h(m+1) ). The three terms correspond to the FFN (4h2dff4h^2d_f), the Q/K/V/OQ/K/V/O projections (8h28h^2), and attention score computation plus value aggregation (2h(m+1)2h(m+1)). For full causal self-attention, m=nm=n (each of the n positions attends on average to (n+1)/2(n+1)/2 tokens, giving 4h⋅n+12≡2h(m+1)4h· n+12≡ 2h(m+1) with m=nm=n). For sliding-window attention with window w, the bounded context gives m=wm=w. We set dff=4d_f=4 throughout. SASRec. Full causal attention over n tokens (m=nm=n): (11) FLOPsSAS=nℓ(4h2dff+8h2+2h(n+1)).FLOPs_SAS=n \! (4h^2d_f+8h^2+2h(n+1) ). HSTU. Same causal backbone with a 1.1×1.1× overhead for gating: (12) FLOPsHSTU=1.1×FLOPsSAS.FLOPs_HSTU=1.1×FLOPs_SAS. LONGER. Let k be the group size, G=⌈n/k⌉G= n/k the number of groups, hℓ,ℓh_ , _ the local (inner-transformer) hidden size and layers, and hg,ℓgh_g, _g the global hidden size and layers. Inner-group encoding uses full causal attention over k tokens (m=km=k); global reasoning uses full causal attention over G groups (m=Gm=G): (13) FLOPsLNG=G⋅fℓ,hℓ(k,k)+ 2nGhg+fℓg,hg(G,G),FLOPs_LNG=G· f_ _ ,h_ (k,\,k)\;+\;2nGh_g\;+\;f_ _g,h_g(G,\,G), where fℓ,h(n,m)=ℓ(4h2dff+8h2+2h(m+1))f_ ,h(n,m)= (4h^2d_f+8h^2+2h(m+1)) is the per-token cost from Eq. 10, and 2nGhg2nGh_g is the token-to-group cross-attention cost. DP-Rec. Let npn_p be the average patch size, M=⌈n/np⌉M= n/n_p the number of latent patches, dbbd,Lbbd,wed_bbd,L_bbd,w_e the boundary detector hidden size, layers, and window, d,Llatd,L_lat the latent transformer hidden size and layers, dloc,Lloc,wd_loc,L_loc,w the local encoder/decoder hidden size, layer count, and sliding window. The total per-sequence cost decomposes as: (14) FLOPsDP=n(fbbd+flatnp+fenc+fdec+fbrg),FLOPs_DP=n\! (f_bbd+ f_latn_p+f_enc+f_dec+f_brg ), where each per-token term is an instance of Eq. 10: (15) fbbd f_bbd =Lbbd(4dbbd2dff+8dbbd2+2dbbd(we+1)), =L_bbd\! (4d_bbd^2d_f+8d_bbd^2+2d_bbd(w_e+1) ), (16) flat f_lat =Llat(4d2dff+8d2+2d(M+1)), =L_lat\! (4d^2d_f+8d^2+2d(M+1) ), (17) fenc f_enc =Lloc(4dloc2dff+8dloc2+2dloc(w+1)), =L_loc\! (4d_loc^2d_f+8d_loc^2+2d_loc(w+1) ), (18) fdec f_dec =Lloc(4dloc2dff+8dloc2+2dloc(w+1)). =L_loc\! (4d_loc^2d_f+8d_loc^2+2d_loc(w+1) ). The global cost flatf_lat is amortised over npn_p tokens per patch (the 1/np1/n_p factor in Eq. 14). The bridge term fbrg=0f_brg=0 under the default gather-add bridge. Although the behavioral boundary detector is frozen during training, its cost is included in the total inference budget. Table 9. Concrete FLOPs at n=200n=200, dff=4d_f=4. SASRec/HSTU: d=64d=64, ℓ=3 =3. LONGER: d=dloc=64d=d_loc=64, Llat=Lloc=1L_lat=L_loc=1, k=4k=4, G=50G=50. DP-Rec: d=dloc=64d=d_loc=64, Llat=Lloc=1L_lat=L_loc=1, w=32w=32, dbbd=8d_bbd=8, Lbbd=1L_bbd=1, we=32w_e=32, M=10M=10. Model FLOPs vs. SASRec Complexity SASRec 74,419,20074,419,200 1.00×1.00× O(n2hℓ)O(n^2h ) HSTU 81,861,12081,861,120 1.10×1.10× O(n2hℓ)O(n^2h ) LONGER 26,310,40026,310,400 0.35×0.35× O(nkdlocLloc+G2dLlat)O(nkd_locL_loc+G^2dL_lat) DP-Rec 42,421,12042,421,120 0.57×0.57× O(nwdloc⋅2Lloc+M2dLlat)O(nw\,d_loc· 2L_loc+M^2d\,L_lat)