arXiv:2608.12184cs.IRAug 2026

Manuscript Offprint

arXiv:2608.12184

Making Collaborative Signals Count: Graph-Aware Large Language Models for Sequential Recommendation

Fenglin Yan, Bohao Wang, Jian Zhang, Yu Cui, Tongya Zheng, Ye Feng, Can Wang, Jiawei Chen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large language models (LLMs) have been widely adopted as backbones for recommender systems. However, their language-centric pretraining makes it difficult to capture collaborative signals implicit in user-item interactions, which are crucial for personalized recommendation. Existing methods either inject collaborative representations produced by external recommenders or model only intra-sequence dependencies, limiting their ability to exploit global collaborative patterns. To address this limitation, we propose GALLM, a graph-aware LLM framework for sequential recommendation. GALLM constructs a collaborative graph over text tokens and item tokens, and models three types of relations: Text–Text relations for preserving semantic dependencies, Item–Text relations for aligning item tokens with their textual descriptions, and Item–Item relations derived from global item co-occurrence patterns. These relations are transformed into lightweight learnable attention biases and incorporated into the LLM attention mechanism, enabling collaborative-aware token interactions without introducing an additional graph encoder. Experiments on four real-world benchmarks show that GALLM achieves the best performance among the compared baselines, improving over the strongest baseline by 9.76% on average in HR@5. The code is available at https://github.com/Fenglin-miku/GALLM.

1Zhejiang University, Hangzhou, China

2University of Science and Technology of China, Anhui, China

{fenglin.yan, bohao.wang, cuiyu23, wcan, sleepyhunt}@zju.edu.cn

{zhangjian833, yefengustc}@mail.ustc.edu.cn, doujiang_zheng@163.com

Introduction

Recommender systems (RS) aim to infer users’ preferences from their historical interactions. A key to effective recommendation lies in capturing collaborative filtering (CF) signals from user–item interactions (Chen et al. 2020). Different approaches exploit such signals from distinct perspectives: sequential recommenders capture temporal dependencies among items in chronologically ordered interaction sequences to model users’ evolving preferences (Wang et al. 2019a; Yu et al. 2019; Vaswani et al. 2017), whereas graph-based recommenders propagate information over interaction graphs to capture global collaborative signals (He et al. 2020; Wang et al. 2019b).

In recent years, Large Language Models (LLMs) have demonstrated remarkable capabilities in semantic understanding, knowledge utilization, and reasoning (Achiam et al. 2023; Hao et al. 2026b), motivating their increasing adoption in recommendation tasks (Bao et al. 2023; Liao et al. 2024; Xu et al. 2025). A prominent line of research employs LLM as the backbone of RS (Zhang et al. 2025; Kim et al. 2025; Zhang et al. 2024; Wang et al. 2026a), typically converting users’ interactions into natural language prompts and instructing the LLM to predict future interactions. By modeling fine-grained dependencies at the token level, LLMs can leverage semantic information to understand users’ interests, representing a promising direction for advancing RS (Hao et al. 2026a).

(a) LLaRA

(b) HeLLM

Figure 1: Attribution scores of Text tokens and CF tokens in LLaRA (Liao et al. 2024) and HeLLM (Guo et al. 2025). Higher scores indicate a greater influence on the generation of the target item.

Figure

Figure 2: Overview of GALLM. Given a user’s historical interactions, we construct a collaborative graph containing Text–Text, Item–Text, and Item–Item relations. The graph structures are encoded as attention biases and incorporated into the LLM to enhance collaborative-aware recommendation.

Figure

Figure 3: Illustration of the collaborative graph in GALLM, including Item–Item, Text–Text, and Item–Text relations.

Despite this promise, LLM-based RS remain limited in their capacity to model CF signals. This challenge arises from a mismatch between the token-level semantic dependencies modeled by LLMs and the item-level behavioral dependencies underlying CF signals. Recent studies have therefore explored enhancing CF modeling in LLM-based RS, broadly following two directions:

  • Collaborative Injection via External Recommendation Models. These methods employ auxiliary traditional recommendation models (e.g., SASRec (Kang and McAuley 2018)) to capture CF signals, which are subsequently incorporated into LLMs through collaborative embeddings (Liao et al. 2024), predictive distributions (Lin et al. 2026), or model parameters (Liu et al. 2025). However, their effectiveness is inherently limited by the capacity of the external models. Moreover, effectively integrating the extracted CF signals into LLMs remains challenging. A prevalent approach is to directly inject collaborative embeddings into the input of LLMs. However, such an approach often suffers from a misalignment between collaborative and textual representation spaces, making it difficult for LLMs to fully exploit the injected signals. Our empirical analysis in Figure 1 further shows that collaborative embeddings contribute only marginally to model predictions and exert substantially less influence than textual tokens.
  • Collaborative Modeling via Attention Masking. Some studies introduce specialized attention-masking mechanisms to enhance item-level dependency modeling within LLMs (Cui et al. 2025; Zhang et al. 2026). Although these methods improve the modeling of sequential relationships among items, they primarily capture intra-sequence dependencies while overlooking crucial global collaborative dependencies across sequences.

These limitations motivate an important question: How can LLMs effectively capture collaborative signals?

Graph-based methods provide a natural framework for modeling CF signals by organizing user–item interactions into a global interaction structure. Such graph structures expose collaborative information beyond individual interaction sequences and have been widely demonstrated to be effective in traditional recommendation systems (He et al. 2020; Wang et al. 2019b; Kang and McAuley 2018). This naturally raises a question: can such graph structures be directly integrated into LLMs, enabling them to capture collaborative signals in a manner similar to traditional graph-based recommenders?

In this paper, we propose Graph-Aware LLM-based Recommendation (GALLM), as illustrated in Figure 2. Following prior work (Liao et al. 2024), we represent each item using both textual tokens and a dedicated item token. GALLM further introduces explicit attention biases in Transformer layers to model the heterogeneous dependencies among different types of tokens. Specifically, we organize the resulting hybrid prompt as a token-level collaborative graph comprising three types of relations, as illustrated in Figure 3: (1) Item–Item relations, which are derived from global item co-occurrence patterns to encode collaborative dependencies among items; (2) Item–Text relations, which connect each item token to its associated textual tokens, thereby enhancing the model’s ability to learn item-wise representations from the corresponding semantic context; and (3) Text–Text relations, which preserve the semantic dependencies among textual tokens.

Despite its simplicity, this design enables each Transformer layer to perform relation-aware token interactions over the collaborative graph. Through successive layers, the entire model can be treated as a base LLM equipped with an implicit multi-layer attention-based graph aggregation mechanism, allowing GALLM to jointly model semantic and collaborative signals without introducing an external graph encoder. Moreover, GALLM introduces only a small number of trainable parameters with no structural modifications to the LLM backbone, making it efficient and compatible with existing LLM architectures. Extensive experiments on four public benchmarks demonstrate that GALLM consistently outperforms state-of-the-art methods, achieving an average improvement of 7.62% on NDCG@5 across all datasets.

The contributions of this work are summarized as follows:

  • We identify the limitations of existing approaches to enhance CF modeling in LLM-based RS propose integrating graph information into LLMs to address these limitations.
  • We propose GALLM, a graph-aware LLM framework with lightweight learnable attention biases that enables joint modeling of semantic and global collaborative information within a unified LLM.
  • We conduct extensive experiments on four public benchmarks, demonstrating that GALLM consistently outperforms state-of-the-art methods with an average improvement of 9.76% on HR@5.

References (36)