Recommender systems based on Large Language Models (LLMs) are often plagued by hallucinations of out-of-domain (OOD) items. To address this, we propose RecLM, a unified framework that bridges the gap between retrieval and generation by instantiating three grounding paradigms under a single architecture: embedding-based retrieval, constrained generation over rewritten item titles, and discrete item-tokenizer generation. Using the same backbone LLM and prompts, we systematically compare these three views on public benchmarks. RecLM strictly eradicates OOD recommendations (OOD@10 = 0) across all variants, and the constrained generation variants RecLM-cgen and RecLM-token achieve overall state-of-the-art accuracy compared to both strong ID-based and LLM-based baselines. Our unified view provides a systematic basis for comparing three distinct paradigms to reduce item hallucinations, offering a practical framework to facilitate the application of LLMs to recommendation tasks. Source code is at https://github.com/microsoft/RecAI.
翻译:基于大语言模型(LLM)的推荐系统常受域外(OOD)项目幻觉的困扰。为解决此问题,我们提出了RecLM,一个统一的框架,通过在单一架构下实例化三种基础范式来弥合检索与生成之间的差距:基于嵌入的检索、基于重写项目标题的约束生成以及离散项目分词器生成。使用相同的主干LLM和提示,我们在公共基准上系统比较了这三种视角。RecLM在所有变体中严格消除了OOD推荐(OOD@10 = 0),且约束生成变体RecLM-cgen和RecLM-token相较于强大的基于ID和基于LLM的基线,实现了整体最先进的准确率。我们的统一视角为比较三种不同的减少项目幻觉范式提供了系统基础,为促进LLM在推荐任务中的应用提供了一个实用框架。源代码位于https://github.com/microsoft/RecAI。