Source-linked AI summary
RELAY: One Query, Two Roles for Sequential Recommendation
Zesheng Li, Chengchang Pan, Honggang Qi
TL;DR
Sequential recommendation must combine semantic preferences with behavioral associations while keeping inference cost low. RELAY uses one learned query for semantic readout and behavioral-memory routing, with candidate-conditioned gates and a single catalog likelihood. Across six datasets, it leads the compared methods in Recall@5 and NDCG@5 while using fewer predictor parameters and achieving faster inference than the previous best model.
Problem
Sequential recommendation must combine semantic preferences with behavioral associations to deliver accurate rankings at low inference cost.
Source: §1 · p. 1Method
RELAY reuses one learned query’s history attention for semantic readout and for routing direct-history and transition evidence into candidate scores, training both roles with one catalog likelihood.
Source: §1 · p. 1Results
Takeaways & Limitations
Shared history selection unifies preference representation and behavioral evidence in a compact recommendation network.
Source: §5 · p. 9
Abstract
from arXiv · showhide
Sequential recommendation must combine semantic preferences with behavioral associations to deliver accurate rankings at low inference cost. Sharing history selection connects preference representation directly to the behavioral evidence used in candidate scoring. We present RELAY, a compact sequential recommender built around one query, two roles: semantic readout and behavioral-memory routing. A single learned query forms a semantic preference representation and reuses its attention to route direct-history and transition evidence into candidate scores. Candidate-conditioned gates calibrate the two memory channels for each candidate. RELAY trains both roles with a single catalog likelihood and produces the final ranking in one forward pass. Full-catalog experiments on six datasets show that RELAY achieves the highest Recall@5 and NDCG@5 among the compared methods on every dataset, improving over the previous best model by 14.22% and 17.88% on average. With 2.044 million predictor parameters, RELAY reduces predictor size by 65.12% and achieves a 1.75~1.79$\times$ inference speedup over the previous best model.
1 Introduction
Sequential recommendation must combine semantic preferences with behavioral associations under tight inference budgets. RELAY uses one query for semantic readout and behavioral-memory routing, and the paper reports gains in ranking quality, predictor size, and inference time.
Motivation
- Semantic preferences and observed behavioral associations provide complementary evidence for accurate recommendations within a tight inference budget.Shared item semantics reveal broader preferences, while behavioral associations identify choices that tend to follow past interactions [6] [20] [33].Source: §1 · p. 1
Contribution
- A single learned query forms a semantic preference representation and reuses its history attention to route direct-history and transition evidence into candidate scores.Candidate-conditioned gates calibrate the memory evidence, and recommendation takes one forward pass.Source: §1 · p. 1
- One catalog likelihood trains both roles through the final ranking scores, jointly supervising shared attention for semantic readout and explicit memory routing.The paper also presents Figure 1 as a comparison of accuracy, predictor size, and inference cost averaged equally over six datasets.Source: §1 · p. 1, Figure 1 · p. 1
Results
- Across six datasets, RELAY achieves the highest Recall@5 and NDCG@5, improving over the previous best model by 14.22% and 17.88% on average.It also uses 65.12% fewer predictor parameters and achieves a 1.75–1.79× inference speedup.Source: §1 · p. 2
2 Related Work
Prior work studies sequence-based preference learning, semantic catalog representations, behavioral memory, and efficient ranking. RELAY combines these strands through shared attention that links a semantic representation to explicit candidate-level behavioral evidence.
Sequential preference modeling
- Sequence and multi-interest recommenders use history encoders, dynamic routing, or attention to model preferences and extract multiple preference vectors [5, 11, 25] [2] [12].These studies establish history selection and aggregation as central modeling choices; RELAY gives one query coupled semantic-readout and memory-routing responsibilities.Source: §2 · p. 2
Semantic representations and direct ranking
- Content-aware and vector-quantized representations, semantic-ID retrieval, and direct catalog scoring connect item semantics to recommendation [6] [9] [20] [3] [10] [15] [28] [32] [31].RELAY uses SID representations in a unified catalog scorer, focusing on attention shared between semantic preferences and bounded behavioral evidence.Source: §2 · p. 2
Transition and history memory
- Prior approaches combine item transitions, graph relations, repeat-aware history, or distilled transition patterns [13] [29] [21] [33]; RELAY routes bounded transition memory with its semantic-readout attention.It removes each training record’s one-count contribution and restores the adjusted top-neighbor set before computing that record’s loss.Source: §2 · p. 2
Efficient recommendation and one-pass inference
- Parallel SID prediction, discrete diffusion, single-step prediction, distillation, and fused catalog distributions address efficient recommendation [8] [17] [24] [1] [4] [26] [14].RELAY assigns every SID a semantic score and uses query-routed memory to adjust candidates reached through direct history and bounded transition neighborhoods.Source: §2 · p. 2
3 Method
RELAY encodes a history against a semantic catalog, then uses one learned query to select history positions for both semantic readout and behavioral-memory routing. A unified catalog score and likelihood connect these roles, while record-excluded transition statistics support training and routed memory adjusts scores on sparse candidate support.
3.1 Semantic Catalog and History Representation
- A fixed semantic index defines the candidate catalog, and a bidirectional encoder contextualizes history interactions using code embeddings and position embeddings.The shared projection is used in history encoding, semantic readout, and candidate representation; padding is masked throughout.Source: §3.1 · p. 2
3.2 One Query, Two Roles
- One learned query assigns normalized attention to encoded history positions, and the same weights drive semantic readout and behavioral-memory routing.Contextual keys let repeated occurrences of one SID receive different weights; longer histories distribute the same total attention mass across more positions.Source: §3.2 · pp. 2–3
3.3 Attention-Routed Behavioral Memory
- Direct-history memory identifies previously observed SIDs, while bounded transition memory links historical SIDs to associated choices; candidate-conditioned gates set their separate strengths.Transition neighbors retain the B largest positive counts, and the logarithm compresses count magnitude.Source: §3.3 · pp. 3–4
3.4 Record-Excluded Catalog Learning
- Training excludes each record’s own transition contribution, then exactly recovers adjusted top-B neighbors from a retained top-(B+1) buffer.The catalog cross-entropy residual supervises shared attention through both readout and explicit memory routing, while one next-target likelihood jointly trains the predictor components.Source: §3.4 · p. 4
3.5 Ranking Structure and One-Pass Recommendation
- Memory changes scores only on its sparse support, while candidates outside that support retain their semantic scores and the corrected full catalog is ranked.Serving encodes the history and evaluates its query once, scores the catalog with cached vectors, then adds routed evidence at memory destinations.Source: §3.5 · pp. 4–5
4 Experiments
Across six datasets, RELAY leads the compared methods in mean Recall@5 and NDCG@5, while using fewer predictor parameters and less inference time. Ablations and routing interventions examine its memory channels, shared attention, and record exclusion; additional tests report gains across popularity and history-length groups.
4.2 Overall Recommendation Performance
- RELAY achieves the highest mean Recall@5 and NDCG@5 on every dataset, improving over OneChord by 14.22% and 17.88% on average.On Toys, Recall@5 rises from 0.0746 to 0.0890 and NDCG@5 from 0.0546 to 0.0658.Source: §4.2 · p. 5, Table 1 · p. 6
4.3 Inference Efficiency and Model Size
- RELAY completes full-test Top-10 generation in 0.13–0.70 seconds and is 1.75–1.79× faster than OneChord; its 2.044-million-parameter predictor is 65.12% smaller.It has the lowest inference cost and fewest predictor parameters among the compared models.Source: §4.3 · pp. 5–6, Table 2 · p. 6, Table 4 · p. 7
4.4 Ablation Study
- Removing all behavioral memory reduces average R@5 and N@5 by 9.25% and 12.33%; removing transition memory reduces them by 10.49% and 13.17%.Removing direct-history memory reduces them by 1.72% and 2.20%; both channels contribute in every domain, with transition memory providing the larger gain.Source: §4.4 · pp. 6–7, Table 3 · p. 7
- Removing current-record exclusion reduces average R@5 by 23.07% and N@5 by 20.12%, the largest reported ablation effect.Separate routing reduces them by 1.72% and 1.99%.Source: §4.4 · p. 7
4.5 Performance across Interaction Sparsity
- Against OneChord, RELAY’s N@5 gains are 4.92%, 16.66%, and 22.04% for tail, middle, and head targets, and 18.96%, 16.68%, and 20.60% for short, medium, and long histories.R@5 gains are positive across all three popularity groups and all three history-length groups.Source: Table 5 · p. 7, §4.5 · p. 8
4.4 Ablation Study
- Shared attention saves 65,556 parameters while retaining higher average accuracy in all six domains.The same interaction weights determine the semantic preference and behavioral associations supplied to candidates.Source: §4.4 · p. 7
4.7 Record Exclusion and Test Cases
- Without exact record exclusion, training N@5 reaches 27.48% versus 12.65%, while validation falls to 4.40% versus 5.73%.Removing each target transition reverses the training ranking (4.93% versus 8.00%); unseen transitions account for most held-out gain.Source: Figure 3 · p. 8, §4.7 · p. 8
4.6 Query-Guided Memory Routing
- Replacing query-guided routing with uniform weights reduces N@5 by 7.73%, while shuffling learned weights across history positions reduces it by 11.18%.Relative to position-based recency routing, query-guided N@5 gains rise from 0.58% for short histories to 2.84% for long histories.Source: Table 6 · p. 8, §4.6 · p. 8
5 Conclusion
RELAY uses one learned query and shared history attention for semantic preference readout and behavioral-memory routing. Across six domains, it improves ranking metrics while reducing predictor size and inference time.
5 Conclusion
- RELAY’s shared history attention forms semantic preferences and routes behavioral evidence into candidate scores, with one catalog likelihood training both roles.Across six domains, it improves Recall@5 and NDCG@5 over the strongest baseline by 14.22% and 17.88% on average, with 65.12% fewer predictor parameters and 1.75–1.79× faster inference.Source: §5 · p. 9
A Derivations and Additional Method Details
The appendix gives implementation details for the shared representation and prediction space, exact current-record exclusion, and shared-attention gradients. It also describes probability correction and its sensitivity evaluation.
A.1 Representation and Prediction Space
- The representation uses one shared projection for history codes, candidate codes, and L copies of the readout state; candidate vectors are cached and transition memory stores B serving destinations plus one for training.The readout is bidirectional and pre-normalized, and routing averages pre-dropout head probabilities.Source: §A.1 · p. 9
A.2 Exact Current-Record Exclusion
- Exact current-record exclusion decrements the record’s source-to-target transition count and recovers the updated top-B neighborhood from the stored top-(B+1).It removes only that record’s contribution; other training windows, including the same user’s, remain, and serving uses the original top-B table.Source: §A.2 · p. 10
A.3 Gradient of Shared Attention
- The catalog cross-entropy gradient reaches shared attention through both the readout-state path and a routing path that compares each position’s residual with its head average.The routing residual compares target evidence with the model-weighted average evidence.Source: §A.3 · p. 10
A.4 Probability Tilt
- Probability correction preserves pairwise odds and order outside its support while retaining catalog-wide normalization; the implementation adds sparse memory corrections after scoring the full catalog.Figure 4 describes training cross-entropy, validation N@5 across epochs, and training N@5 drops after removing each record’s own transition.Source: §A.4 · p. 10, Figure 4 · p. 10
B.1 Datasets and Evaluation
The evaluation uses chronologically ordered Amazon Reviews data and full-catalog ranking over distinct four-code SIDs. It also reports item-level results on three datasets and supplements the main K=5 comparison with K=10 results.
B.1 Datasets and Evaluation
- Amazon 2014 uses category-specific 5-core data, while Amazon 2023 retains each user’s longest chronological sequence; histories are capped at 20 interactions.The last two interactions are validation and test targets, with windows drawn from the earlier prefix.Source: §B.1 · p. 10
- Evaluation ranks all distinct four-code SIDs and requires an exact match to the held-out target SID.Item-ID rankings are mapped through the fixed OPQ mapping, with repeated SIDs collapsed at their first-ranked position before metrics are computed.Source: §B.1 · p. 10
- For item-level full-catalog metrics averaged over Sports, Beauty, and Toys, RELAY improves mean R@5/N@5 by 12.88%/15.32% over the strongest baseline.Table 8 supplements the main comparison with RELAY’s full-catalog performance at K=10.Source: Table 9 · p. 11, §B.1 · p. 11, Table 8 · p. 11
B.2 Architecture and Training
RELAY uses a compact shared architecture for semantic preference readout and behavioral-memory routing. Training uses catalog cross-entropy with validation-based checkpointing and early stopping.
B.2 Architecture and Training
- Each SID has four 256-value digits; a width-256 encoder and one cross-attention layer share a 256-dimensional projection, without query self-attention.The model uses four heads, feed-forward width 1024, and dropout 0.1.Source: §B.2 · p. 11
- Mean pre-dropout attention routes both memory channels, while a 256-to-2 candidate-conditioned affine gate calibrates memory corrections.Memory retains eight off-diagonal destinations weighted by log(1 + C), plus a ninth exclusion backup.Source: §B.2 · p. 11
- Catalog cross-entropy trains for at most 150 epochs, with per-epoch validation and patience 10.Training uses AdamW with learning rate 10^-4, zero weight decay, gradient clipping at 1, batch size 1024, and cosine scheduling after 10,000 warmup steps; evaluation batch size is 256.Source: §B.2 · p. 11
B.3 Seeds and Aggregation
Main improvements are averaged as domain-relative gains, while efficiency measurements use timed full-test inference and explicitly scoped predictor-parameter counts.
B.3 Seeds and Aggregation
- 14.22% R@5 and 17.88% N@5 are the six-domain average gains over OneChord.Main results average five seeds; RELAY reports mean and sample standard deviation, while baselines report means.Source: §B.3 · p. 11
B.4 Efficiency and Parameters
- Inference timing reports median latency across six warmed-up full-test CUDA Graph passes through Top-10 selection.Measurements use an NVIDIA A800 80GB PCIe in FP32 without TF32, batch size 256, GPU-resident inputs, cached candidate vectors, and each model’s official inference configuration; loading, transfers, preparation, and warmup are excluded.Source: §B.4 · p. 11
- 2,043,650 parameters are counted for RELAY, with tokenizers, training-only components, memory, and caches excluded.Parameter reductions are relative to each baseline; Figure 1 averages domain N@5, parameters, and inference seconds, with logarithmic cost.Source: §B.4 · p. 11
B.5 Ablation Definitions
The appendix specifies matched ablation and intervention settings, a multi-query extension, and groupings used to examine interaction sparsity and record-exclusion effects.
B.5 Ablation Definitions
- Table 3 tests memory-channel deletions, current-record exclusion, attention sharing, and quantizers under matched data and optimization settings.Its lower panel compares SPRINT, OneChord, and RELAY with three quantizers on Sports, Beauty, and Toys; RELAY leads both metrics in every setting.Source: §B.5 · p. 11
B.6 Multi-Query Extension
- Two and four learned queries improve N@5 by 4.10% and 5.08%, and long-history N@5 by 3.85% and 4.94%, respectively.They add 256 and 768 parameters and 11.28% and 33.93% inference time; each query performs semantic readout and memory routing, and the maximum complete query score ranks each candidate.Source: §B.6 · p. 11
B.7 Interaction Sparsity
- Target-frequency groups use tail f ≤ q50, middle q50 < f ≤ q80, and head f > q80; history groups contain ≤5, 6–10, or 11–20 interactions.Both partitions cover 280,559 test users, and exact-SID metrics average domains equally.Source: §B.7 · p. 12
B.8 Query Routing Intervention
- Table 6 compares learned memory attention with uniform, recency-weighted, and shuffled learned weights across the same 280,559 users.Shuffling preserves weights and normalization, padding remains zero, and results use equal-domain aggregation and the B.7 groups.Source: §B.8 · p. 12
B.9 Record-exclusion Diagnostics
- Figure 4 compares matched models over 52 shared epochs and groups N@5 changes by each removed transition’s remaining frequency.The final panel removes each training record’s own transition at the selected checkpoint.Source: §B.9 · pp. 12–13
C Illustrated Recommendation Cases
Illustrated full-catalog cases compare RELAY and OneChord on histories of up to 20 interactions across six domains. RELAY places the target first in five domains and second in Scientific.
C Illustrated Recommendation Cases
- RELAY ranks the target first in five domains and second in Scientific, while OneChord ranks it >10, 8, 6, 3, >10, and 7 across the six domains.The displayed histories are shortened, and each displayed item has a unique SID.Source: C Illustrated Recommendation Cases · p. 13
- In Beauty, RELAY ranks Nautica Classic first, while OneChord’s Top-3 stays within Yacht Man fragrances.The contrast illustrates different candidate rankings for a fragrance history.Source: C Illustrated Recommendation Cases · p. 13
- In Toys, RELAY ranks Golden Dragon ahead of other LEGO sets; in Scientific, it places the target wool pad ahead of the brush.Equipment histories also lead to golf balls, an audio interface, and a racing wheel.Source: C Illustrated Recommendation Cases · p. 13