Adaptive In-Context Learning with Large Language Models for Bundle Generation

Zhu Sun, Kaidong Feng, Jie Yang, Xinghua Qu, Hui Fang, Yew-Soon Ong, Wenyuan Liu

Introduction

Product bundling—the grouping of related items such as a camera, lens, and tripod—is a fundamental strategy in e-commerce. Despite its prevalence, automating the generation of personalized bundles remains a complex challenge. Traditional machine learning approaches often treat bundling as a black-box recommendation task, frequently resulting in item groups that lack a clear, intelligible "theme" or intent.

Examples of product bundles across different categories, illustrating the need for coherent intent.

Current methodologies face two primary hurdles: a lack of explicit intent (the "why" behind a bundle) and the use of static learning examples that may not be relevant to a specific user session. To address these gaps, this paper introduces AICL (Adaptive In-Context Learning), a framework that leverages Large Language Models (LLMs) to simultaneously generate personalized product bundles and infer the underlying user intent.

The AICL Framework

The AICL paradigm utilizes a retrieval-augmented generation approach combined with a novel self-correction and auto-feedback loop. The system effectively "teaches" the LLM how to bundle items by observing and correcting mistakes in similar historical sessions. The framework is composed of three main modules:

The AICL framework architecture, featuring Neighbor Session Retrieval and Hierarchical Aggregation.
  1. Neighbor Session Retrieval (NSR): Rather than using random examples, the system employs SentenceTransformers to identify the "top-k" most similar historical user sessions from a training set. This ensures the LLM is provided with demonstrations highly relevant to the current items.
  2. Adaptive Demonstration Generation (ADG): This module acts as the core innovation. Before the final task, the LLM performs bundling on the "neighbor" sessions. It then undergoes Mutual Self-Correction, refining bundles based on inferred intents, and receives Adaptive Auto-Feedback. This feedback compares the LLM's output to ground-truth data, identifying specific error types such as missing or unrelated products.
  3. Demonstration Guided Inference (DGI): Finally, the LLM performs the actual bundling and intent inference for the test session, guided by the tailored demonstrations and the rules summarized from the feedback phase.

Experimental Evaluation

The framework was evaluated using three real-world Amazon datasets (Electronic, Clothing, and Food) curated for intent-aware bundling. These datasets are unique in providing human-annotated "intents" alongside co-purchased items.

AICL consistently outperformed both traditional baselines and state-of-the-art deep learning models. On the Electronic dataset, AICL achieved a Precision of 0.679, significantly higher than the best non-LLM baseline (0.423) and standard few-shot prompting (0.587). Furthermore, human evaluations indicated that AICL-generated intents were often more "motivational" and of higher quality than the original ground-truth annotations.

Conclusion and Future Work

The study reveals that bundle generation and intent inference are mutually reinforcing: a well-defined intent aids in identifying relevant products, while a coherent bundle clarifies the intent. By forcing the LLM to encounter and correct its own errors on similar data, AICL becomes a significantly more reliable tool for e-commerce applications.

However, limitations remain. LLM-based methods currently tend to produce smaller bundles than human-annotated ground truths, and the iterative nature of the framework increases latency and cost. Future research will explore better output constraints to encourage larger bundles and the integration of multi-modal data (such as product images) to improve visual coherence.

Summary updated

BibTeX
@inproceedings{sun2024adaptive,
  author = {Zhu Sun and Kaidong Feng and Jie Yang and Xinghua Qu and Hui Fang and Yew-Soon Ong and Wenyuan Liu},
  title = {{Adaptive In-Context Learning with Large Language Models for Bundle Generation}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2024},
  doi = {10.1145/3626772.3657808},
}
Figure