[Paper Review] LLM-Enhanced User-Item Interactions: Leveraging Edge Information for Optimized Recommendations
The paper proposes a graph-attentive GPT-2-based recommender that injects first- and second-order graph edge information into attention via specialized prompts and pre-training/fine-tuning, yielding improved recommendations on multiple Amazon datasets.
Graph recommendation methods, representing a connected interaction perspective, reformulate user-item interactions as graphs to leverage graph structure and topology to recommend and have proved practical effectiveness at scale. Large language models, representing a textual generative perspective, excel at modeling user languages, understanding behavioral contexts, capturing user-item semantic relationships, analyzing textual sentiments, and generating coherent and contextually relevant texts as recommendations. However, there is a gap between the connected graph perspective and the text generation perspective as the task formulations are different. A research question arises: how can we effectively integrate the two perspectives for more personalized recsys? To fill this gap, we propose to incorporate graph-edge information into LLMs via prompt and attention innovations. We reformulate recommendations as a probabilistic generative problem using prompts. We develop a framework to incorporate graph edge information from the prompt and attention mechanisms for graph-structured LLM recommendations. We develop a new prompt design that brings in both first-order and second-order graph relationships; we devise an improved LLM attention mechanism to embed direct the spatial and connectivity information of edges. Our evaluation of real-world datasets demonstrates the framework's ability to understand connectivity information in graph data and to improve the relevance and quality of recommendation results.
Motivation & Objective
- Motivate integrating large language models (LLMs) with graph-structured data for recommendations, leveraging edge information to capture complex user-item relationships.
- Develop a graph-attentive LLM backbone that incorporates first-order and second-order graph connectivity into attention mechanisms.
- Design crowd-contextual prompts for pre-training and personalized predictive prompts for fine-tuning to optimize recommendation quality.
Proposed method
- Use GPT-2 as the base LLM and embed graph edge knowledge into the attention mechanism via an edge-encoded term R in the attention computation.
- Represent direct (first-order) and indirect (second-order) graph connectivity as R = R^conn + R^path, with R^conn as an adjacency-like term and R^path derived from normalized shortest-path scores.
- Pre-train the graph-attentive LLM on crowd-contextual prompts that include user/item tokens, item attributes, and user-item interaction events to maximize token-generation likelihood.
- Fine-tune with personalized predictive prompts that convert user history into past-tense prompts with future-tense triggers to optimize recommendation accuracy.
- Deploy in production by using prompts to generate recommendation scores for user-item pairs, with offline batch and online caching for latency management.
- Evaluate with Recall@20, Recall@40, and NDCG@100 on seven Amazon datasets; ablation studies test pretraining, fine-tuning, GKIA (graph knowledge into attention), and GHIP (graph/history prompts).

Experimental results
Research questions
- RQ1Can the graph-attentive LLM framework improve recommendation accuracy over baselines on real-world datasets?
- RQ2What is the contribution of first-order vs second-order graph connectivity to recommendation performance?
- RQ3How do pre-training, fine-tuning, and graph-augmented attention components affect results?
- RQ4Does incorporating item background information and second-order relationships enhance recommendations?
- RQ5How effective are different prompt structures and attention injection methods for graph-informed LLM recommendations?
Key findings
- The proposed graph-attentive LLM achieves higher Recall@20, Recall@40, and NDCG@100 than baselines across seven Amazon datasets.
- Ablation shows pre-training and fine-tuning substantially impact performance, validating the learning pipeline.
- Incorporating graph edge information via the GKIA attention mechanism and using second-order relationships improves results.
- Prompts that include second-order item relationships and item background information yield the best performance, outperforming models lacking these components.
- Different attention-injection methods demonstrate the importance of embedding edge-knowledge into the LLM’s attention dynamics.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.