Papers
Topics
Authors
Recent
Search
2000 character limit reached

HyenaRec: Scalable Sequential Recommendation

Updated 4 July 2026
  • HyenaRec is a sequential recommendation model that replaces quadratic self-attention with Hyena-style convolutions, efficiently handling long and sparse user histories.
  • It integrates a long convolution path with a gated short-path modulation and explicitly parameterized Legendre polynomial kernels to balance global trends with local interest bursts.
  • Experimental results show improved NDCG and Recall metrics over baseline models on datasets with ultra-long sequences, while offering significant training speedups.

Searching arXiv for HyenaRec and closely related sequential recommendation work to ground the article and confirm the queried model identity. HyenaRec is a sequential recommendation model for next-item prediction on long user interaction histories. It replaces quadratic self-attention with a Hyena-style long convolution whose kernels are explicitly parameterized by Legendre orthogonal polynomials and complemented by gated short-path modulation, with the stated goal of balancing global temporal evolution and localized user interests under sparse feedback while scaling linearly with sequence length (Liu et al., 26 Mar 2026). The model is positioned for regimes in which user behavior is long, sparse, noisy, and often non-periodic, and where attention-based architectures incur prohibitive training memory and time costs.

1. Problem setting and motivation

HyenaRec is formulated on an ordered interaction sequence S=[i1,,iT]\mathcal S=[i_1,\dots,i_T], where the task is to predict the next item iT+1i_{T+1} from a corpus Y\mathcal Y of size VV (Liu et al., 26 Mar 2026). The model outputs logits sRV\mathbf s \in \mathbb R^V and is trained with next-item cross-entropy / negative log-likelihood,

L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.

At inference time, items are ranked by the softmax scores and evaluated with Recall@kk and NDCG@kk.

The motivating diagnosis is that standard sequential recommendation methods encounter distinct failure modes on long histories. Classical Markov models are characterized as too local. RNNs and CNNs are described as struggling with long-range dependence or receptive-field limitations. Attention-based Transformers such as SASRec and BERT4Rec have strong modeling power, but their cost grows quadratically with sequence length because they explicitly compute pairwise token interactions. In long-history recommendation, this yields high training memory and time cost and also makes incremental inference expensive.

Hyena-style sub-quadratic sequence operators are introduced as efficient alternatives to attention in language modeling, but HyenaRec argues that recommendation imposes additional constraints. User-item interaction data are sparse, noisy, and often non-periodic, and user behavior may combine slowly evolving preferences with short bursts of activity. The model therefore treats direct transplantation of Hyena into recommendation as insufficient. This suggests that HyenaRec’s contribution is not merely operator substitution, but operator adaptation to the specific statistical structure of recommender data.

2. Architectural composition

HyenaRec has three main parts: an input embedding layer, a Hyena-based sequential backbone, and a prediction layer with tied item embeddings (Liu et al., 26 Mar 2026). Each item ID is mapped to a DD-dimensional embedding, producing ERB×L×D\mathbf E \in \mathbb R^{B\times L\times D} for batch size iT+1i_{T+1}0 and sequence length iT+1i_{T+1}1. Rather than adding standard positional embeddings directly as in Transformers, position information is injected into the filter generation process.

The positional construction begins from a normalized temporal grid,

iT+1i_{T+1}2

followed by complex exponential features

iT+1i_{T+1}3

and the positional representation

iT+1i_{T+1}4

These features are supplied to the filter generator rather than being directly superposed onto token embeddings.

The backbone is a stack of iT+1i_{T+1}5 Hyena blocks. Each block contains a mixer, an MLP, residual connections, and normalization, and maps hidden states according to

iT+1i_{T+1}6

The key architectural modification lies in the mixer, which is a Hyena operator adapted for recommendation.

The prediction layer projects the final hidden states iT+1i_{T+1}7 to item logits,

iT+1i_{T+1}8

with weight tying between iT+1i_{T+1}9 and the input embedding table. In practical terms, this makes HyenaRec a sequence encoder followed by a standard full-vocabulary next-item predictor.

3. Hyena adaptation: long convolution, short-path modulation, and Legendre kernels

The core operator replaces explicit attention matrices with a hierarchical composition of a short path for local, data-dependent modulation and a long path for depthwise long convolution (Liu et al., 26 Mar 2026). Let Y\mathcal Y0 denote the input embeddings. Hyena first expands channels:

Y\mathcal Y1

where Y\mathcal Y2 and Y\mathcal Y3 depends on the operator order Y\mathcal Y4.

The short path splits Y\mathcal Y5 into several modulation streams and an initial state:

Y\mathcal Y6

The long path then performs stage-wise gated depthwise convolutions. For each stage Y\mathcal Y7,

Y\mathcal Y8

where Y\mathcal Y9 is element-wise modulation, VV0 is causal depthwise 1D convolution, and VV1 is the stage-specific convolution kernel. The output is

VV2

with VV3.

A major contribution is the replacement of the original implicit Hyena filter generator with an explicit polynomial-based kernel parameterization using Legendre orthogonal polynomials. For each stage VV4, the kernel is represented as

VV5

where VV6 is the VV7-th Legendre polynomial, VV8 are learnable coefficients, and VV9 is the number of basis functions. The Legendre polynomials are defined by Rodrigues’ formula,

sRV\mathbf s \in \mathbb R^V0

and can also be computed by the recurrence

sRV\mathbf s \in \mathbb R^V1

The full basis matrix sRV\mathbf s \in \mathbb R^V2 is formed by evaluating the polynomials on the temporal grid, and the channel-wise kernels are computed as

sRV\mathbf s \in \mathbb R^V3

with sRV\mathbf s \in \mathbb R^V4. This enforces per-channel sRV\mathbf s \in \mathbb R^V5 normalization,

sRV\mathbf s \in \mathbb R^V6

which is stated to help prevent signal blow-up or vanishing across stacked layers.

The paper emphasizes three reasons for selecting Legendre polynomials: orthogonality under the uniform measure, controlled boundary values with sRV\mathbf s \in \mathbb R^V7, and a non-periodic inductive bias more suitable for recommendation than Fourier bases because user behavior is sparse and not naturally periodic. This suggests that the kernel basis is intended not only as a parameter-efficient representation, but also as an inductive bias aligned with recommender sequence statistics.

4. Short-term burst modeling, convolutional implementation, and complexity

HyenaRec does not rely only on long convolutions. The multiplicative term sRV\mathbf s \in \mathbb R^V8 functions as a data-dependent gate that decides which signals are passed into the long convolution at each stage (Liu et al., 26 Mar 2026). This component is motivated by the presence of short behavioral bursts in recommendation sequences, including sudden changes in intent, repeated clicks on a narrow topic, and immediate transitions reflecting short-term preferences. Long convolution is characterized as effective for slowly varying and global dependencies but liable to smooth away local bursts; the gating branch is therefore presented as a complementary mechanism preserving fine-grained local structure while modulating long-range propagation.

Once kernels are built, the depthwise convolution is applied as

sRV\mathbf s \in \mathbb R^V9

and the model computes these convolutions efficiently in the frequency domain using FFT. The intended effect is near-linear scaling together with long effective receptive fields.

The complexity discussion contrasts standard self-attention and HyenaRec. Standard self-attention requires building an L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.0 similarity matrix, with time complexity L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.1 and memory complexity L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.2. HyenaRec uses embedding and projection layers, Legendre kernel generation, and FFT-based long convolution, with per-layer cost reported as roughly

L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.3

and memory about

L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.4

The Legendre basis generation itself costs L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.5, stated to be small because L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.6. The paper also notes that inference supports L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.7 incremental computation per step in a streaming setting. In the model’s framing, these asymptotics are the basis for handling ultra-long sequences such as XLong, whose average length is approximately L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.8, without reverting to quadratic pairwise interaction modeling.

5. Experimental protocol and quantitative results

Experiments are conducted on four real-world datasets: ML-1M, Steam, Video, and XLong (Liu et al., 26 Mar 2026). ML-1M contains 6,040 users and 3,416 items, with average length 165.5 and sparsity 95.2%. Steam contains 334,730 users and 13,047 items, with average length 11.0 and sparsity 99.96%. Video contains 31,013 users and 23,715 items, with average length 9.3 and sparsity 99.9%. XLong contains 69,691 users and 2,122,932 items, with average length 958.8 and sparsity 99.95%. The evaluation protocol is leave-one-out: the last interaction is used for test, the second-to-last for validation, and the rest for training; items with fewer than 5 interactions and users with fewer than 2 interactions are filtered.

The baseline set comprises GRU4Rec, NARM, SASRec, BERT4Rec, EulerFormer, HSTU, and LRURec. Additional comparisons include Mamba4Rec and an AtrousHyena variant in appendix experiments. The reported metrics are Recall@10, Recall@20, NDCG@10, and NDCG@20. The training details are also specified: AdamW optimizer, learning rate L(θ)=logexp(siT+1)jYexp(sj).\mathcal L(\theta) = -\log \frac{\exp(s_{i_{T+1}})}{\sum_{j\in\mathcal Y}\exp(s_j)}.9, batch size 128 or 32 for XLong, maximum 500 epochs, early stopping if Recall@10 does not improve for 10 validations, hidden size 64, 2 layers, default dropout 0.2, and weight decay tuned among kk0.

HyenaRec is reported as the best or second-best model across all datasets and metrics. On ML-1M, it achieves NDCG@10 kk1, NDCG@20 kk2, Recall@10 kk3, and Recall@20 kk4. Compared to the strongest baseline LRURec, this corresponds to about +4.94% on NDCG@10, +5.10% on NDCG@20, +3.30% on Recall@10, and +4.04% on Recall@20. On Steam, the reported values are NDCG@10 kk5, NDCG@20 kk6, Recall@10 kk7, and Recall@20 kk8. On Video, the reported values are NDCG@10 kk9, NDCG@20 kk0, Recall@10 kk1, and Recall@20 kk2.

The clearest gains appear on XLong. There HyenaRec reports NDCG@10 kk3, NDCG@20 kk4, Recall@10 kk5, and Recall@20 kk6. The model is stated to be slightly below LRURec’s kk7 on Recall@20, but to win clearly on NDCG, especially top-kk8 ranking quality. The strongest reported improvements are +17.65% on NDCG@10 and +13.83% on NDCG@20 over LRURec. This supports the paper’s claim that the model is especially effective on long-sequence recommendation rather than uniformly dominant on every metric.

Training-speed comparisons are also reported. On ML-1M, SASRec takes 1.77kk9 longer, BERT4Rec takes 4.25DD0 longer, and HSTU takes 1.62DD1 longer. The abstract states up to 6DD2 speedup. The interpretation offered in the paper is that the linear/sub-quadratic operator design and efficient FFT convolution jointly account for this training-time advantage.

6. Ablations, operating regime, limitations, and name disambiguation

The ablation study isolates the importance of the main design choices (Liu et al., 26 Mar 2026). Removing the polynomial kernel, denoted w/o PK, lowers performance across datasets: for example, Steam Recall@20 drops from DD3 to DD4, and on XLong Recall@20 drops from DD5 to DD6. Removing GLU/gating, denoted w/o GLU, also hurts performance, especially on ML-1M and Video. Replacing the kernel with Fourier bases worsens results, especially on XLong, where Recall@20 becomes DD7 versus DD8. Replacing the kernel with Chebyshev bases also underperforms Legendre kernels, though sometimes not as badly as Fourier. The reported takeaway is that both components matter: the Legendre polynomial kernel provides smoother, more stable long-range modeling, and the gated short path captures localized bursts.

Sensitivity analysis indicates that the model is fairly robust to the polynomial order DD9, with best performance around ERB×L×D\mathbf E \in \mathbb R^{B\times L\times D}0. Performance improves from ERB×L×D\mathbf E \in \mathbb R^{B\times L\times D}1 to ERB×L×D\mathbf E \in \mathbb R^{B\times L\times D}2, then slightly drops at ERB×L×D\mathbf E \in \mathbb R^{B\times L\times D}3, suggesting possible overfitting or unnecessary complexity at larger basis sizes. Additional observations are that moderate dropout works best, too much dropout hurts long-range preference modeling, and weight decay around ERB×L×D\mathbf E \in \mathbb R^{B\times L\times D}4 is a good default.

The operating regime in which HyenaRec is most valuable is stated explicitly: user histories are long, feedback is sparse, and behavior mixes long-term drift with short-term bursts. Its advantage is largest on XLong and other longer sequences, where attention becomes expensive and long-range modeling matters most. On shorter or less challenging datasets, the margin over strong baselines is described as smaller, though still positive. A related limitation is that some variants such as atrous convolutions provide only modest gains, suggesting that increased multi-scale convolutional complexity alone is not sufficient; the structured kernel design and gating are more important.

The name “HyenaRec” should also be distinguished from similarly named but unrelated works. It is not HyTRec, the hybrid temporal-aware attention architecture for long behavior sequential recommendation (Xin et al., 20 Feb 2026), and it is not HYREC-2, a hydrogen recombination code for cosmology (Lee et al., 2020). Within recommendation research, HyenaRec denotes the model that adapts the Hyena operator to sequential recommendation through Legendre orthogonal polynomial kernels and gated convolutions.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to HyenaRec.