Introduction
Session-based recommendation (SR) aims to predict a user's next interaction based on their current, short-term activity. While critical for e-commerce and streaming, current Intent-aware Session Recommendation (ISR) models face significant hurdles. They are often rigid, assuming a fixed number of user intents, and opaque, operating within mathematical "latent spaces" that offer no human-readable explanation for their predictions.
This research introduces PO4ISR (Prompt Optimization for ISR), a framework that leverages Large Language Models (LLMs) to reason about user sessions in natural language. This approach allows for flexible intent discovery and provides transparent, semantic explanations for every recommendation.
The PO4ISR Framework
The PO4ISR framework moves beyond simple prompting by implementing an automated, self-reflecting optimization loop. It consists of three primary modules designed to refine the LLM's reasoning process without human intervention.
- Prompt Initialization (PromptInit): Employs a "planning strategy" that decomposes the recommendation task into four subtasks: item combination discovery, intent inference, representative intent selection, and candidate reranking.
- Prompt Optimization (PromptOpt): The system identifies "error cases" where the LLM failed to rank the ground-truth item highly. It then prompts the LLM to self-reflect on these failures, generating reasons that are used to automatically rewrite and augment the instructions.
- Prompt Selection (PromptSel): To manage the computational cost of testing multiple prompt variations, a UCB (Upper Confidence Bound) Bandit algorithm is used to efficiently identify and deploy the most effective prompts.
Experimental Evaluation
The framework was evaluated across three diverse real-world datasets: MovieLen-1M (ML-1M), Amazon Games, and Bundle (a multi-category dataset with human-annotated intents).
As shown in the results, PO4ISR achieved a massive performance leap over traditional state-of-the-art baselines like NARM and GCE-GNN. On average, the model improved Hit Rate (HR@5) by 57.37% and NDCG@5 by 61.03%.
Key Insights
- Cross-Domain Robustness: A significant finding was the emergence of "super prompts." Prompts optimized on the Games dataset—the sparsest and most challenging—consistently outperformed others even when applied to different domains like movies or bundles. This suggests that prompts designed for difficult data capture more robust reasoning patterns.
- Sample Efficiency: Unlike traditional deep learning models that require thousands of sessions for training, PO4ISR achieved superior results using only 50 training sessions to optimize its prompts.
- Semantic Reasoning: By treating items as semantic entities (e.g., "Russell Athletic Women's Stretch Capri") rather than abstract IDs, the LLM can group items by category, style, or utility, mirroring human logic.
Limitations and Future Directions
Despite its success, PO4ISR faces challenges typical of LLM-based systems. The model occasionally "hallucinates" (approx. 5.5% of cases), failing to follow formatting or including non-existent items. Interestingly, the researchers found that forcing the model into a strict "JSON mode" actually decreased accuracy, suggesting that rigid formatting constraints may stifle the LLM's reasoning capabilities.
Future work will focus on addressing the latency and cost of LLM APIs by distilling the knowledge from these optimized prompts into smaller, specialized local models.
Summary updated