Does LLM Focus on the Right Words? Mitigating Context Bias in LLM-based Recommenders

Bohao Wang, Jiawei Chen, Feng Liu, Changwang Zhang, Jun Wang, Canghong Jin, Chun Chen, Can Wang

TL;DR

Supervised fine-tuning (SFT) often causes Large Language Models (LLMs) to develop "Context Bias," where they over-rely on task prompts (e.g., "Please recommend...") rather than actual user history. This paper introduces GDRT (Group Distributionally Robust Optimization-based Tuning), a method that forces LLMs to perform consistently across all items regardless of their textual similarity to the prompt, shifting the model's focus back to informative user interaction signals.

What Problem Does This Paper Address?

Integrating LLMs into recommender systems usually involves treating recommendation as a language generation task: you feed the model a prompt containing a task description and a list of items a user has interacted with, and the model predicts the next item. To make this work well, researchers use Supervised Fine-Tuning (SFT).

However, the authors discovered a critical flaw: SFT induces a Context Bias. Instead of learning deep user preferences, the model learns "shortcuts." It starts over-relying on auxiliary tokens—the static parts of the prompt like "The user has watched:" or the prefix tokens of the predicted item—while underutilizing the actual user interaction tokens.

Figure 1: Illustration of LLM-based recommendations and context bias, wherein the model exhibits an over-reliance on auxiliary tokens (i.e., Task description, Prefix tokens) and insufficient utilization of User interaction during generation.

This leads to two major issues:

  1. Reduced Accuracy: The model ignores the nuanced behavioral signals that actually define a user's interest.
  2. Unfairness: The model becomes skewed toward recommending items that are semantically similar to the prompt's language, creating a "filter bubble" based on the prompt's phrasing rather than the user's taste.

Methods

The authors propose GDRT, a fine-tuning paradigm based on Group Distributionally Robust Optimization (Group DRO). The core idea is to ensure the model performs well even when the "shortcut" (the auxiliary tokens) isn't helpful.

  1. Token Grouping: The researchers first quantify how much a target token relies on auxiliary cues. They do this by masking the user history and seeing how well the model can still predict the target. They then use K-means clustering to partition tokens into $G$ groups based on this "relevance to auxiliary tokens" score.
  2. Adversarial Reweighting: During training, GDRT doesn't just minimize average loss. It uses an adversarial mechanism to identify groups where the model is performing poorly—typically those that have low correlation with the auxiliary tokens.
  3. Robust Optimization: By adaptively upweighting these "hard" groups, the model is forced to stop relying on prompt shortcuts and start paying attention to the user interaction tokens to minimize the loss.

Crucially, the authors provide a closed-form solution for this optimization, meaning GDRT adds negligible computational overhead compared to standard SFT.

Datasets

The authors evaluated their method on three widely used real-world datasets from the Amazon ecosystem:

  • Amazon Toys and Games
  • Amazon Clothing, Shoes and Jewelry
  • Amazon Books

They used a standard "5-core" filtering (keeping users and items with at least five interactions) and a sliding window approach to generate sequential recommendation samples.

Key Insights and Ideas

  • The SFT Trap: Feature Ablation Attribution (FAA) analysis revealed that while a pre-trained LLM treats prompt cues and user history with roughly equal importance, SFT shifts that ratio to over 6:1 in favor of the prompt cues.
  • Shortcut Learning as a Fairness Issue: The bias isn't just an error; it's a systematic skew. As shown in Figure 3, in the "Book" dataset, over 80% of SFT recommendations fell into the group most relevant to auxiliary tokens, even though that group only represented 20% of the test set.
  • Token-Level Granularity: Unlike previous methods that look at entire items, GDRT operates at the token level. This is vital because different words within a single item title might have different levels of "shortcut" potential.
  • Seamless Integration: Because GDRT is a loss function modification, it can be plugged into existing LLM-based recommendation architectures (like LLaRA or A-LLM) without changing their underlying structure.
Figure 2: Ratio of attribution values between auxiliary tokens and user interaction tokens before and after SFT. Left: task description vs. user interaction tokens. Right: prefix tokens of predicted item (take the first token) vs. user interaction tokens.

Key Results

  • Accuracy Boost: GDRT achieved an average improvement of 24.29% in NDCG@10 across the tested datasets compared to the best baselines.
  • Fairness Gains: The method significantly reduced exposure unfairness, with an average 37.43% reduction in MGU@5 (a metric for group-level discrepancy).
  • Efficiency: Training time for GDRT is nearly identical to standard SFT, making it much more efficient than counterfactual-based debiasing methods (like CFT), which can double training time.
  • Robustness: The improvements held steady across different LLM backbones (LLaMA 3, Qwen 2.5) and various prompt templates.

Limitations and Future Work

While GDRT effectively tackles context bias, the authors note that LLM-based recommenders may still harbor other, yet-unidentified biases unique to the intersection of natural language and collaborative filtering. The current work focuses on sequential recommendation; extending this robust optimization framework to other recommendation tasks (like cross-domain or multi-modal recommendation) remains an open area for exploration. Additionally, the choice of the hyperparameter $\tau$ (which controls the strength of the robust optimization) requires some tuning to avoid overfitting on the "hardest" groups.

Summary updated

BibTeX
@misc{wang2025does,
  author = {Bohao Wang and Jiawei Chen and Feng Liu and Changwang Zhang and Jun Wang and Canghong Jin and Chun Chen and Can Wang},
  title = {{Does LLM Focus on the Right Words? Mitigating Context Bias in LLM-based Recommenders}},
  year = {2025},
  eprint = {2510.10978},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.10978},
}
Figure