Training with (Swap) Regret Loss in a Single-Layer Self-Attention Model: A Case Study on the Probability Simplex

Chanwoo Park, Asuman E. OzdaglarNeurIPS 2026

TL;DR

Can a Transformer learn classic, mathematically optimal game-playing algorithms from scratch, without ever being shown how those algorithms work? By training minimal self-attention models directly on decision-theoretic "regret," the authors prove that the networks naturally wire themselves to execute iconic online-learning algorithms like smoothed fictitious play and the Blum–Mansour procedure. When deployed in multi-agent games, these simple attention mechanisms steer interactions straight toward game-theoretic equilibria.

What Problem Does This Paper Address?

As we ask Large Language Models (LLMs) to act as autonomous agents—making sequential plans and interacting with other agents—a glaring weakness emerges: off-the-shelf LLMs are terrible at classic online decision-making. Without external scaffolding, they fail to explore effectively and rack up "regret"—the gap between their cumulative reward and what they could have earned with a better strategy in hindsight.

Recent work proposed fixing this by training models directly with a regret loss function. However, the theoretical understanding of how Transformers internalize this loss had a major blind spot. Prior proofs only worked for continuous, unconstrained-style spaces, relying on a mathematical crutch: projecting the model's output into a valid decision after training.

In real games with discrete choices (like rock-paper-scissors), policies live on the probability simplex—meaning probabilities for actions must be non-negative and sum to one. Until now, nobody knew what happens when you force a self-attention layer to optimize regret directly through a Softmax function on the simplex, end-to-end.

Summary of theoretical gaps filled by this paper compared to prior work

Methods

Instead of feeding a model supervised traces of an expert algorithm, the authors feed a single-layer linear self-attention model a history of loss vectors and train it to minimize regret over $T$ rounds. Crucially, the Softmax operator is baked directly into the training loss, forcing the attention weights to respect probability constraints during optimization.

They explore two distinct flavors of regret:

  1. External Regret (Single-Head Attention): Measures how much better the agent could have done by sticking to the single best fixed action in hindsight.
  2. Swap Regret (Multi-Head Fixed-Point Attention): A stricter metric asking: What if, every time I played Action A, I had systematically swapped it for Action B? To tackle this, the authors design a novel differentiable architecture with $d$ attention heads (one for each possible action). Each head outputs a column of a Markov transition matrix via Softmax, and a differentiable Fixed-Point layer (using power iteration) computes the stationary distribution to output the final policy.

Datasets

Because this is a theoretical and mechanistic study of online learning dynamics, no static text or image benchmarks are used. Instead, models are trained and evaluated on synthetic, procedurally generated environments:

  • Gaussian Loss Sequences: Standard i.i.d. Gaussian loss vectors ($\mathcal{N}(0, I)$) for theoretical alignment and unrestricted training tests, alongside biased-Gaussian sequences (where a hidden mean creates an optimal action to be discovered) for deeper 2- and 4-layer Transformers.
  • Weighted Rock–Paper–Scissors: A $3 \times 3$ zero-sum repeated static game (with equilibrium marginal $(3, 2, 1)/6$) providing full-information loss feedback to test multi-agent equilibrium convergence.

Key Insights and Ideas

  • Attention Naturally Discovers Classic Game Theory: At its stationary point, a single-layer Softmax attention model trained on external regret doesn't just approximate a good strategy—its forward pass is exact smoothed fictitious play (entropy-regularized Follow-the-Regularized-Leader), automatically adopting the theoretically optimal $\widetilde{\Theta}(1/\sqrt{T})$ learning rate.
  • Multi-Head Attention as Parallel Regret Minimizers: When trained on the new swap-regret loss, the multi-head fixed-point architecture naturally instantiates the famous Blum–Mansour reduction. Each attention head independently learns to be an external-regret minimizer, while the fixed-point layer stitches their outputs into a swap-robust policy.
  • Loss Functions Dictate Multi-Agent Equilibria: The choice of training loss directly determines social dynamics when agents interact. Single-head external-regret models drive games toward Coarse Correlated Equilibrium (CCE) (no agent wants to unconditionally switch strategies), while multi-head swap-regret models achieve the tighter Correlated Equilibrium (CE) (no agent wants to switch even after seeing their action).
Figure 1: Estimated stationary stepsize k⋆on the probability simplex as a function of (d, T) for the single-head softmax model (left) and the swap-regret architecture (right). Each marker aggregates 50 independent runs with 800 Monte Carlo samples per run; shaded bands indicate ±1 standard deviation.

Key Results

  • Exact FTRL Matching from Random Init: When training an unconstrained 1-layer model from random initialization ($d=3, T=20$), the learned policy nearly mirrors theoretical entropy-FTRL—requiring on average only 2.71% of probability mass (Total Variation distance of $0.0271$) to be moved to match the exact mathematical algorithm.
  • Sublinear Regret in Deeper Models: In 2- and 4-layer causal Softmax Transformers evaluated on biased-Gaussian sequences ($T=20$), normalized regret drops to $0.219$ and $0.216$ respectively, substantially beating uniform play ($0.351$).
Figure 2: Random-initialization regret-loss training at d = 3, T = 20. Left: entropy-FTRL fit to one-layer policies; “pp” denotes percentage points. Right: normalized regret for deeper Transformers on biased-Gaussian sequences. The table reports mean ± sample standard deviation and curves show means with ±1 standard-error bands across three seeds.
  • Convergence to Game Equilibria: In weighted rock–paper–scissors ($T=20$), 1-, 2-, and 4-layer external-regret models slash the maximum CCE-deviation gap down to $0.0832$, $0.0467$, and $0.0653$ (vs. $0.1111$ for uniform play). Meanwhile, the multi-head swap-regret architecture drives the stricter pairwise CE-deviation gap down to $0.0627$—a 43.6% reduction from uniform play, nearly matching the classical Blum–Mansour algorithm ($0.0617$).

Limitations and Future Work

  • Stationary Points vs. Global Convergence: The mathematical proofs guarantee that these classic algorithms exist as stationary points (and restricted local minima) of the loss landscape, rather than proving that gradient descent will globally converge to them from any initialization.
  • Idealized Assumptions: The theoretical proofs rely on 1-layer linear attention, i.i.d. Gaussian training losses,horizon-dependent step sizes, and full-information feedback (where the agent sees the payoffs of all actions after each round, not just the one it picked).
  • Next Steps: Future work aims to extend these guarantees to deeper, non-linear Transformers, handle harder "bandit" feedback (partial observation), and scale regret-based objectives up to post-training pipelines for full-scale LLMs.

Summary updated

Abstract

We revisit the regret loss framework introduced in [Park, 2024], which uses decision-theoretic regret as a direct loss function for training models to make better decisions, through the lens of probability-simplex policies. Our first result shows that a single-layer self-attention model trained with regret loss admits a stationary point whose forward-pass exactly matches \emph{smoothed fictitious play} with the appropriate stepsize that ensures no-regret behavior—i.e., for any given policy input, the model outputs the same update that smoothed fictitious play would produce. In parallel, we also newly introduce a swap-regret loss function, which extends the regret-loss framework beyond external regret and enables models to directly optimize for swap-deviation robustness. We further show that this swap-regret loss admits a stationary point whose forward pass implements the corresponding swap-regret update induced by classical Blum–Mansour no-swap-regret algorithm, with each head implementing an external-regret update via smoothed fictitious play. Together, these results show that regret-trained attention can realize differentiable mechanisms whose deployment induces equilibrium behavior in games: external-regret dynamics lead to coarse correlated equilibrium, while swap-regret dynamics lead to correlated equilibrium. Thus, regret-based objectives steer minimal attention architectures toward online-learning dynamics with game-theoretic guarantees, without supervised traces of those algorithms.
BibTeX
@inproceedings{park2026training,
  author = {Chanwoo Park and Asuman E. Ozdaglar},
  title = {{Training with (Swap) Regret Loss in a Single-Layer Self-Attention Model: A Case Study on the Probability Simplex}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=rZtbSbQ3kW},
}
Figure