Abstract
Sequential recommender systems (SRS) predict the next items that users may prefer based on user historical interaction sequences. Inspired by the rise of large language models (LLMs) in various AI applications, there is a surge of work on LLM-based SRS. Despite their attractive performance, existing LLM-based SRS still exhibit some limitations, including neglecting intra-item relations, ignoring long-term collaborative knowledge and using inflexible architecture designs for adaption. To alleviate these issues, we propose an LLM-based sequential recommendation model named DARec. Built on top of coarse-grained adaption for capturing inter-item relations, DARec is further enhanced with (1) context masking that models intra-item relations to help LLM better understand token and item semantics in the context of SRS, (2) collaborative knowledge injection that helps LLM incorporate long-term collaborative knowledge, and (3) a dynamic adaption mechanism that uses Bayesian optimization to flexibly choose layer-wise adapter architectures in order to better incorporate different sequential information. Extensive experiments demonstrate that DARec can effectively handle sequential recommendation in a dynamic and adaptive manner.
Introduction
Sequential Recommender Systems (SRS) are designed to predict a user’s future preferences by analyzing their chronological interaction history. While Large Language Models (LLMs) have recently been integrated into SRS to leverage their vast "world knowledge," current implementations often fall short. Most existing models treat items as atomic units, neglecting the fine-grained semantic relationships within item descriptions. Furthermore, they often fail to incorporate the deep numerical patterns captured by traditional collaborative filtering (CF) and rely on rigid, "one-size-fits-all" fine-tuning architectures.
To address these gaps, we introduce DARec (Dynamic Adaption for Recommendation). DARec moves beyond simple item-to-item relationships by introducing context masking for intra-item semantics, injecting long-term collaborative knowledge from traditional models, and employing Bayesian optimization to dynamically tailor the neural architecture for every model layer.
Methodology
DARec is built upon a multi-faceted approach to bridge the gap between natural language processing and recommendation logic.
Coarse-Grained Adaption Tasks
The model is first grounded through three auxiliary tasks designed to align the LLM with the recommendation domain:
- Semantic Alignment: Mapping item IDs directly to their textual descriptions.
- Link Next Item: Predicting the subsequent item ID in a sequence.
- Distinguishing Hard Samples: Utilizing contrastive learning to differentiate between similar items that do not co-occur in user histories.
Context Masking and Collaborative Injection
To capture intra-item relations, DARec utilizes "context masking." Unlike standard causal masking, this allows tokens within a single item's description to attend to each other bi-directionally, ensuring the LLM understands the full context of item attributes.
To incorporate long-term collaborative knowledge, DARec takes embeddings from traditional CF models (such as Neural Collaborative Filtering) and injects them as "cues" directly into the LLM’s attention mechanism. This hybrid approach combines the textual reasoning of LLMs with the behavioral "memory" of traditional recommenders.
Dynamic Adaption via Bayesian Optimization
Recognizing that different layers of an LLM serve different functions, DARec avoids fixed adapter designs. Instead, it uses Bayesian optimization to search for the optimal configuration—such as serial versus parallel adapters—for each individual layer. This allows the model to adapt its internal structure to the specific nuances of the dataset.
Experimental Evaluation
Datasets
DARec was evaluated across five sub-categories of the Amazon dataset, representing diverse user behaviors and scales:
- Arts, Crafts, and Sewing
- Industrial and Scientific
- Musical Instruments
- Prime Pantry
- Video Games
Key Results
DARec consistently outperformed both traditional baselines (e.g., SASRec) and state-of-the-art LLM-based models (e.g., RecFormer, P5).
- Performance Gains: The model achieved an average improvement of 8.92% on NDCG@10, 7.75% on Recall@10, and 8.05% on MRR over the strongest baselines.
- Efficiency: DARec demonstrated superior efficiency, requiring significantly less training time than models like RecFormer while maintaining higher accuracy.
- Ablation Studies: Removing context masking, CF injection, or the dynamic adaption mechanism resulted in measurable performance declines, confirming that each component is vital to the system's success.
Discussion and Future Work
The success of DARec highlights the importance of bridging the "token-item" gap. By treating multi-token descriptions as cohesive semantic units and layering behavioral data on top of textual knowledge, DARec achieves a more holistic understanding of user intent.
Future research will focus on expanding the diversity of Parameter-Efficient Fine-Tuning (PEFT) methods, such as LoRA, and scaling the DARec framework to larger LLM backbones like Llama-3 to explore the limits of its adaptive capabilities.
Summary updated