Logit Space Constrained Fine-Tuning for Mitigating Hallucinations in LLM-Based Recommender Systems

Jie Deng, Qingfeng Chen, Debo Cheng, Jiuyong Li, Lin Liu2025 · DOI

Abstract

Large language models (LLMs) have gained increasing attention in recommender systems, but their inherent hallucination issues significantly compromise the accuracy and reliability of recommendation results. Existing LLM-based recommender systems predominantly rely on standard fine-tuning methodologies, often ignoring hallucination issues during the fine-tuning process. To address this challenge, we propose Logit Space Constraints Fine-Tuning (LCFT), a novel fine-tuning framework designed to mitigate hallucination in LLM-based recommenders. Specifically, LCFT takes as input semantically positive and negative instruction pairs and incorporates Kullback-Leibler (KL) divergence into the training objective to explicitly maximise their distributional disparity in the logit space. By conducting such logit space-constrained fine-tuning, LCFT encourages more distinguishable and semantically grounded representations, thereby reducing the model's susceptibility to hallucination. Extensive experiments on two recommendation models with distinct LLM backbones and four real-world datasets demonstrate that LCFT consistently reduces hallucination and enhances recommendation performance.

Introduction

While Large Language Models (LLMs) excel at contextual understanding, they frequently suffer from "hallucinations" in recommendation settings. In this domain, hallucination manifests as a lack of semantic groundedness and logical inconsistency. For instance, a standard fine-tuned LLM might answer "Yes" when asked both "Will the user like this movie?" and "Will the user dislike this movie?" This suggests the model is merely pattern-matching rather than reasoning about user preferences. Traditional fine-tuning focuses on next-token prediction, failing to ensure internal logical coherence when faced with contradictory inputs.

The LCFT Framework

To solve this, we introduce Logit Space Constrained Fine-Tuning (LCFT). This framework moves beyond simple supervised fine-tuning by introducing a distributional constraint.

The LCFT framework uses contrastive prompts and KL divergence to maximize logit disparity.

As shown in the architecture above, the method consists of three primary stages:

  1. Contrastive Prompt Construction: Every training sample is paired with a "positive" instruction (e.g., "Will the user click?") and a "negative" instruction (e.g., "Will the user not click?").
  2. Logit Space Constraints: The model utilizes LoRA (Low-Rank Adaptation) for efficiency. The training objective is modified to include a Kullback–Leibler (KL) divergence term alongside standard cross-entropy loss.
  3. Maximizing Distributional Disparity: The objective function explicitly maximizes the KL divergence between the logit distributions of the positive and negative prompt pairs. By pushing these distributions apart in the logit space, the model learns representations where "like" and "dislike" are semantically distinct, preventing the model from collapsing into inconsistent "Yes/Yes" or "No/No" predictions.

Experimental Evaluation

We evaluated LCFT across four major recommendation benchmarks: MovieLens-100K, BookCrossing, ML-1M, and Amazon-Book. The framework was tested using LLaMA-7B and Vicuna-7B as backbones. A key focus was the model's performance in few-shot scenarios, where training data is extremely limited (as few as 16 samples).

Performance comparison of LCFT-TALLRec against baselines in few-shot settings.

Key Results and Discussion

Our experiments yielded several critical insights:

  • Superior Accuracy in Data-Scarce Environments: As seen in the table above, LCFT-TALLRec significantly outperforms standard TALLRec. In a 16-shot setting on the movie dataset, LCFT achieved an AUC of 0.7013, a substantial improvement over the baseline's 0.6724.
  • Improved Logical Consistency: Case studies confirmed that LCFT effectively mitigates the "double-yes" or "double-no" hallucination problem. By forcing semantic inversion as a regularizer, the model is compelled to attend to the specific intent of the instruction.
  • Generalizability: The relative improvement (Rel. Imp.) was consistent across both movie and book domains, indicating that the logit-space constraint is a robust mechanism for grounding LLM reasoning.

Conclusion

LCFT addresses a fundamental weakness in LLM-based recommenders by redefining hallucination as logical inconsistency and solving it in the logit space. By maximizing the mathematical distance between opposite semantic poles, we create models that are not only more accurate but also more reliable. Future work will explore integrating causal inference to further distinguish between simple correlation and true user preference.

Summary updated

Abstract

Large language models (LLMs) have gained increasing attention in recommender systems, but their inherent hallucination issues significantly compromise the accuracy and reliability of recommendation results.Existing LLM-based recommender systems predominantly rely on standard fine-tuning methodologies, often ignoring hallucination issues during the fine-tuning process.To address this challenge, we propose Logit Space Constraints Fine-Tuning (LCFT), a novel fine-tuning framework designed to mitigate hallucination in LLM-based recommenders.Specifically, LCFT takes as input semantically positive and negative instruction pairs and incorporates Kullback-Leibler (KL) divergence into the training objective to explicitly maximise their distributional disparity in the logit space.By conducting such logit space-constrained fine-tuning, LCFT encourages more distinguishable and semantically grounded representations, thereby reducing the model's susceptibility to hallucination.Extensive experiments on two recommendation models with distinct LLM backbones and four realworld datasets demonstrate that LCFT consistently reduces hallucination and enhances recommendation performance.Our source code is available at:
BibTeX
@misc{deng2025logit,
  author = {Jie Deng and Qingfeng Chen and Debo Cheng and Jiuyong Li and Lin Liu},
  title = {{Logit Space Constrained Fine-Tuning for Mitigating Hallucinations in LLM-Based Recommender Systems}},
  year = {2025},
  doi = {10.18653/v1/2025.emnlp-main.1491},
}
Figure