wikillm

Paper · 2026-08-17 · cs.AI, cs.MA, cs.SI

Physics of Agents: Statistical Mechanics Predicts Collective Behavior of AI Agents

Author-reported: 32 persona-conditioned LLM agents vote on binary questions and exchange messages over signed social ties. A logistic Ising-style update with separate concordant, discordant and unsigned couplings predicts next votes, reaching 75-86% one-step balanced accuracy on held-out questions and beating the baselines.

Multi-agent systemsAgent-based simulationOpinion dynamicsmulti-agentopinion-dynamicsising-modelstatistical-physicsllm-agentsconsensus

arXivPDFCodeMarkdown20 min read

AI-compiled by claude-haiku-5-5 on 2026-10-19, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Picture a small group of chatbots, each given its own persona, which vote on a question, post a short reason, read the reasons from the others they are linked to, and vote again. This paper runs many such groups, some on maths problems with a right answer and some on political statements with none, and watches how their opinions move.

Most groups do not wander at random. They settle into one of three patterns: they stay unsure, they split into two camps that each hold strong views, or they agree. The agents usually start out unsure and become more sure as they talk. On the maths problems, talking tends to bring the group closer to the right answer. On the political statements, it tends to push the group's views in one direction.

The authors describe this with a model borrowed from physics. Each agent is pulled toward agreeing with the agents it is friendly with, pushed away from the ones it opposes, and pulled toward the view it would hold on its own. A simple rule fitted to observed votes predicts how individual agents change their minds and how often each kind of group outcome occurs. The tests cover one set of tasks and a handful of models, so the claim is narrower than it sounds.

TL;DR

  • Author-reported: groups of 32 language-model agents vote on binary questions over eight rounds and end up indifferent, polarized or in consensus §2 §3.2.
  • A logistic update with three couplings (concordant, discordant and unsigned ties) predicts each agent's next vote §4 tab. 1.
  • Held-out one-step balanced accuracy is 75-86% across four models and both question types, above all baselines. Multi-step rollouts score lower §5.1 tab. 1.
  • The fitted couplings say the groups run below their critical temperature, concordant ties outweigh discordant ones, and correct neighbours pull harder §5.3 §5.4 tab. 3.
  • The official code is Apache-2.0, but the saved notebook output and the message scheme for two of the four models differ from the paper. See Paper vs code.

Problem

Systems of interacting language-model agents, such as debate, ensembles and mixture-of-agents, are common, and their collective outcome can help or harm: interaction can aggregate information but also cause herding, polarization or amplify shared biases §1. The paper asks whether a compact model, fitted to observed votes, can predict an agent's next vote and the group outcome from the initial opinions, personas and communication graph alone §1 §2. Without such a model, the only way to know the outcome is to run the system.

Method

The paper has two parts: an experimental setup that produces the data §2, and a statistical model fitted to that data §4. Both are described below.

Experimental setup

  1. Agents. A community has N = 32 agents, each with a fixed persona p_i §2 §2 fn.. For objective questions the persona is an expert who has been shown the worked solution to a different MATH problem. For subjective questions it is a short profile of a real individual app. Tasks.
  2. Questions. Objective questions are MATH problems recast as a two-option A/B choice. The distractor was generated by claude-4.8-opus, and the correct answer is placed at A or B at random app. Tasks. Subjective questions are political statements; each agent agrees (+1) or disagrees (-1) app. Tasks. Only questions whose answers have high entropy across eight samples per agent are kept app. Tasks.
  3. Communication graph. J is an N x N matrix with entries in {-1, 0, +1}, symmetric with a zero diagonal §2 app. Communication Networks. +1 is a friendly tie (messages from this sender go to an "agree" inbox), -1 is an unfriendly tie (a "disagree" inbox), and 0 means no contact §2. Four families are used: random graphs, square and triangular lattices, and low-rank graphs app. Communication Networks.
  4. Round. At each round every agent writes one message from its current opinion and inbox. Each message is routed by the sign of the tie. Then each agent casts K = 5 binary votes with its new inbox. The mean vote is o_i(t) in {-1, -0.6, -0.2, 0.2, 0.6, 1}, and the state is s_i(t) = sign of that mean §2 §3.1 fn.. The paper runs T = 8 rounds §2 fn.. Updates are synchronous, and an asynchronous variant is covered in §5.5.
Pseudocode
# One synchronous round of the community  [§2]
# Input:  personas (N), question, graph J (N, N), states (N,), inboxes
# Output: next states (N,), next inboxes

def community_round(personas, question, J, states, inboxes):
    # Each agent writes one message from its opinion and its inbox  [§2]
    messages = [
        write_message(personas[i], question, inboxes[i], states[i])
        for i in range(N)
    ]
    # Route each message by the sign of the tie: +1 agree, -1 disagree  [§2]
    # Inboxes are shuffled with a seed per (replica, step, receiver)  [§2]
    inboxes = route_by_sign(messages, J)
    # Each agent casts K binary votes with its new inbox  [§2]
    votes = [
        [cast_vote(personas[i], question, inboxes[i]) for _ in range(K)]
        for i in range(N)
    ]
    # Mean vote lies in {-1, -0.6, -0.2, 0.2, 0.6, 1}; K odd, so never 0  [§2]
    opinions = [mean(vote_list) for vote_list in votes]
    # The state is the sign of the mean opinion  [§2]
    next_states = [sign(opinion) for opinion in opinions]
    return next_states, inboxes

Statistical model

The authors model the community as a system that lowers its social pressure. An agent's opinion s_i in {-1, +1} is coupled to its neighbours through J_ij and to its own predisposition g_i. The energy of a configuration is §4

E(s) = -\frac{1}{2}\sum_{i}\sum_{j} J_{ij}\, s_i s_j - \sum_i g_i\, s_i §4

Fixing all other agents, agent i sees a local field f_i = sum_{j != i} J_ij s_j

  • g_i. The probability that it holds +1 is a logistic function of that field with inverse temperature beta app. Local Update Rule. In the main text the logit is written with the coefficients beta and g_i directly, without the factor 2 that appears in the appendix derivation §4 app. Local Update Rule:

P(s_i = +1 \mid s_{-i}) = \sigma(h_i), \quad h_i = \beta \sum_j J_{ij}\, s_j(t) + g_i §4

The three-coupling rule, which the paper finds works best, splits the social term into a concordant part, a discordant part and an unsigned part §4:

P(s_i = +1) = \sigma\Big(\beta^{+}\sum_j J^{+}_{ij} s_j(t) + \beta^{-}\sum_j J^{-}_{ij} s_j(t) + \beta_0 \sum_j |J_{ij}|\, s_j(t) + g_i\Big) §4

Here J^+ = max(J, 0) and J^- = min(J, 0), so J^- <= 0 and beta^- multiplies it with its sign. The total weight on a friendly neighbour is beta^+ + beta_0, and on an unfriendly neighbour it is beta_0 - beta^- §4. The intrinsic field is linear in a 16-dimensional feature vector, g_i = w^T phi_i app. Fitting. phi_i = [1 | p_i | q | p_i (x) q], where p_i and q are the top three principal components of the persona and question embeddings app. Fitting.

Pseudocode
# Fitted update rule with three couplings  [§4] [app. Fitting]
# Input:  states (N,) in {-1, +1}; J (N, N); phi (N, 16)
# Output: P(next state = +1), shape (N,)

def update_probability(states, J, phi, weights, betas):
    # Intrinsic field from persona and question features  [app. Fitting]
    field = phi @ weights.field
    # Concordant, discordant and unsigned peer drives  [§4] [app. Fitting]
    drive_pos = positive_part(J) @ states
    drive_neg = negative_part(J) @ states
    drive_abs = abs(J) @ states
    # Logit: field plus the three weighted drives  [§4]
    logit = (field
             + betas.pos * drive_pos
             + betas.neg * drive_neg
             + betas.zero * drive_abs)
    # Logistic link  [§4]
    return sigmoid(logit)

Fitting. The weights are fitted by maximum likelihood on one-step transitions from the training questions, pooled over all agents, rounds and episodes app. Fitting. Feature columns are standardised, except the bias. The L2 penalty of 1e-3 applies to the persona-question field weights only, and the coupling weights start at 0.1 app. Fitting. Because the unsigned drive is a linear combination of the signed drives, the three-coupling model is fitted in two stages: beta_0 first, on the unsigned drive alone, then beta^+ and beta^- with beta_0 held fixed as an offset app. Fitting §4.

Pseudocode
# Fit the field and couplings on one-step transitions  [app. Fitting]
# Input:  features (rows, 19), targets in {0, 1}; unparsed targets dropped
# Output: weights (19,)

def fit_couplings(features, targets):
    # Standardise every column except the bias  [app. Fitting]
    scaled = standardise(features, keep_bias_column=True)
    # Couplings start at 0.1; all other weights start at 0  [app. Fitting]
    weights = initial_weights(coupling_init=0.1)
    # Full-batch Adam, lr 0.05, betas 0.9 and 0.999, <= 1500 steps  [app. Fitting]
    for step in range(1500):
        probs = sigmoid(scaled @ weights)
        # Cross-entropy plus L2 of 1e-3 on field weights only  [app. Fitting]
        loss = bce(probs, targets) + l2_penalty(weights.field, 1e-3)
        weights = adam_step(weights, loss)
        # Stop when the loss plateaus, checked every 100 steps  [app. Fitting]
        if step % 100 == 0 and plateaued(loss):
            break
    return weights

Continuous-time variant. Agents can instead revise at independent random times. A per-round update rate eps in (0, 1) gives a discretised mean-field rule app. Continuous Extension:

m_i(t{+}1) = (1-\varepsilon)\, m_i(t) + \varepsilon \tanh\big(\beta (Jm(t))_i + g_i\big) app. Continuous Extension

For fitting, the probability of +1 is (1 + m_i) / 2, with m_i = (1 - eps) s_i(t) + eps tanh(w^T x) and eps a learned parameter [app. Fitting]. This variant is evaluated on asynchronous data §5.5.

Baselines app. Baselines:

  • Majority class: always predicts the majority label of the training data. Reported only under raw accuracy.
  • Persistence: copies the current opinion; in rollouts it predicts s_i(0) at every step.
  • Interaction-free: P = sigma(g_i). It uses the persona-question field and no peer term.
  • Mean-field: P = sigma(g_i + beta * s_bar(t)), where s_bar is the population mean. It has no graph structure. It is implemented as the field plus the mean opinion as one extra feature app. Fitting [code: res/4_prediction.ipynb, cell 82cd974d].

Scoring. The metric is flip-and-class balanced accuracy. Transitions are grouped by whether the state flips or stays, and by the next value (+1 or -1). The score is the unweighted mean of the four group accuracies [app. Balanced Accuracy]:

\mathrm{BA} = \tfrac{1}{4}\big(\mathrm{acc}[\text{flip},{+}1] + \mathrm{acc}[\text{flip},{-}1] + \mathrm{acc}[\text{stay},{+}1] + \mathrm{acc}[\text{stay},{-}1]\big) app. Balanced Accuracy

A rule that always copies the current state, or always predicts the majority label, scores 50 by design app. Balanced Accuracy.

One-step and rollout prediction. One-step prediction uses the observed state at t as input. A rollout feeds the model's own predictions back in §5.1 app. Rollouts. Rollout predictions are deterministic: the sign of the logit app. Rollouts. For the distribution analysis, the rollouts are stochastic: each agent's next state is +1 with probability sigma(h_i(t)) §5.2 [app. Rollouts]. The temperature sweep scales the logit by 1/T §5.3 [app. Temperature Sweep].

Analysis quantities.

  • Individual archetype, from the number of sign flips F_i over the rounds: Frozen (F = 0), Switcher (F = 1), Intermittent (F = 2), Oscillator (F > 2) §3.1.
  • Group archetype, from the net opinion n(t) = (1/N) sum_i o_i(t) and a split band of half-width delta = 0.2 §3.1 fn.. The five classes are Persistent Split, Convergence, Divergence, Majority Switch and Persistent Majority §3.1.
  • Conviction c(t) = (1/N) sum_i o_i(t)^2 §3.2. Regimes are indifference, polarization and consensus, with thresholds chosen per model and question type §3.2 app. Thresholds for Characteristic Regimes.
  • Critical temperature T_c is the temperature at which chi peaks, with chi = N Var_t(|n(t)|) §5.3.
  • Truth-seeking split: each signed channel is split by whether the neighbour's current state equals the ground truth y. With kappa_j = 1 when s_j = y, the logit is §5.4

h = \sum_j \big[\beta^{+}_T \kappa_j + \beta^{+}_F(1-\kappa_j)\big] J^{+}_{ij} s_j + \sum_j \big[\beta^{-}_T \kappa_j + \beta^{-}_F(1-\kappa_j)\big] J^{-}_{ij} s_j + \beta_0 \sum_j |J_{ij}|\, s_j + g_i §5.4

Hyperparameters

Values are from the paper unless marked "code", and "not stated" means the paper gives no value. Appendix subsections have no numbers, so they are cited by title. The paper's equations and algorithms are unnumbered, so equations are cited by section.

NameValueWhereNotes
Agents N32§2Frontier run uses 64 (32 per model) app. Experiments with Frontier Models and Larger Mixed Groups
Rounds T8§2 fn.Communities mostly converge before 8 rounds §3.1 fn.
Votes per round K5§2Temperature sweep and frontier run use K = 1 §5.3 fn. app. Experiments with Frontier Models and Larger Mixed Groups
Vote mean grid{-1, -0.6, -0.2, 0.2, 0.6, 1}§2 §3.1 fn.K odd, so zero cannot occur
Split band delta0.2§3.1 fn.Equal to 1/K
Message per roundone per sender§2Legacy GPT-4o-mini and Gemma-3n runs sent one per recipient; see Paper vs code
LM sampling temperaturenot stated§2Code default 0.7 utils.py; the code notes say 0.7 was used for all experiments implementation_details.md §2.1
LM max output tokensnot stated§2Code default 256 utils.py
Opinion promptdirect judgement, no reasoningapp. PromptsObjective: single letter A or B; subjective: one word, AGREE or DISAGREE
Modelsgpt-4o-mini, gemma-3n-e4b-it, qwen3.5-9b, llama-3.1-8b-instructapp. ModelsFrontier mixed run: GPT-5.6-sol and DeepSeek-V4-Flash app. Experiments with Frontier Models and Larger Mixed Groups
Embeddingstext-embedding-3-smallapp. ModelsTop 3 PCA components for persona and question app. Fitting
Objective questions40 (20 train, 20 test); 10 A and 10 B in each halfapp. TasksFiltered by high entropy over 8 samples per agent
Subjective questions20 (10 train, 10 test)app. TasksPolitical statements
Random graphs12 (8 train, 4 fresh)app. Communication Networks app. FittingEdge budget not stated in the paper; code uses 112 non-zero entries for N = 32 implementation_details.md §2.3
Latticessquare (4 neighbours), triangular (6 neighbours)app. Communication NetworksHeld out from fitting
Low-rank graphs6 (rank 10, frustration 0, 0.1, 0.2; 2 each)app. Communication NetworksHeld out from fitting
Fitting optimiserfull-batch Adam, lr 0.05, betas 0.9 / 0.999, at most 1500 stepsapp. FittingPlateau stop checked every 100 steps
L2 penalty1e-3 on field weights onlyapp. FittingBias and couplings unpenalised
Coupling init0.1; other weights 0app. Fitting
Continuous epslearnedapp. FittingInitial value not stated in the paper; code starts at 0.5 implementation_details.md §4.2
Continuous parameter count18app. Fitting
Rollout thresholdsign of logitapp. RolloutsTies at 0 go to -1 in code (see Pitfalls)
Stochastic rolloutsigma(h / T)app. Rollouts §5.3T = 1 is the fitted operating point
Temperature sweep41 log-spaced values from 0.05 to 20; 500 steps, first 200 discardedapp. Temperature SweepK = 1 in this experiment
Async scheduleeach agent updates at rate 0.5 per round, 1000 cells per roundapp. Asynchronous-update experimentGPT-4o-mini only; raw accuracy
Dataset size9,600 groups in the main analysis; over 10,000 with the other experiments§3 fn.

Regime thresholds from the appendix [app. Thresholds for Characteristic Regimes]. Conviction threshold c* is the 1/3 quantile of conviction; net-opinion threshold n* is the median of |n(t)| among committed communities:

RegimeModelc*n*
ObjectiveGPT-4o-mini0.9100.475
ObjectiveGemma-3n-E4B0.9400.994
ObjectiveQwen3.5-9B0.7900.913
ObjectiveLlama-3.1-8B0.7400.913
SubjectiveGPT-4o-mini0.9600.375
SubjectiveGemma-3n-E4B0.9100.725
SubjectiveQwen3.5-9B0.8200.600
SubjectiveLlama-3.1-8B0.9500.963

Results

Author-reported. Setup: 9,600 simulated groups in the main analysis §3 fn., on four models, two question types, four graph families and four episodes each §3 fn.

Prediction and generalization §5.1

Balanced accuracy on held-out test questions. Each cell is one-step (rollout) in percent. In-d. graphs were seen in training; Out-d. graphs were held out. The test set is 320 pairs for subjective and 640 for objective questions tab. 1.

Subjective questions tab. 1

MethodGPT-4o-mini In-d.GPT-4o-mini Out-d.Gemma-3n-E4B In-d.Gemma-3n-E4B Out-d.Qwen3.5-9B In-d.Qwen3.5-9B Out-d.Llama-3.1-8B In-d.Llama-3.1-8B Out-d.
Persistence50.0 (64.5)50.0 (64.0)50.0 (59.3)50.0 (59.3)50.0 (65.1)50.0 (65.1)50.0 (63.2)50.0 (61.7)
Interaction-Free50.9 (50.9)48.9 (48.9)60.8 (60.8)59.6 (59.6)49.1 (49.1)47.5 (47.5)47.7 (47.7)45.6 (45.6)
Mean-Field57.9 (56.0)59.2 (57.2)68.2 (64.5)67.9 (65.8)65.2 (64.4)65.6 (65.5)54.9 (56.8)53.6 (57.4)
Discrete Update77.6 (69.0)75.6 (67.1)62.3 (61.0)61.3 (59.9)64.5 (57.1)60.3 (54.4)53.9 (49.9)51.6 (47.8)
+ 3 Couplings86.0 (76.2)86.3 (77.2)75.4 (67.8)75.1 (66.8)81.2 (70.8)78.8 (69.2)82.4 (68.4)80.8 (69.5)

Objective questions tab. 1

MethodGPT-4o-mini In-d.GPT-4o-mini Out-d.Gemma-3n-E4B In-d.Gemma-3n-E4B Out-d.Qwen3.5-9B In-d.Qwen3.5-9B Out-d.Llama-3.1-8B In-d.Llama-3.1-8B Out-d.
Persistence50.0 (55.6)50.0 (55.0)50.0 (61.8)50.0 (62.2)50.0 (53.9)50.0 (53.2)50.0 (57.0)50.0 (56.8)
Interaction-Free49.9 (49.9)49.3 (49.3)59.0 (59.0)59.1 (59.1)44.6 (44.6)45.4 (45.4)50.0 (50.0)50.0 (50.0)
Mean-Field65.4 (55.2)65.3 (55.5)72.6 (67.3)72.7 (68.3)73.6 (62.1)73.4 (61.1)64.7 (61.2)64.5 (60.5)
Discrete Update70.1 (61.5)67.8 (60.4)59.7 (58.9)59.7 (59.2)50.6 (47.8)49.8 (48.3)50.9 (50.0)50.6 (50.0)
+ 3 Couplings86.2 (68.2)85.0 (65.9)80.5 (68.5)80.8 (68.4)86.3 (65.6)85.2 (64.2)77.3 (62.8)76.4 (60.8)

The authors report that the three-coupling rule is best in every column, and that the one-coupling rule drops to near chance in some cells, for example 53.9 for Llama-3.1-8B on subjective questions §5.1.

Generalization to unseen graph families (GPT-4o-mini) tab. 2. Each cell is one-step / rollout, in percent.

MethodSubj. RandomSubj. Low rankSubj. SquareSubj. TriangularObj. RandomObj. Low rankObj. SquareObj. Triangular
Persistence50.0 / 64.050.0 / 57.050.0 / 65.250.0 / 57.450.0 / 55.050.0 / 53.150.0 / 55.150.0 / 47.0
Interaction-Free48.9 / 48.946.4 / 46.446.8 / 46.847.4 / 47.449.3 / 49.343.4 / 43.446.8 / 46.849.6 / 49.6
Mean-Field59.2 / 57.258.0 / 63.265.3 / 61.764.9 / 62.465.3 / 55.551.3 / 60.570.5 / 60.173.4 / 56.9
Discrete Update75.6 / 67.180.1 / 75.688.4 / 78.384.3 / 73.567.8 / 60.482.9 / 69.392.7 / 65.887.7 / 58.8
+ 3 Couplings86.3 / 77.295.1 / 89.392.6 / 83.585.3 / 73.285.0 / 65.997.8 / 80.794.7 / 70.988.1 / 59.7

The authors state that the three-coupling rule is best in 15 of 16 columns, and that its one-step accuracy stays between 85.0 and 97.8 §5.1.

Larger mixed-model group (64 agents: 32 GPT-5.6-sol, 32 DeepSeek-V4-Flash, one graph, one sample per agent per round) [app. Experiments with Frontier Models and Larger Mixed Groups]. Balanced accuracy, one-step (rollout) in percent.

MethodSubj. AllSubj. GPT-5.6-solSubj. DeepSeek-V4-FlashObj. AllObj. GPT-5.6-solObj. DeepSeek-V4-Flash
Persistence50.0 (63.3)50.0 (63.2)50.0 (63.5)50.0 (57.7)50.0 (62.8)50.0 (53.2)
Interaction-Free51.7 (51.7)52.2 (52.2)51.1 (51.1)48.4 (48.4)49.2 (49.2)48.2 (48.2)
Mean-Field57.3 (56.3)57.0 (56.7)57.6 (56.0)75.0 (70.9)72.2 (68.7)76.2 (71.5)
Discrete Update63.3 (59.0)65.5 (60.4)61.2 (57.4)48.4 (47.9)49.0 (48.8)48.2 (47.5)
+ 3 Couplings81.9 (70.4)83.9 (71.1)79.8 (69.7)80.0 (67.4)74.5 (64.6)83.5 (69.2)

Fitted couplings tab. 3

Fitted coefficients of the three- and five-coupling rules tab. 3. The five-coupling rule is defined for objective questions only.

ModelSetβ+β-β0β+_Tβ+_Fβ-_Tβ-_Fβ0 (5-coupling)
GPT-4o-miniObjective2.100.750.932.291.980.700.850.93
GPT-4o-miniSubjective2.391.080.61-----
Gemma-3n-E4BObjective0.290.230.960.340.200.170.360.96
Gemma-3n-E4BSubjective0.440.350.55-----
Qwen3.5-9BObjective0.900.501.011.030.770.400.801.01
Qwen3.5-9BSubjective1.120.650.64-----
Llama-3.1-8BObjective0.970.610.971.150.840.590.610.97
Llama-3.1-8BSubjective1.350.670.99-----

The authors report that beta^+ > beta^- in every model, that the effective concordant weight beta^+ + beta_0 lies between 0.99 and 3.03, and that the effective discordant weight beta_0 - beta^- is at most 0.73, with negative values in two cases §5.4. They also report that beta^+_T > beta^+_F and beta^-_F > beta^-_T in all four models, so correct neighbours pull harder and incorrect neighbours push harder §5.4.

Asynchronous updates §5.5 app. Asynchronous-update experiment

Rollout accuracy (raw, not balanced), GPT-4o-mini only. M = Majority Class, P = Persistence, IF = Interaction-Free, MF = Mean-Field.

SetMPIFMFDiscrete baseDiscrete + 3CContinuous baseContinuous + 3C
Subjective In-d.61.178.356.363.460.666.079.780.4
Subjective OOD58.976.952.259.857.762.877.378.5
Objective In-d.46.764.348.952.851.454.963.865.3
Objective OOD48.265.048.055.153.054.764.765.9

Observed collective behaviour §3

  • Frozen agents dominate most settings, followed by oscillators; switchers and intermittent agents are rarer §3.1 fig. 2.
  • Divergence and Majority Switch, where the initial majority weakens or is overturned, reach 11-12% for GPT-4o-mini and Qwen3.5-9B §3.1 fig. 3.
  • Conviction rises over the rounds in every setting, and indifference falls while consensus rises §3.2 fig. 4.
  • On objective questions, switches from incorrect to correct majority are more common than the reverse for all models §3.3 fig. 5.
  • On subjective questions, the majority is more likely to move from left to right than the other way §3.3. The authors report rightward drift in three of four models §7.

Distributions and critical temperature §5.2 §5.3

  • Stochastic rollouts from the real initial states reproduce the group archetype distribution. Mean absolute deviation is about 3 points on objective and 5 on subjective questions. The largest gap is about 10 points (Qwen3.5-9B, subjective, Persistent Majority) §5.2 fig. 6.
  • The fitted operating point, T = 1, lies below the critical temperature T_c in every dataset and model cell §5.3 fig. 7.

Paper vs code

Checked at commit 62bf0e7 of batu-el/physics-of-agents, Apache-2.0 [code: LICENSE]. The paper's footnote links this repository, and its owner is the first author, so no search was needed. The code is not the same as the paper in the places listed below.

Matches the paper.

  • Balanced accuracy matches the four-group definition utils.py.
  • Fitting uses full-batch Adam with lr 0.05, betas 0.9 and 0.999, at most 1500 steps, and the 1e-3 L2 penalty on field weights only utils.py.
  • Couplings start at 0.1, and the two-stage fit uses beta_0 first [code: res/utils.py#L195-L205].
  • The drives are J^+ s, J^- s and |J| s = J^+ s - J^- s utils.py.
  • Deterministic rollouts use the sign of the logit, and the feature set is [1, p, q, p (x) q] utils.py.
  • Individual and group archetype definitions match, including the five group classes and the strict split band utils.py.
  • The interaction-free and mean-field baselines match the appendix description 4_prediction.ipynb, cell 82cd974d.

Differs from the paper.

  • Message scheme. The paper says each agent writes one message per round §2. A note in the code says the older GPT-4o-mini and Gemma-3n-E4B data were generated with a separate message for each recipient, while the Qwen, Llama and asynchronous data use one message per sender [code: lib/datagen/dynamics.py#L107]. Table 1 covers all four models, so two of the four were generated under the legacy scheme.
  • Notebook output versus Table 1. The saved output of res/4_prediction.ipynb matches the paper's table in most cells but differs in others. Examples: GPT-4o-mini subjective discrete update reads 77.7 (69.4) in the notebook and 77.6 (69.0) in the paper; Llama-3.1-8B subjective three-coupling out-of-distribution reads 80.8 (68.3) in the notebook and 80.8 (69.5) in the paper. The notebook also labels the Llama model "Llama-3-8B" [code: res/4_prediction.ipynb, cell 14dfde1e]. The paper's values are cited in this card.
  • Coupling values. The notebook's coupling table matches the paper's Table 3 to two decimals except GPT-4o-mini subjective beta^+: 2.38 in the notebook, 2.39 in the paper 4_prediction.ipynb, cell c2b2ba1d.
  • Sampling settings. The paper does not state the LM sampling temperature. The code default is 0.7 utils.py and the code notes say it was fixed at 0.7 for all experiments implementation_details.md §2.1.
  • Edge budget. The paper does not state the number of edges. The code uses 112 non-zero entries for N = 32 (56 undirected ties, average degree 3.5), and 224 entries for the 64-agent run implementation_details.md §2.3 [code: implementation_details.md §2.7].
  • Frontier run. The paper says the frontier run uses one sample per agent per round. The code confirms k = 1, and its CLI defaults reasoning to off so the models give direct judgements implementation_details.md §2.7.

Not verified in code. The continuous-time fit, the temperature sweep and the asynchronous pipeline were checked only through the code notes [code: implementation_details.md §2.6 and §4.2], not line by line.

Pitfalls

  • Logit scale. The appendix derives sigma(2 beta f_i), but the fitted coefficients in Table 3 are the logit coefficients §4 [app. Local Update Rule]. Do not multiply or divide any coupling by 2. The code applies the coefficients directly to the logit utils.py.
  • Identifiability of the three couplings. The unsigned drive is a linear combination of the signed drives, so the three couplings are not jointly identified. The paper fits beta_0 first and then fixes it. Only beta^+ + beta_0, beta_0 - beta^- and the truth gaps are identifiable tab. 3 app. Fitting. Reported beta^+ and beta^- depend on this order.
  • Ties. The paper says the rule thresholds at sign(h). The code treats a logit of exactly 0 as -1 utils.py. Exact zeros are rare with continuous logits, but an implementation should choose one convention.
  • Parsing. Subjective responses are parsed permissively: DISAGREE is checked before AGREE, so a response containing both words becomes -1 [code: lib/datagen/samplers.py#L29-L38]. The paper describes a one-word answer. Objective responses must contain exactly one standalone A or B [code: lib/datagen/samplers.py#L39-L49].
  • Failed calls. After two retries, a failed call becomes spin 0. The code does not use these in fitting or scoring, which is why transitions with 0 are excluded dynamics.py utils.py. The paper does not state this. Failures are rare: 0.0377% of raw samples implementation_details.md §2.2.
  • Inbox order. Messages in each inbox are shuffled with a seed derived from the replica, round and receiver dynamics.py. The paper does not state the order, and it can affect individual outcomes.
  • Rollouts and one-step. One-step scores use the observed previous state. Rollout scores use the model's own predictions. The rollout columns in the tables are deterministic, and the stochastic rollouts are used only for the distribution analysis app. Rollouts. Do not mix the two.
  • Two different temperatures. The temperature in the sweep scales the fitted logit, not the LM sampling temperature app. Temperature Sweep. The LM sampling temperature is a separate setting, and the paper does not state it.
  • K differs by experiment. The main runs use K = 5. The temperature sweep and the frontier run use K = 1 §5.3 fn. [app. Experiments with Frontier Models and Larger Mixed Groups]. Compare like with like.
  • Generated inputs. The question distractors were generated with claude-4.8-opus, and the subjective profiles were generated with gpt-4o-mini app. Tasks. Reproduction depends on the released question banks and personas implementation_details.md §3.2.
  • Small test sets. The test sets have 20 objective and 10 subjective questions app. Tasks, so per-question variance is large. The paper reports a replica-predictability ceiling showing that episodes often disagree on the group archetype §5.2.
  • Simulated personas, not people. The authors caution against treating the results as a model of human opinion dynamics §7.
  • Author-reported. All numbers come from the authors' runs, with four models and one graph family per row of Table 2.

Lineage

  • Builds on: the Ising model and Glauber dynamics §1 [app. Continuous Extension], the Curie-Weiss mean-field approximation for the mean-field baseline 4_prediction.ipynb, cell 82cd974d, and the logistic regression fitting in the appendix app. Fitting.
  • Relates to: Mixture-of-Agents, multi-agent debate, self-consistency and critique, each seen as a special case of the graph J and the depth T §2.
  • Compared against: Persistence, Interaction-Free, Mean-Field and Majority Class app. Baselines.
  • Superseded by: not known from content already in this wiki.

Source and license

Adapted from “Physics of Agents: Statistical Mechanics Predicts Collective Behavior of AI Agents” by Batu El, Jinhee Paeng, Fatih Dinc, Shiye Su, Mete Erdogan, Aneesh Pappu, Haotian Ye, Wanjia Zhao, Surya Ganguli, James Zou (arXiv:2608.16578), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/batu-el/physics-of-agents at commit 62bf0e7ddb94 (Apache-2.0). Any quoted code is shown under that license.