Do LLM Agents Have Regret? A Case Study in Online Learning and Games

Chanwoo Park, Xiangyu Liu, Asuman E. Ozdaglar, Kaiqing Zhang

Introduction

As Large Language Models (LLMs) transition from conversational chatbots to autonomous agents, a critical question emerges: can they make robust, rational sequential decisions? In the realm of online learning and game theory, the gold standard for a rational agent is no-regret behavior. This means that as time progresses, the average difference between the agent's performance and the best possible fixed strategy in hindsight should converge to zero.

If LLM agents fail to exhibit this property, they risk failing in strategic environments—such as negotiations or auctions—or being easily exploited by adversarial changes in their surroundings. While LLMs demonstrate "emergent" reasoning capabilities, their quantitative performance in these specific, high-stakes decision-making frameworks has remained largely unmapped. This is especially true in multi-agent scenarios where interactions should ideally lead to stable equilibria. This paper investigates whether LLM agents exhibit no-regret behavior and proposes a novel training method to instill it when they fall short.

Methodology

To rigorously evaluate LLM decision-making, the authors employ a three-pronged approach:

  1. Empirical Benchmarking: The study tests several pre-trained LLMs (including GPT-4, GPT-3.5, Llama-3, and Mixtral) in canonical online learning problems and repeated games. To definitively prove "no-regret" behavior, they introduce two validation frameworks: a Trend-checking framework (a statistical hypothesis test) and a Regression-based framework (fitting log-regret curves).
  2. Theoretical Modeling: The authors hypothesize that LLMs behave similarly to a "Quantal Response" model—a classic framework for human decision-making that accounts for bounded rationality. They demonstrate that if an LLM is pre-trained on data generated by such "rational" humans, it can theoretically inherit no-regret properties, effectively mimicking the classical "Follow-the-Perturbed-Leader" (FTPL) algorithm.
  3. The Regret-Loss: To address edge cases where LLMs fail to learn optimally, the authors introduce a novel unsupervised training objective. Unlike standard cross-entropy loss, which requires knowing the "correct" action labels, the regret-loss minimizes the maximum regret over a variety of simulated loss sequences.

These methods are evaluated across synthetic but strategically complex environments. For online learning, the models face randomly generated loss sequences (Uniform and Gaussian) as well as non-stationary environments with Linear and Periodic (Sine) trends. For repeated games, they are tested on representative 2x2 games (e.g., Prisoner’s Dilemma) and randomly generated multi-player general-sum games.

Key Insights and Results

The empirical evaluations reveal surprising strengths and specific vulnerabilities in modern LLMs.

  • Sublinear Success in Standard Environments: In most standard environments, advanced models like GPT-4 and Llama-3-70B successfully achieve sublinear regret. In many cases, they even outperform classical baselines like Follow-The-Regularized-Leader (FTRL) and FTPL.
  • Equilibrium Emergence: When multiple LLM agents play against each other in repeated games, their collective behavior often naturally converges toward a coarse correlated equilibrium.
  • LLMs as "Accidental" Rationalists: The authors suggest that LLMs do not simply "happen" to be good at games. By training on vast amounts of human-generated text, they likely internalize the "Quantal Response" patterns of human decision-makers, which are mathematically linked to no-regret learning.
Regret performance of various LLMs across Uniform, Gaussian, Linear-trend, and Sine-trend environments.

Despite these successes, the paper identifies a notable GPT-4 Failure Mode. In simple but highly adaptive environments—where the environment intentionally reacts to the agent's previous choices—GPT-4 fails to achieve no-regret behavior. Its regret grows linearly as it gets stuck in exploitable loops.

To counter this, the proposed regret-loss proves highly effective. Models trained with this new unsupervised loss successfully achieved sublinear regret even in the "regrettable" adversarial cases where GPT-4 failed. Furthermore, the paper proves theoretically that a single-layer Transformer trained with this loss can automatically recover classical, mathematically optimal algorithms like FTRL.

Limitations and Future Work

While promising, the study highlights several challenges for scaling these findings:

  • Computational Cost: The current interaction protocol requires feeding the entire history of losses back into the prompt. This scales quadratically in cost and eventually hits context window limits.
  • Action Space: Most experiments were limited to small action spaces (e.g., $d=2$). Scaling the regret-loss to high-dimensional action spaces remains an open challenge.
  • Prompt Sensitivity: LLM performance is notoriously sensitive to how history is presented (e.g., raw history versus summarized averages), requiring careful prompt engineering.

Looking forward, the authors suggest exploring how this regret-loss could be integrated into Reinforcement Learning from Human Feedback (RLHF) pipelines. Doing so could pave the way for creating fundamentally more robust and rational autonomous agents.

Summary updated

BibTeX
@inproceedings{park2025do,
  author = {Chanwoo Park and Xiangyu Liu and Asuman E. Ozdaglar and Kaiqing Zhang},
  title = {{Do LLM Agents Have Regret? A Case Study in Online Learning and Games}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=qn9tBYQHGi},
}
Figure