NfgTransformer: Equivariant Representation Learning for Normal-form Games

Siqi Liu, Luke Marris, Georgios Piliouras, Ian Gemp, Nicolas Heess

1. Introduction

Normal-form games (NFGs) serve as the fundamental mathematical framework for modeling strategic interactions across economics, biology, and computer science. While deep learning has revolutionized many fields, representing NFGs in a way that captures their intrinsic symmetries remains a significant challenge. Traditional approaches often rely on hand-engineered features or non-differentiable solvers that lack the flexibility and scalability of modern neural architectures.

In "NfgTransformer: Equivariant Representation Learning for Normal-form Games" (ICLR 2024), researchers from Google DeepMind and UCL present a novel architecture designed to learn rich, latent representations of games by leveraging permutation equivariance. This model treats game payoffs not as a simple block of numbers, but as a structured set of relationships.

2. The Challenge: Permutation Equivariance

A core property of game theory is that the strategic essence of a game is invariant to the ordering of players or their strategies. If the labels of "Player 1" and "Player 2" are swapped, the game's Nash Equilibrium and payoff structure remain functionally identical. This property is known as permutation equivariance.

Standard neural networks, such as Multi-Layer Perceptrons (MLPs), are inherently "order-aware." Shuffling the input payoff tensor results in a different output, forcing the model to learn the same strategic patterns multiple times for different permutations. The NfgTransformer addresses this by treating the game as a structured set of action embeddings where symmetry is baked into the architecture design.

3. The NfgTransformer Architecture

The NfgTransformer represents a game as a collection of action embeddings. Rather than processing the entire payoff matrix as a single block, the model utilizes a sequence of Transformer blocks to iteratively refine embeddings for every individual action available to every player.

3.1 Iterative Refinement Mechanism

Each block in the NfgTransformer performs three primary operations to build a strategic understanding of the game:

  1. Action-to-Joint-Action: The model examines how a specific action performs across the full distribution of possible opponent moves.
  2. Action-to-Play: Information from these joint actions is aggregated back into the individual action’s embedding, capturing its utility and strategic value.
  3. Action-to-Action: This stage allows actions to interact directly, enabling the model to propagate information regarding strategic relationships, such as dominance or substitution.

3.2 Task-Specific Decoders and Masking

Once the embeddings are refined, the model employs small MLP "heads" to perform downstream tasks. These include estimating Nash Equilibria or predicting missing payoffs. Furthermore, the architecture utilizes binary masks in its attention mechanism. This allows the NfgTransformer to handle incomplete games by effectively "filling in" missing strategic data through learned context.

4. Experimental Evaluation

The researchers evaluated the NfgTransformer across several rigorous benchmarks to test its versatility:

  • Synthetic Games: Games sampled from equilibrium-invariant subspaces to ensure broad strategic coverage.
  • DISC Games: Symmetric two-player zero-sum games used to evaluate the model's ability to capture latent structures and rank players.
  • GAMUT Suite: A collection of 22 classic game types, including the Prisoner’s Dilemma and Bertrand Oligopoly, to test generalization and interpretability.
  • Colonel Blotto: An out-of-distribution game used to assess the model's performance on complex strategy cycles not seen during training.

5. Key Results and Strategic Insights

The NfgTransformer demonstrated state-of-the-art performance across all tested domains, showing significant improvements over traditional baselines.

5.1 Nash Equilibrium Solving

The model significantly outperformed both standard MLPs and specialized "NES" networks. In complex 3-player games, it achieved a near-zero "NE Gap," a metric indicating how close a strategy is to a true Nash Equilibrium. This suggests the model can effectively solve games it has never encountered before.

5.2 Payoff Prediction and Latent Structure

In DISC games, the NfgTransformer surpassed traditional ranking algorithms like Elo and its variants (mElo, xElo). Notably, the model could recover the latent structure of a game with near-perfect accuracy even when only 10% of the payoffs were observed, highlighting its strength in representation learning.

5.3 Emergent Game-Theoretic Concepts

One of the most significant findings was the interpretability of the model's attention mechanisms. Visualizations revealed that the attention heads naturally focused on concepts like best responses and indifference patterns at equilibrium. The model "learned" these fundamental game-theoretic principles from data without being explicitly programmed with these rules.

5.4 Size Independence and Generalization

Because the model processes actions as a set, its parameter count remains constant regardless of the game size (number of actions). In zero-shot tests on the Colonel Blotto game, the model successfully identified dominant strategies and clustered strategically equivalent actions, proving its ability to generalize to entirely new game classes.

6. Conclusion and Future Work

The NfgTransformer represents a significant step toward a general-purpose architecture for game theory. By embedding permutation equivariance directly into the network, it achieves superior performance and interpretability compared to previous methods.

However, limitations remain. The current model is optimized for Normal-Form Games; extending this architecture to Extensive-Form Games (sequential moves like Poker or Chess) is a primary objective for future research. Additionally, while the parameter count is size-independent, the computational complexity of the attention mechanism scales with the number of joint actions ($T^N$), presenting a challenge for games with a massive number of players. Future refinements may focus on approximating these interactions to scale the NfgTransformer to even larger strategic environments.

Summary updated

BibTeX
@inproceedings{liu2024nfgtransformer,
  author = {Siqi Liu and Luke Marris and Georgios Piliouras and Ian Gemp and Nicolas Heess},
  title = {{NfgTransformer: Equivariant Representation Learning for Normal-form Games}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=4YESQqIys7},
}
Figure