TL;DR
GARDRec introduces a novel framework that elevates knowledge graphs from mere text prompts to a core decision-level grounding layer for LLM-based recommenders. By aligning structural graph embeddings with the LLM's hidden space and introducing late-stage scoring branches, it successfully preserves temporal preferences, collaborative signals, and candidate competition. This approach yields significant performance gains in next-item ranking tasks, particularly in sparse-data scenarios.
What Problem Does This Paper Address?
Large Language Models (LLMs) have shown immense promise in recommendation systems due to their ability to reason over natural language item descriptions and user histories. To inject structured domain knowledge, current state-of-the-art methods typically rely on Retrieval-Augmented Generation (RAG), converting knowledge graph (KG) triples into textual descriptions and stuffing them into the prompt.
However, this "prompt-level" augmentation suffers from several critical flaws in next-item recommendation tasks:
- Order and Placement Sensitivity: Autoregressive LLMs are notoriously sensitive to prompt formatting and context order.
- Dilution of Numerical Signals: Fine-grained collaborative signals (such as item co-occurrence frequencies, transition statistics, and popularity) get diluted or ignored when forced into long textual sequences.
- Weak Decision Grounding: The LLM implicitly resolves candidate competition through causal self-attention, often leading to recommendations that are semantically plausible but structurally ungrounded.
GARDRec addresses this gap by ensuring that structural graph evidence directly constrains the final ranking decision rather than just enriching the input prompt.
Methods
The GARDRec framework consists of four tightly coupled components:
- Semantic-Structural Graph Embedding: Node features are initialized using a frozen pretrained language model (Sentence-BERT) to capture textual semantics. A two-layer GraphSAGE encoder then propagates these features across the knowledge graph to capture high-order structural connectivity.
- Knowledge-Enhanced Context Integration: The framework extracts a user's dynamic preference by calculating a temporally weighted historical centroid (giving more weight to recent interactions) and retrieving first-order graph neighborhoods of past items. Crucially, precise numerical features (graph similarity, sequential transitions, collaborative co-occurrence, and popularity stats) bypass the text prompt entirely to prevent signal dilution.
- Multimodal Prompt Construction: A learnable non-linear projection network maps the dense graph and context embeddings directly into the LLM's hidden dimension ($d_{LLM}$). These continuous embeddings are combined with soft markers and absolute position encodings before being fed into a frozen LLM backbone (e.g., LLaMA or Qwen).
- Semantic Reasoning & Predictive Scoring: After the LLM processes the prompt, a bidirectional inter-candidate attention layer is applied to model mutual competition among candidates. The final ranking score is a calibrated combination of the LLM's semantic matching score, the explicit late-stage collaborative/graph priors, and a restricted generative likelihood score.
The entire architecture is optimized jointly using a multi-task objective balancing smoothed cross-entropy, Bayesian Personalized Ranking (BPR) loss over hard negatives, and a restricted language-modeling likelihood loss.
Datasets
The authors evaluated GARDRec on three widely used public recommendation benchmarks:
- MovieLens-1M (ML-1M): A dense movie recommendation dataset containing ~1 million ratings.
- MovieLens-20M (ML-20M): A larger scale version of MovieLens with ~20 million interactions.
- Amazon-Book: A highly sparse e-commerce dataset containing user-book interactions and product metadata.
For the movie datasets, items were aligned with TMDB metadata to construct KGs containing attributes like directors, actors, genres, and release years. For Amazon-Book, authors, categories, and publication details formed the graph.
Key Insights and Ideas
- Bypassing the Prompt for Hard Numbers: One of the most effective design choices in GARDRec is separating semantic reasoning from numerical calibration. Keeping exact statistical features (like co-occurrence counts) out of the text prompt and injecting them via late-stage fusion MLPs prevents the LLM from "forgetting" or misinterpreting precise data.
- Bidirectional Candidate Awareness: Standard autoregressive LLMs use causal masking, meaning candidate item $B$ cannot easily be compared against candidate item $A$ during the forward pass. Introducing a bidirectional attention layer specifically for the candidate pool explicitly models inter-candidate competition.
- Graph Structure as an LLM Language: The ablation study proved that simply retrieving text descriptions of graph neighbors (TextRAG) performs poorly (dropping Accuracy from 0.444 to 0.128 on ML-1M). Projecting continuous graph-propagated embeddings into the LLM's token space allows the model to leverage structural topology far better than text serialization can.
Key Results
GARDRec was tested across three LLM backbones (LLaMA2-7B, LLaMA3-8B, and Qwen2-7B) and consistently outperformed competitive baselines (including prompt-based RAG and graph-token methods like K-RagRec and G-Retriever) in 24 out of 27 experimental settings.
- Overall Performance: Relative improvements reached up to 15.2% for Accuracy (ACC), 18.1% for Recall@3, and 21.4% for Recall@5 compared to the strongest non-GARDRec baseline.
- Sparsity Robustness: In diagnostic tests where users had very short histories (1–3 interactions), GARDRec demonstrated its strongest advantages, boosting ACC from 0.3093 (K-RagRec) to 0.3815. This highlights the power of using graph neighborhoods to expand sparse user profiles.
Limitations and Future Work
The primary limitation identified is the model's performance under strict zero-history cold-start conditions. When a user has absolutely no interaction history, GARDRec's history-conditioned graph context integration fails, causing it to underperform compared to simple prompt-level text RAG (which can directly reason over raw item metadata text).
As a result, the authors note that GARDRec is best suited as a reranker for sparse-but-not-empty histories. Future work will focus on developing adaptive fallback strategies for entirely new users and expanding the framework into a complete, end-to-end retrieval and reranking pipeline.
Summary updated