AgentCF: Collaborative Learning with Autonomous Language Agents for Recommender Systems

Junjie Zhang, Yupeng Hou, Ruobing Xie, Wenqi Sun, Julian J. McAuley, Wayne Xin Zhao, Leyu Lin, Ji-Rong Wen · OpenReview

Abstract

Traditional recommender systems rely on gradient-based optimization to model user-item interactions, often failing to capture the rich semantic nuances of human behavior. Conversely, Large Language Models (LLMs) excel at language but struggle with non-verbal behavioral patterns. This paper introduces AgentCF, a framework that simulates recommender systems using autonomous LLM agents for both users and items. By employing "collaborative reflection" in natural language, AgentCF bridges the gap between universal language modeling and personalized behavior modeling, enabling emergent social behaviors and superior performance in data-sparse scenarios.

Introduction

While Large Language Models (LLMs) are excellent at simulating human dialogue, they often struggle to model non-verbal behaviors, such as clicking or purchasing items in a recommender system. This creates a significant "gap" between universal language modeling and personalized behavior modeling. For instance, an LLM might not intuitively understand why a shopper buying diapers on a Friday is also likely to buy beer—a classic behavioral correlation that traditional collaborative filtering (CF) models capture easily but which lacks a direct semantic link.

Furthermore, existing simulators typically focus only on the user side, treating items as static data. This ignores the two-sided nature of real-world interactions where item characteristics are shaped by the preferences of their adopters.

The AgentCF Framework

The authors propose AgentCF, which introduces two key innovations to bridge the gap between LLMs and recommendation logic: two-sided autonomous agents and collaborative learning via reflection.

Two-Sided Autonomous Agents

Both users and items are represented as agents with their own memory modules. User agents store evolving preferences, while item agents maintain a "profile" of their typical adopters. This allows items to be active participants in the recommendation ecosystem rather than passive data points.

Collaborative Learning via Reflection

Instead of using backpropagation to update weights, AgentCF uses a two-step optimization process:

  1. Autonomous Interaction (Forward Pass): A user agent is presented with a pair of items (one they actually bought in the real world and one "hard" negative distracter) and asked to choose one.
  2. Collaborative Reflection (Backward Pass): If the agent makes the wrong choice, both the user and item agents are prompted to "reflect" on the disparity. They update their natural language memories to better align with real-world behavior. This acts as a "semantic gradient," steering the agents toward more accurate simulations.

Experimental Evaluation

The researchers evaluated AgentCF using two text-intensive subsets of the Amazon review dataset: CDs and Vinyl, and Office Products. They compared AgentCF against traditional models like BPR and SASRec, as well as zero-shot LLM rankers, across both "Sparse" and "Dense" subsets.

Key Insights and Results

  • Superior Performance on Small Data: AgentCF outperformed traditional models (BPR, SASRec) when those models were trained on the same small-scale sampled datasets, demonstrating the efficiency of LLM-based reasoning.
  • Mitigating LLM Biases: Standard LLMs are highly susceptible to popularity and position biases. The collaborative reflection process forces agents to move beyond these heuristics. In "hard" selection tasks, optimized AgentCF agents achieved over 95% accuracy in aligning with real-world user choices.
  • Preference Propagation: By turning items into agents, the system allows item profiles to "learn" from the users who interact with them. When a user interacts with an item, their preference is "injected" into the item's memory, which then informs the next user who considers that item.
  • Cold-Start Mitigation: Item-item interaction simulations showed that new items could "warm up" by interacting with similar, well-trained item agents, significantly improving their recommendation ranking.

Discussion and Future Work

While promising, AgentCF faces challenges regarding scalability and cost due to the high volume of LLM API calls required. Future work will explore memory compression or summarization techniques to maintain efficiency as agent histories grow. The authors view AgentCF as a first step toward "intellectual agent ecosystems" where even inanimate objects have autonomy and can contribute to collective intelligence.

Summary updated

BibTeX
@inproceedings{zhang2023agentcf,
  author = {Junjie Zhang and Yupeng Hou and Ruobing Xie and Wenqi Sun and Julian J. McAuley and Wayne Xin Zhao and Leyu Lin and Ji-Rong Wen},
  title = {{AgentCF: Collaborative Learning with Autonomous Language Agents for Recommender Systems}},
  booktitle = {The Web Conference},
  year = {2023},
  url = {https://openreview.net/forum?id=KXd8wwHas8},
}
Figure