Customizing In-context Learning for Dynamic Interest Adaption in LLM-based Recommendation

Keqin Bao, Ming Yan, Yang Zhang, Jizhi Zhang, Wenjie Wang, Fuli Feng, Xiangnan He

Introduction

Large Language Models (LLMs) have revolutionized recommendation systems by leveraging their vast knowledge and reasoning capabilities. However, a significant hurdle remains: user interests are inherently dynamic, shifting rapidly due to life transitions or changing environments. Retraining these massive models to keep pace with "streaming" user data is computationally prohibitive. This paper presents RecICL, a framework designed to adapt LLMs to evolving user preferences in real-time using In-context Learning (ICL) without updating model parameters.

The Challenge of Shifting Interests

Traditional recommendation models often rely on periodic retraining to capture new trends. In contrast, LLMs are typically fine-tuned on static datasets, making them "stale" as user behaviors evolve. For instance, a user's interests might shift from gaming to childcare upon becoming a father, or from school supplies to professional attire upon graduation.

Illustration of user interest shifts following major life events like becoming a father or graduating.

While LLMs possess an innate ability for ICL—learning from examples provided in the prompt—standard instruction tuning often diminishes this capability. Models tend to rely on their internal weights (representing long-term history) rather than the immediate context provided in the prompt, leading to inaccurate recommendations during periods of rapid interest shift.

The RecICL Framework

To address this, the authors propose RecICL (Recommendation-oriented ICL). The framework ensures that the LLM prioritizes recent user feedback by integrating ICL directly into the tuning process.

The RecICL framework: Data Construction, ICL-based Tuning, and Dynamic Interest Adaption.

The methodology consists of three key stages:

  1. Data Construction: User histories are transformed into natural language instructions. Each sample includes a list of historical interactions and a target item for binary prediction.
  2. ICL-based Tuning: Unlike standard fine-tuning, RecICL trains the model using a prompt that includes $M$ "few-shot" examples of the user's most recent interactions. This explicitly teaches the model to utilize the provided context to infer the user's current "vibe."
  3. Dynamic Interest Adaption: During inference, the model parameters are frozen. The system adapts to shifts by simply updating the few-shot examples in the prompt with the user's latest feedback.

A critical finding is that a recency-based selection strategy for these examples is more effective than semantic similarity, as recent actions provide a stronger signal for the trajectory of interest shifts.

Experimental Evaluation

RecICL was evaluated on five real-world datasets, including Amazon (Books, Movies, CDs, Sports) and the MIND news benchmark. To simulate streaming environments, data was partitioned chronologically.

Key Performance Metrics

The study introduced the Performance Difference Metric (PDM), which quantifies the gap between a frozen model and a theoretical "upper bound" model fully retrained on the latest data. RecICL achieved a remarkably low PDM (e.g., 0.0031 for Amazon Books), indicating it performs nearly as well as a fully updated model without the associated costs.

Results and Insights

  • Accuracy: RecICL significantly outperformed baselines. On Amazon-Books, it achieved an AUC of 0.8401, compared to 0.7005 for TALLRec.
  • Mechanism over Task: The success of RecICL highlights that to leverage ICL at inference, models must be trained in an ICL-aware environment.
  • Efficiency: The most substantial gains were observed when adding just a single recent example to the prompt, demonstrating the power of a single "fresh" signal in pivoting the model's logic.

Conclusion

RecICL provides a scalable solution for maintaining "fresh" LLM-based recommenders. By fine-tuning for the ICL mechanism rather than just the task, the framework allows models to adapt to dynamic user interests through prompt engineering alone. Future work will focus on optimizing inference latency for long prompts and incorporating collaborative signals from other users into the ICL context.

Summary updated

BibTeX
@inproceedings{bao2025customizing,
  author = {Keqin Bao and Ming Yan and Yang Zhang and Jizhi Zhang and Wenjie Wang and Fuli Feng and Xiangnan He},
  title = {{Customizing In-context Learning for Dynamic Interest Adaption in LLM-based Recommendation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure