WebRec: Enhancing LLM-based Recommendations with Attention-guided RAG from Web
Zihuai Zhao, Yujuan Ding, Wenqi Fan, Qing Li
TL;DR
WebRec tackles the knowledge-gap problem in LLM-based recommender systems by integrating up-to-date web information through a training-free retrieval stage and by addressing noisy web content during generation with an attention-guided MP-Head. The retrieval stage converts recommendation prompts into semantically rich web queries using $s_i = s_i^{\mathrm{attention}} \cdot s_i^{\mathrm{entropy}}$ to select high-signal keywords, which are used to query web sources. The generation stage introduces MP-Head, an extra attention head that performs one-hop message passing over an entity–relation graph built from KV tokens and a learnable task feature $z$, enabling robust modeling of long-distance dependencies in noisy web content with $a_i^{\mathrm{MP}} = \mathrm{CONCAT}(\mathrm{head}_{\mathrm{MP}}(x_i), a_i)$ and $m_i^{(l)}$ updates. Empirical results on four Amazon-domain datasets show WebRec achieving state-of-the-art HR and NDCG across multiple web sources, validating the practicality and effectiveness of attention-guided web retrieval for LLM-based recommendations.
Abstract
Recommender systems play a vital role in alleviating information overload and enriching users' online experience. In the era of large language models (LLMs), LLM-based recommender systems have emerged as a prevalent paradigm for advancing personalized recommendations. Recently, retrieval-augmented generation (RAG) has drawn growing interest to facilitate the recommendation capability of LLMs, incorporating useful information retrieved from external knowledge bases. However, as a rich source of up-to-date information, the web remains under-explored by existing RAG-based recommendations. In particular, unique challenges are posed from two perspectives: one is to generate effective queries for web retrieval, considering the inherent knowledge gap between web search and recommendations; another challenge lies in harnessing online websites that contain substantial noisy content. To tackle these limitations, we propose WebRec, a novel web-based RAG framework, which takes advantage of the reasoning capability of LLMs to interpret recommendation tasks into queries of user preferences that cater to web retrieval. Moreover, given noisy web-retrieved information, where relevant pieces of evidence are scattered far apart, an insightful MP-Head is designed to enhance LLM attentions between distant tokens of relevant information via message passing. Extensive experiments have been conducted to demonstrate the effectiveness of our proposed web-based RAG methods in recommendation scenarios.
