arXiv:2611.02047cs.LGNov 2026

Manuscript Offprint

arXiv:2611.02047

Beliefs in feedback: Factored representations of interacting agents in transformers

David A. Ehrlich, Manuel Baltieri, Fernando E. Rosas, Alexander B. Boyd

ABSTRACT

Complex systems, from ecosystems to brains, are usually modeled as modular components coupled through feedback rather than as indivisible wholes. Can a transformer trained on the joint behavior of a group of interacting agents be understood in the same way? In this work, we develop a computational-mechanics framework to study agents interacting in feedback loops. We formally prove that any joint stochastic process can be presented as resulting from the behavior of agents interacting in feedback, and the resulting process is generated by a hidden Markov model whose Bayesian beliefs factorize into separate components per agent. Furthermore, our experiments show that transformers trained on such feedback sequences make use of this separability, disentangling the beliefs about the underlying factors into separate subspaces of their residual stream. This representation is found to scale linearly (instead of exponentially) with the number of agents. Moreover, interventions show that these representations are causally efficacious, allowing for targeted steering of individual agents' beliefs by selectively inserting counterfactuals. However, coarse-graining the behavior is found to disrupt the factorization, and can force a higher-dimensional representation. Together, the results establish both the dimensional advantage of a factorized representation and the ability of transformers to exploit it, laying the groundwork for investigating traces of compositional predictive architecture in pretrained models.

1 INTRODUCTION

Communities can accomplish feats beyond the capacity of their individuals—groups of ants solve complex geometry problems (Dreyer et al., 2025), birds flock in murmurations responding to predators as a single perceptive body (Cavagna et al., 2010; Attanasi et al., 2014), AI agents coordinate to effectively infiltrate digital infrastructure (Greenblatt et al., 2026), and people collaborate in the global project of developing a scientific understanding of the universe (Fortunato et al., 2018; Zollman, 2007; Hull, 1988). How individuals interact to produce such collective behavior is the subject of multi-agent systems research, which seeks to formalize these interactions and how agents form beliefs that can motivate predictions about other agents (Gmytrasiewicz & Doshi, 2005; Albrecht & Stone, 2018; Chen et al., 2020; Zhang et al., 2022).

Interestingly, the problem of understanding how individuals come together into collectives is dual to the question of how a single complex system can be understood as a composite of sub-components. A longstanding tradition in cognitive science interprets single cognitive systems as arising from the interaction of distinct modular 'agents' (Minsky, 1986). Similarly, a substantial body of work in mechanistic interpretability research aims to decompose large deep learning systems into interconnected 'circuits' (Olah, 2022; Olsson et al., 2022; Wang et al., 2022).

*Correspondence: david@daehrlich.com

The above considerations raise a question for any observer of a complex system: under what conditions can the observer track the system not as an indivisible whole, but via tracking its sub-components separately and then putting these together?

As a first step towards addressing this question, here we investigate transformers trained to predict data generated by interacting agents. We describe the behavior of these agents using transducers: stochastic automata that generate outputs from inputs and update their memory via probabilistic rules (Barnett & Crutchfield, 2015). Recent work has used principles of computational mechanics (Crutchfield, 2012) to show that transformers tend to represent the geometry of Bayesian beliefs within their internal activations during inference (Shai et al., 2024; Piotrowski et al., 2025), and that representations for independent processes factorize (Shai et al., 2026). Building on these works, we investigate whether a transformer trained on data generated by interacting agents builds internal representations that mirror the agents that generated the data.

In this paper we introduce a theoretical framework to formally investigate the prediction of interacting agents, which is then empirically validated on trained transformers. The theoretical contributions are:

  1. We develop a general computational-mechanics framework to describe the behavior of agents arranged in feedback loops.

  2. We formally show that any joint process can be viewed as arising from multiple subcomponents in feedback.

  3. We demonstrate that these factored processes can lead to exponential advantages in the embedding dimension. However, these savings can be broken by coarse-graining.

We use these theoretical advances to obtain the following experimental results on transformers trained to predict the activity of interacting agents:

  1. Transformers linearly represent factored Bayesian beliefs in separate subspaces of their residual stream, with each factor tracking an individual agent.

  2. These representations are causally efficacious, being separately steerable by inserting counter-factual beliefs on specific subspaces.

  3. By using factored beliefs, transformers can attain exponential savings in the required residual stream dimensionality for effectively predicting interacting agents.

References (100)

Couldn't load all references. Reload the page to try again.