CompeteAI: Understanding the Competition Behaviors in Large Language Model-based Agents

Qinlin Zhao, Jindong Wang, Yixuan Zhang, Yiqiao Jin, Kaijie Zhu, Hao Chen, Xing Xie · DOI

Introduction

While the majority of research regarding Large Language Model (LLM) agents has focused on multi-agent cooperation—exploring how models can collaborate to solve complex tasks—competition remains a fundamental driver of human innovation, economic health, and social structure. Traditional Agent-Based Modeling (ABM) has historically relied on rigid, rule-based logic that often fails to capture the nuanced, adaptive behaviors seen in human markets.

This paper introduces CompeteAI, a framework designed to bridge the gap between AI simulation and established sociological and economic theories. By shifting the lens from cooperation to competition, the researchers investigate how LLM agents behave when resources are finite and success depends on outmaneuvering a rival.

Methodology and Environment Setup

The authors instantiated the CompeteAI framework within a "Virtual Town" simulation. This environment consists of two primary agent types: Restaurant Agents (the competitors) and Customer Agents (the judges).

The CompeteAI framework for studying competition dynamics between LLM agents, illustrating the interaction between competitors and judges within a theoretical context.

Agent Architecture

  • Restaurant Agents: Powered by GPT-4 (version 0613), these agents are responsible for operational decisions, including hiring staff, setting prices, designing menus, and creating advertisements. They maintain a "daybook" that records their own performance and provides critical intelligence on their rival’s offerings and customer feedback.
  • Customer Agents: To ensure a realistic market, the researchers developed a benchmark of 50 customer agents with diverse personas. These include varying income levels, dietary restrictions (e.g., vegan, diabetic), and social structures (individuals, families, or professional colleagues).

The Simulation Loop

The simulation runs over a 15-day period. Each day, restaurants compete for customers who choose where to dine based on advertising and established reputation. After dining, customers provide feedback, creating a closed-loop system that forces restaurant agents to adapt their strategies to survive and thrive.

Key Insights and Results

The simulation revealed that GPT-4 agents naturally evolve sophisticated economic strategies and replicate complex sociological phenomena without explicit instruction.

Emergent Economic Strategies

Agents consistently adopted classic market strategies to gain an edge. Two primary behaviors emerged: Differentiation, where agents created unique signature dishes to stand out, and Imitation, where agents copied successful strategies from their rivals, such as the use of local ingredients. Interestingly, despite constant imitation, the similarity between menus stabilized at approximately 36%, suggesting that LLM agents find a natural equilibrium between following trends and maintaining brand identity.

The Matthew Effect and Market Dominance

The simulation successfully replicated the "Matthew Effect" (the rich-get-richer). A restaurant that secured an early lead gained more feedback, allowing it to iterate and improve quality faster than its competitor. This created a self-reinforcing cycle of dominance, as seen in the customer flow dynamics over time.

Customer flow dynamics between two competing restaurants (R1 and R2) over a 15-day simulation, showing the emergence of a market leader.

Group Dynamics as a Market Leveler

One of the most significant findings was the role of group dining in mitigating "winner-take-all" outcomes. In simulations featuring only individual customers, a single restaurant dominated (80%+ market share) in 66.7% of cases. However, when groups (families or colleagues) were introduced, this dominance dropped to just 16.7%. Groups were more likely to express a collective desire to "try something new," providing struggling restaurants with a vital opportunity to break the cycle of the Matthew Effect.

Competition-Driven Quality

Empirical scoring of dish quality (based on chef skill and ingredient cost) showed that competition directly fosters better products. Over the 15-day period, average dish scores increased significantly for both the leader and the follower as they lowered profit margins and improved quality to remain attractive to the customer base.

Conclusion and Future Work

CompeteAI demonstrates that LLM-based agents can serve as a powerful tool for studying complex social and economic behaviors. While the study was limited by sample size and the text-only nature of the interactions, it opens the door for more expansive simulations. Future research may involve larger numbers of competitors and explore whether LLM agents can move beyond mimicking human theories to develop entirely new, "super-human" competitive strategies.

Summary updated

Abstract

Large language models (LLMs) have been widely used as agents to complete different tasks, such as personal assistance or event planning. While most of the work has focused on cooperation and collaboration between agents, little work explores competition, another important mechanism that promotes the development of society and economy. In this paper, we seek to examine the competition dynamics in LLM-based agents. We first propose a general framework for studying the competition between agents. Then, we implement a practical competitive environment using GPT-4 to simulate a virtual town with two types of agents, restaurant agents and customer agents. Specifically, the restaurant agents compete with each other to attract more customers, where competition encourages them to transform, such as cultivating new operating strategies. Simulation experiments reveal several interesting findings at the micro and macro levels, which align well with existing market and sociological theories. We hope that the framework and environment can be a promising testbed to study competition that fosters understanding of society. Code is available at: https://github.com/microsoft/competeai.
BibTeX
@inproceedings{zhao2024competeai,
  author = {Qinlin Zhao and Jindong Wang and Yixuan Zhang and Yiqiao Jin and Kaijie Zhu and Hao Chen and Xing Xie},
  title = {{CompeteAI: Understanding the Competition Behaviors in Large Language Model-based Agents}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=wGtzp4ZT1n},
}
Figure