Organizations: Paris-Saclay University, UVSQ, DAVID Lab, 78035, Versailles, France · TSAM, ASM, Centre for Development of Advanced Technologies, Algiers, Algeria · LIPN, UMR CNRS 7030, Sorbonne Paris Nord University, Villetaneuse, France
Standard attention mechanisms in transformers are limited by their pairwise formulation, which hinders the modeling of higher-order dependencies among tokens. We introduce the NeuroGame Transformer (NGT) to overcome this by reconceptualizing attention through a dual perspective: tokens are treated simultaneously as players in a cooperative game and as interacting spins in a statistical physics system. Token importance is quantified using two complementary game-theoretic concepts -- Shapley values for global, permutation-based attribution and Banzhaf indices for local, coalition-level influence. These are combined via a learnable gating parameter to form an external magnetic field, while pairwise interaction potentials capture synergistic relationships. The system's energy follows an Ising Hamiltonian, with attention weights emerging as marginal probabilities under the Gibbs distribution, efficiently computed via mean-field equations. To ensure scalability despite the exponential coalition space, we develop importance-weighted Monte Carlo estimators with Gibbs-distributed weights. This approach avoids explicit exponential factors, ensuring numerical stability for long sequences. We provide theoretical convergence guarantees and characterize the fairness-sensitivity trade-off governed by the interpolation parameter. Experimental results demonstrate that the NeuroGame Transformer achieves strong performance across SNLI, and MNLI-matched, outperforming some major efficient transformer baselines. On SNLI, it attains a test accuracy of 86.4% (with a peak validation accuracy of 86.6%), surpassing ALBERT-Base and remaining highly competitive with RoBERTa-Base. Code is available at https://github.com/dbouchaffra/NeuroGame-Transformer.
Figures & tables
Method
Complexity
Feasibility for n=512
Exact summation
O(2n)
impossible ( 2512≈10154 operations)
Mean-field iteration
O(n2⋅T)
tractable ( ∼106 operations with T=20 iterations)
TABLE I : Complexity comparison between exact and mean-field approaches.
Feature
Standard Transformer (Vanilla)
NeuroGame Transformer (NGT)
Core Mechanism
Scaled Dot-Product Attention: Measures similarity/correlation between Q and K .
αi=21+⟨si⟩ from mean-field spin expectations ⟨si⟩ .
TABLE II : Comparison of Standard Transformer and NeuroGame Transformer (NGT) Features
Aspect
SNLI
MNLI-matched
Purpose
Large-scale NLI training [ 22 ]
Multi-genre NLI [ 23 ]
Size
570k pairs
433k pairs
Labels
Entailment, contradiction, neutral
Source
Image captions
10 diverse genres
Evaluation
In-distribution
Matched/mismatched
Challenge
General understanding
Cross-genre
TABLE III : Comparison of SNLI, and MNLI-matched
Dataset
Premise
Hypothesis
Label
SNLI
“A man is being interviewed by a reporter.”
“A reporter is interviewing a man.”
entailment
SNLI
“The doctor was paid by the actor.”
“The doctor paid the actor.”
contradiction
MNLI-matched
“The new rights are supposedly why we’re here.” (from letters genre)
“We are here because of new rights.”
entailment
MNLI-matched
“The cat hid under the bed during the storm.” (from fiction genre)
“The cat was outside in the rain.”
contradiction
TABLE IV : Concrete examples across datasets
Model
SNLI
MNLI-Matched
Parameters (approx.)
DAM
83.30
68.41
382K
ESIM
87.00
76.63
4.3M
BERT-Base
88.86
80.99
110M
BERT-Large
90.33
84.83
340M
RoBERTa-Base
86.95
85.98
125M
RoBERTa-Large
91.83
90.20
355M
TABLE V : Test accuracy (%) on SNLI and MNLI datasets. All accuracy values are taken from [ 24 ] . Parameter counts are standard values from the respective model papers.