Disentangling Representations through Multi-task Learning

## Abstract

Abstract Intelligent perception and interaction with the world hinges on internal representations that capture its underlying structure (“disentangled” or “abstract” representations). Disentangled representations serve as world models, isolating latent factors of variation in the world along approximately orthogonal directions, thus facilitating feature-based generalization. We provide experimental and theoretical results guaranteeing the emergence of disentangled representations in agents that optimally solve multi-task evidence aggregation classification tasks, canonical in the cognitive neuroscience literature. The key conceptual finding is that, by producing accurate multi-task classification estimates, a system implicitly represents a set of coordinates specifying a disentangled representation of the underlying latent state of the data it receives. The theory provides conditions for the emergence of these representations in terms of noise, number of tasks, and evidence aggregation time. Surprisingly, the theory also produces closed-form expressions for extracting the disentangled representation from the model’s latent state 𝐙 ⁢ ( t ) 𝐙 𝑡 \mathbf{Z}(t) bold_Z ( italic_t ) . We experimentally validate these predictions in RNNs trained on multi-task classification, which learn disentangled representations in the form of continuous attractors, leading to zero-shot out-of-distribution (OOD) generalization in predicting latent factors. We demonstrate the robustness of our framework across autoregressive architectures, decision boundary geometries and in tasks requiring classification confidence estimation. We find that transformers are particularly suited for disentangling representations, which might explain their unique world understanding abilities. Overall, our framework puts forth parallel processing as a general principle for the formation of cognitive maps that capture the structure of the world in both biological and artificial systems, and helps explain why ANNs often arrive at human-interpretable concepts, and how they both may acquire exceptional zero-shot generalization capabilities.

## 1 Introduction

The ability to construct representations that capture the underlying structure of the world from data, is a hallmark of intelligence. Humans and animals leverage their experiences to construct such faithful representations of the world ("world models"), resulting in a near-effortless ability to generalize to new settings [, ]. Modern foundation models also display emergent out-of-distribution (OOD) generalization abilities, in the form of zero- or few-shot learning [, , , ]; however whether artificial systems learn world models remains unclear. Understanding the conditions under which that occurs is bound to lead to better generalizable systems, and explain why artificial systems often converge to human interpretable, aligned representations of the world [].

A promising direction towards understanding the construction of world models is abstract, or disentangled representations [, , ]. These two concepts are interrelated yet somewhat distinct (see definitions adapted from Ostojic and Fusi [] in Section A.1). Shortly, an abstract representation of $x_{1},\dots,x_{n}$ represents each $x_{i}$ linearly and approximately mutually orthogonally. Disentangled representations encode each $x_{i}$ orthogonally, without the necessity of linearity. Both representations preserve the latent structure present in the world in their geometry by isolating factors of variation in the data, which facilitates downstream generalization. When a representation is abstract, a linear decoder (i.e. downstream neuron) trained to discriminate between two categories can readily generalize to stimuli not observed in training, due to the structure of the representation. Furthermore, the more disentangled the representation is, the lower the interference from other variables and hence the better the performance. This corresponds to decomposing a novel stimulus into its familiar features, and performing feature-based generalization. For instance, imagine you are at a grocery store, deciding whether a fruit is ripe or not. If the brain’s internal representation of food attributes (ripeness, caloric content, etc.) is disentangled, then learning to perform this task for bananas would lead to zero-shot generalization to other fruit (e.g. mangos, Figure 1a). Crucially, the visual representation of a mango is high-dimensional, non-linear and noisy, making it particularly challenging to extract a low dimensional latent like "ripeness".

Several brain areas including the amygdala, prefrontal cortex and hippocampus encode variables of interest in an abstract format [, , , , ]. This raises the question of under which conditions do such representations emerge in biological and artificial agents alike. Previous work showed that feedforward neural networks develop abstract representations when trained to multitask []. However, real-world decisions typically rely on imperfect, noisy information, evolving dynamically over time [, ]. To account for this important feature of the world, we train autoregressive models (RNNs, LSTMs, transformers) to multitask canonical neuroscience tasks involving the accumulation of evidence over noisy streams. The tasks tie closely to Bayesian filtering theory, and should be solved by any agent that deals with a noisy world.

##### Contributions.

The main contributions of the paper are the following:

- •
We prove that any optimal multi-task classifier is guaranteed to learn an abstract representation of the ground truth contained in the noisy measurements in its latent state, if the classification boundary normal vectors span the input space (Appendix B). Furthermore, the representations are guaranteed to be disentangled as the number of tasks $N_{\text{task}}$ greatly exceeds the input dimensionality $D$. Intriguingly, noise in the observations is necessary to guarantee the latent state would compute a disentangled representation of the ground truth.
- •
We confirm that RNNs trained to multitask develop abstract representations that zero-shot generalize OOD, when $N_{\text{task}}\geq D$, and orthogonal, disentangled representations for greater $N_{\text{task}}$. The computational substrate of these representations is a 2D continuous attractor [] storing a ground truth estimate in a product space of the latent factors. In addition, the representations are sparse and mixed, attributes of biological neural networks.
- •
We reproduce these findings in GPT-2 models, which generalize better due to them learning disentangled representations already from $N_{\text{task}}\geq D$, confirming their appropriateness for constructing disentangled world models.
- •
We demonstrate that our setting is robust to a number of manipulations, including correlated inputs, interleaved learning of tasks and free reaction-time tasks canonical in the cognitive neuroscience literature [, ].
- •
Finally, we discuss implications for generalizable representation learning in biological and artificial systems, and demonstrate the strong advantage of multi-task learning over previously proposed mechanisms of representation learning in the brain [].

Despite being framed in the context of canonical cognitive neuroscience tasks, our results are general; they apply to any system aggregating noisy evidence over time.

### 1.1 Related work

Disentanglement has long been recognized as a promising strategy for generalization [] (although note Locatello et al. [], Montero et al. [] for a contrarian view), yet most classic work focuses on feedforward architectures [, , ]. In terms of autoregressive models, Hsu et al. [], Li and Mandt [] showed that variational LSTMs disentagle representations of underlying factors in sequential data allowing style transfer; however the underlying representational geometry was not characterised. Other work focuses on fitting RNNs to behavioral data while enforcing disentanglement for interpretability [, ]. Work on context-dependent decision making has shown that RNNs re-purpose learned representations in a compositional manner when trained in related tasks [, ]; however, the abstractness of the resulting representations was not established. Finally John et al. [] show that multitasking results in disentanglement, however unlike us they directly enforce latent factor separation through their adversarial optimization objectives. Our approach is most closely related to weakly supervised disentanglement, without comparing across samples [].

Our work relates to previous work on linear identifiability. Roeder et al. [] show that representations of models trained on the same distribution must be linear transformations of each other; yet we go beyond their results to show that abstract representations are guaranteed to emerge under moderate conditions, irrespectively of the dimensionality of the input and model architecture. Lachapelle et al. [] proved that disentangled representations emerge in feedforward architectures from multitask learning in sparse tasks when a sparsity regularization constraint is placed on the predictors; we place no such constraints and still uncover disentangled representations.

Previous neuroscience-inspired work showed that multitasking feedforward networks learn abstract representations, as quantified by regression generalization []. We expand upon these findings in several ways.
First, we extend the framework to autoregressive architectures (RNNs, LSTMs, transformers) that can update their representations as further information arrives.
Second, we prove theorems that guarantee the emergence of abstract representations in any optimal multitask classifier if the number of tasks exceeds the input dimensionality $D$, and showcase disentanglement in our trained networks.
Third, we rigorously analyze the role of noise in forming disentangled representations, extending the noise-free regime studied in Johnston and Fusi [].
Finally, we explore a range of values for $D$, providing experimental validation of our theory.

## 2 Problem formulation

##### Multi-Task Classification with Evidence-Aggregation:

We study the evidence aggregation multi-task classification paradigm shown in Figure 1b.
An agent with latent state $\mathbf{Z}(t)$ receives noisy, non-linearly mapped observations $\{f\big{(}\mathbf{X}(t)\big{)}\}_{t=1}^{T}$ where each $\mathbf{X}(t)=\mathbf{x}^{*}+\sigma\,\mathcal{N}(0,I_{D})$ is a noisy measurement of unknown ground truth vector $\mathbf{x}^{*}\in\mathbb{R}^{D}(x_{i}^{*}\sim\textit{Uniform}(-0.5,0.5))$, with $\mathcal{N}$ being Gaussian noise.
The noisy measurements are transformed by an injective observation map function $f$, which can be non-linear and high dimensional, representing the wide range of sensory transformations found in real-world scenarios.
The agent is tasked with simultaneously solving $N_{\textit{task}}$ classification problems by aggregating information over time, each defined by a random linear decision boundary(^1^11Due to the observation map $f$, the tasks may appear non-linear from the perspective of the multi-task classification agent.) in the ground truth space $\mathbb{R}^{D}$ i.e.

$$ $y_{i}(\mathbf{x}^{*})=\begin{cases}1&\text{ if }\mathbf{c}_{i}^{\top}\mathbf{x }^{*}>b_{i}\\ 0&\text{ otherwise }\end{cases}$ (1) $$

where $\mathbf{y}(\mathbf{x}^{*})\in\{0,1\}^{N_{\textit{task}}}$ represents the $N_{\textit{task}}$ classifications of $\mathbf{x}^{*}$, $\{(\mathbf{c}_{i},b_{i})\}_{i=1}^{N_{\textit{task}}}$ are the classification boundary normal vectors and offsets, and let $\hat{\mathbf{Y}}(t)=g(\mathbf{Z}(t))\in[0,1]^{N_{\textit{task}}}$ represent the agent’s predicted likelihood of $y_{i}(\mathbf{x}^{*})=1$ over each of the binary classifications $i$ at time $t$. The classification lines reflect criteria based on which decisions will be made. Imagine for example that $x_{1}$ corresponds to food and $x_{2}$ to water reward.
Depending on the agent’s internal state, one takes precedence over the other, and the degree of preference is reflected in the slope of the line.

Figure: Figure 1: Disentangled representations and a framework to learn them. (a) A disentangled representation directly lends itself to OOD generalization: a downstream linear decoder that can differentiate ripe from unripe bananas can readily generalize to mangos, even though it has never been trained on mangos. (b) Overview of our multi-task classification framework. A ground truth $\mathbf{x}^{*}$ is sampled and Gaussian noise is added to arrive at observations $\{\mathbf{X}(1),...,\mathbf{X}(t)\}$. These observations are processed by the filter-based model illustrated graphically in Figure S5, maintaining a latent state $\mathbf{Z}(t)$. The latent state $\mathbf{Z}(t)$ is then used to produce classification outputs $\hat{Y}_{1}(t)$, $\hat{Y}_{2}(t)$. Theorem B.6 proves that $\mathbf{Z}(t)$ must encode the optimal estimator of $\mathbf{x}^{*}$ given the noisy observations, $\mu(t)$.
Refer to caption: extracted/5927657/Figures/Fig1.png

##### Criterion for Disentangled Representation Learning:

We investigate how solving the multi-task classification problem (Figure 1b) leads to agents learning disentangled representations of the latent ground truth $\mathbf{x}^{*}$ in its internal state $\mathbf{Z}(t)$.
Specifically, we ask whether there exists a linear-affine transformation $(\mathbf{A},\mathbf{b})$ such that $\mathbf{x}^{*}=\mathbf{A}\mathbf{Z}(t)+\mathbf{b}$.
Such a mapping would imply $\mathbf{Z}(t)$ linearly represents $\mathbf{x}^{*}$.
If the rows of $\mathbf{A}$ are approximately orthogonal, the representation is disentangled.

## 3 Theoretical results

Here we provide conditions and guarantees for the emergence of disentangled representations in optimal multi-task classifiers with latent state $\mathbf{Z}(t)$ in the paradigm described in Section 2 and Figure 1.
By “optimal multi-task classifier”, we refer to any agent or system whose outputs $\hat{\mathbf{Y}}(t)$ correspond to the correct posterior classification probabilities given the noisy, non-linearly transformed observations; that is, for each task $i=1,\dots,N_{\textit{task}}$

$$ $\displaystyle\hat{Y}_{i}(t)$ $\displaystyle=\Pr\left(y_{i}(\mathbf{x}^{*})=1\mid f(\mathbf{X}(1)),\dots,f( \mathbf{X}(t))\right)$ (2) $\displaystyle\hat{\mathbf{Y}}(t)$ $\displaystyle=g(\mathbf{Z}(t))$ (3) $$

The notion of optimality allows us to make precise statements about the informational content of the agent’s internal state $\mathbf{Z}(t)$. Let $\mathbf{C}\in\mathbb{R}^{N_{\textit{task}}\times D}$ be a matrix where each row is a decision boundary normal vector. Then

###### Theorem 3.1 (Disentangled Representation Theorem) .

If $\mathbf{C}\in\mathbb{R}^{N_{\textit{task}}\times D}$ is a full-rank matrix and $N_{\textit{task}}\geq D$ and noise $\sigma>0$, then

- 1.
any optimal estimator of $\mathbf{y}(\mathbf{x}^{*})$ must encode a finite-sample, maximum likelihood estimate $\mu(t)$ of the ground truth evidence variable $\mathbf{x}^{*}$ in its latent state $\mathbf{Z}(t)$, and
- 2.
if the activation function is sigmoid-like, $\mu(t)$ will be linearly decodable from $\mathbf{Z}(t)$, thus implying that $\mathbf{Z}(t)$ contains an abstract representation of $\mu(t)$ [].
- 3.
Furthermore, the representation is guaranteed to be disentangled (orthogonal) as $N_{\textit{task}}\gg D$ for random decision boundaries.

Specifically, $\mu(t)$ is the maximum likelihood estimate (MLE) of $\mathbf{x}^{*}$ given observations $f(\mathbf{X}(1)),\dots,f(\mathbf{X}(t))$.
A closed-form expression for extracting $\mu(t)$ from $\mathbf{Z}(t)$ is given by:

$$ $\displaystyle\mu(t)$ $\displaystyle=(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}\begin{ pmatrix}\frac{\sigma}{\sqrt{t}}\Phi^{-1}\big{(}g(\mathbf{Z}(t))\big{)}+\mathbf {b}\end{pmatrix}$ (4) $$

where $\Phi$ is the CDF of the normal distribution, $\sigma$ is the noise magnitude and $t$ the trial duration.
Furthermore, if the activation function $g$ is of the sigmoid family of functions ($\tanh,\textup{sigmoid}$), then the term $\Phi^{-1}\big{(}g(\cdot))$ approximately cancels out, leading to:

$$ $\displaystyle\mu(t)$ $\displaystyle\approx\underbrace{\frac{a_{g}\,\sigma}{\sqrt{t}}(\mathbf{C}^{ \top}\mathbf{C})^{-1}\mathbf{C}^{\top}\mathbf{Z}(t)}_{\text{Linear Function of $\mathbf{Z}(t)$}}+\underbrace{(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{ \top}\mathbf{b}}_{\text{Affine Term}}$ (5) $$

where we have approximated $a_{\tanh}=\frac{2\sqrt{3}}{\pi}$ for $g=\tanh$ and $a_{\sigma}=0.5886$ for $g=\textup{sigmoid}$. For Gaussian IID noise, $\mu(t)$ is the sample mean of $\{\mathbf{X}(t)\}_{t=1}^{T}$, i.e. with non-linearity $f$ removed.

###### Proof.

Point 1 and Equation 4 are proven in Appendix B in Theorem B.6. Point 2 and Equation 5 are proven in Corollary B.7 for $\tanh$ and Corollary B.8 for sigmoid. Point 3 is proven in Corollary B.9.
∎

The key conceptual insight in the proof of Theorem 3.1 is that each of the multi-task classification probability estimates $\hat{Y}_{i}(t)$ represents an estimated projection distance between the MLE $\mu(t)$ and the given classification boundary $(\mathbf{c}_{i},b_{i})$.
Once distances to classification boundaries are recovered, $\mu(t)$ can be inferred if the $N_{\text{task}}$ classification boundaries span the $D$-dimensional space of $\mathbf{x}^{*}$.
Note that classification boundary distances are only guaranteed to be recoverable when there is non-zero noise $\sigma>0$ such that $\hat{Y}_{i}(t)$ does not saturate to 1 or 0, and thus still carries useful decision boundary distance information (see Lemma B.3). In fact, Equations 4 and 5 do not hold for $\sigma\to 0$, as they were derived by means of Bayesian estimation which assumes the presence of noise.

The linear approximation for decoding $\mu(t)$ from $\mathbf{Z}(t)$ in Equation 5 is enabled by the remarkable similarity between sigmoid functions and the Gaussian CDF $\Phi$.
The sigmoid-like structure of $\Phi$ suggests many similar activations $g$ (e.g., softmax) would exhibit approximate linear decodability.
For more exotic element-wise activation functions $g$, Equation 4 suggests $\mu(t)$ will be represented in $g(\mathbf{Z}(t))$ in the column space of $(\mathbf{C^{\top}C})^{-1}\mathbf{C}^{\top}$ potentially with some element-wise non-linearity.

###### Theorem 3.1 (Disentangled Representation Theorem) .

###### Proof.

##### Robustness to other noise distributions

Although we focus on Gaussian noise for our theoretical derivations, we note that a wide range of alternative noise distributions are permissible, including anisotropic Gaussian noise (Lemma B.10).
The key property enabling us to recover distances from classification probabilities is the invertibility of the marginal posterior CDFs along the decision boundary normals.
This property is not exclusive to Gaussian noise but is shared by a broader class of noise distributions, including but not limited to elliptical distributions (e.g., multivariate t-distributions, Laplace distributions), exponential power distributions, and other symmetric and unimodal distributions with invertible marginals.
Therefore, the proof of Theorem 3.1 generalizes to any noise distribution satisfying the conditions outlined above (see Appendix B.4 for conditions and derivations).
In fact, our experiments show robustness to anisotropic and autocorrelated noise, and mismatch between noise CDF and activation function (Section A.8).

## 4 Methods

We trained autoregressive models (RNNs, LSTMs, GPT-2 transformers) with latent state $\mathbf{z}(t)$, to output multi-task classifications $\mathbf{y}(\mathbf{x}^{*})\in\{0,1\}^{N_{\textit{task}}}$ given noisy and non-linearly mapped inputs $f(\mathbf{X}(1)),\dots,f(\mathbf{X}(t))$ (Figure 2). We subsequently trained linear probes $\mathbf{A}$ on $\mathbf{z}(t)$ to estimate $\mathbf{x}^{*}$, denoted $\hat{\mu}(t)=\mathbf{A}\,\mathbf{z}(t)$. We here focus on leaky RNNs, representing a brain area making decisions; for more details on GPT-2 experiments see Section A.5. The networks contain $N_{\textit{neu}}$ neurons, and their activations $\mathbf{z}(t)$ obey:

$$ $\tau\dot{\mathbf{z}}=-\mathbf{z}+\left[\,\mathbf{W}_{\textit{rec}}\,\mathbf{z} +\mathbf{W}_{\textit{in}}\,\mathbf{x}_{\textit{in}}+\mathbf{b}\,\right]_{+}$ (6) $$

where $\mathbf{W}_{\textit{rec}}$ is the recurrent weight matrix, $\mathbf{W}_{\textit{in}}$ is the matrix carrying the input vector $\mathbf{x}_{\textit{in}}$, $\mathbf{b}$ is a unit-specific bias vector, $\tau$ is the neuronal time constant, $\left[.\right]_{+}$ is the ReLU applied element-wise and time dependencies have been dropped for brevity. We discretize Equation 6 using the forward Euler method for $T=20$ timesteps of duration $\Delta t=\tau=100\,\textrm{ms}$, which we find to be stable. The RNN’s output $\hat{\mathbf{y}}(t)\in\mathbb{R}^{N_{\textit{task}}}$ is given by $\hat{\mathbf{y}}(t)=g(\mathbf{W}_{\textit{out}}\,\mathbf{z}(t))$, where $\mathbf{W}_{\textit{out}}$ is a readout matrix and $g=\text{sigmoid}$ the output activation function applied elementwise.

Figure: Figure 2: Data generation and architecture. (a) The task is to simultaneously report whether the ground truth $\mathbf{x}^{*}$ lies above ($1$) or below (0 0) a number of classification lines. (b) Models (RNN depicted) are trained to report the outcome of all the binary classifications in a at the end of the trial (indicated by the fixation input turning 0).
Refer to caption: extracted/5927657/Figures/Fig2.png

The encoder $f$ is a 3-layer MLP with hidden dimensions $100,100,40$ and ReLU non-linearities, and it is randomly initialized and kept fixed during training as it represents a static mapping from latents to observations (observation map). An additional fixation input is directly passed to the hidden layer. It is 1 during the trial and turns 0 at the end of the trial, indicating that the network should report its decisions (Figure 2b). The fixation input precludes the RNN from learning a specific timing in its response. We refer to this kind of tasks as fixed reaction-time (RT).
The network is trained with a cross-entropy loss and Adam default settings, except learning rate $\eta_{0}=10^{-3}$, to produce the target outputs $\mathbf{y}(\mathbf{x}^{*})$. By minimizing loss across trials, the network is incentivized to estimate $\hat{\mathbf{Y}}(t)=\Pr\{y_{i}(\mathbf{x}^{*})=1\}$. Table S1 summarizes all hyperparameters and their values, which are shared across all architectures.

## 5 Experiments

### 5.1 Multi-task learning leads to disentangled representations

We train RNNs to do simultaneous classifications for $N_{\text{task}}$ linear partitions of the latent space for $D=2$ (Figure 2a, 6 partitions shown). To quantify the disentanglement of the representations after learning, we evaluate regression generalization by training a linear decoder to predict the ground truth $\mathbf{x}^{*}$ while network weights are frozen. We perform out-of-distribution 4-fold crossvalidation, i.e. train the decoder on 3 out of 4 quadrants and test in the remaining quadrant (Section A.2 for details). We also evaluate in-distribution (ID) performance by training the decoder in all quadrants. An example of train and test losses is shown in Figure S9f. We find that the network’s OOD and ID generalization performance are excellent (median $r^{2}=0.96,0.97$ respectively across 5 example networks); therefore the network has learned an abstract representation that zero-shot generalizes OOD. In addition, ID performance increases with the number of tasks $N_{\textit{task}}$, and the OOD generalization gap decreases (Figure 3a). Therefore we conclude that multi-task learning leads to abstract representations in the RNN’s hidden layer, when tasks span the latent space.

Figure: Figure 3: Learning disentangled representations. (a) ID and OOD generalization performance for networks trained in different number of tasks $N_{\textit{task}}$. We report the 25, 50 and 75 percentile of $r^{2}$ for each network size (see Section A.2). ID and OOD performance increase with $N_{\textit{task}}$, and the generalization gap decreases, indicating that the networks have learned abstract representations. (b) The results hold for other autoregressive architectures, including LSTMs and GPT-2 transformers. (c) Angles between latent factor decoders (see Section A.3 for how they were estimated). The angles approach 90 degrees as $N_{\text{task}}\gg D$ for RNNs, but already fror $N_{\text{task}}\geq D$ for transformers. Remaining errors around 90 degrees are attributed to variability in the linear decoder fits. (d) Top 3 PCs of RNN activity ($N_{\textit{task}}=24$, $D=2$). Each line is a trial, while color saturation indicates time. All trials start from the center and move outwards, towards the location of $\mathbf{x}^{*}$ in state space. We color the last timepoint in each trial (squares) according to the quadrant this trial was drawn from. Red x’s correspond to attractors (see Section A.6). Here we remove input noise so that trajectories can be visualized easier. The network learns a two-dimensional continuous attractor that provides a disentangled representation of the 2D state space. (e) Spectral plot resulting from linearizing RNN dynamics around every fixed point (Section A.6). First two eigenvalues of the difference system are near 0 0, while the rest decay much faster, indicating marginal stability across two dimensions for every fixed point, a signature of a 2D continuous attractor.
Refer to caption: extracted/5927657/Figures/Fig3.png

Since $\mathbf{x}^{*}$ can be decoded by this representation in unseen (by the decoder) parts of the state space, it follows that the representation can be used to solve any task involving the same latent variables, without requiring further pretraining. In other words, to solve any other task we do not need to deal with the denoising and unmixing of the latent factors $x_{1}$, $x_{2}$; we would just need to learn the (potentially non-linear) mapping from $x_{1}$, $x_{2}$ to task output. Furthermore, the representation scales linearly with input dimensionality $D$ (see Figure 5b). This marks a significant improvement from previously proposed models for representation learning in the brain where one task is executed at a time [, ], which scale linearly with $N_{\textit{task}}$, and exponentially with $D$ (see Section A.7 for details). Crucially, these findings are architecture-agnostic: they hold for non-leaky ("vanilla") RNNs, which outperform leaky ones for small $N_{\textit{task}}$, LSTMs which perform the best, and GPT-2 transformers (details in Section A.5) which have excellent performance already from $N_{\textit{task}}=2$ (Figure 3b). Note that state-space models have superior asymptotic performance, which is expected due to the nature of the task. We focus on leaky RNNs because of their closer correspondence to biological neurons, which have a membrane voltage that decays over time.

So far we showcased abstractness, but not disentanglement. For disentaglement, it is crucial that the latents lie in orthogonal subspaces. Looking at the angles between the decoders of the latents, we find that they become orthogonal as $N_{\text{task}}\gg D$ for RNNs (Figure 3c), as predicted by our theory. Intriguingly, this already occurs from $N_{\text{task}}\geq D$ in transformers, showcasing their superior ability to separate latent factors. Furthermore, orthogonality strongly correlates with OOD generalization performance, which emphasizes the close link between disentanglement and abstractness: the more orthogonal the representations are, the cleaner the readout of the latent factors by linear decoders.

We further demonstrate the robustness of our setting by showing that abstract representations emerge for different noise distributions and correlated inputs (Section A.8), non-linear boundaries (Section A.9), and for cognitive neuroscience integrate-to-bound tasks where the agent can make their decision whenever confident enough, not at a fixed time [] (Section A.10).

### 5.2 Representational structure in RNNs and Transformers

In this section, we open the black box and investigate the representations learned by the networks, starting with RNNs. Figure 3d shows the top 3 PCs (capturing $\sim 85\,\%$ of the variance) of network activity after training (final accuracy $\sim 95\%$) for multiple trials, along with the fixed points of network dynamics. To find the fixed points, we follow a standard procedure outlined in Sussillo and Barak [] (see Section A.6 for details). Looking at Figure 3d the fixed points span the entire two-dimensional manifold that the trials evolve in, which corresponds to a continuous attractor with stable states across a 2D "sheet". Linearizing the dynamics around each fixed point and computing the eigenvalues of the linearized system (Section A.6 for details), reveals marginal stability across two eigenvectors, i.e. near-0 0 eigenvalues which correspond to slow, integration dimensions in network dynamics, therefore confirming the continuousness of the attractor (Figure 3e). This implies that the network can store a short-term memory [] of the current amount of accumulated evidence in a product space of the latent variables, and update it as further evidence arrives.

Furthermore, compared to the representations after the encoder which are non-linearly mixed, high-dimensional and overlapping (Figure S9a), the representation in Figure 3d looks disentangled as we would expect from the theory and metrics above. Individual trials with noise show how the representation maintains a sense of metric distances in the RNN representation space (Figure S9b). Figure S9c demonstrates how this representation comes about during learning, and Figure S9d that the short-term memory persists when a delay period is included before the decision. Therefore, multi-task learning has led to disentangled, persistent representations of the latent variables. Importantly, and in line with our theory, this only happens when noise is present in the input, which forces the network to learn a notion of distance from classification boundaries (Lemma B.3). Indeed, when the network is trained without input noise, it does not learn a 2D continuous attractor (Figure S9e).

Figure: Figure 4: RNN and GPT representations and relation to latent variables. (a) Hidden layer activations of RNN in Figure 2b (left) and GPT-2 transformer (right), while systematically varying the latent factors $x_{1}$ and $x_{2}$ from -0.5 to 0.5. Activations are plotted in 8*8 grids, one for each value of $x_{1}$ and $x_{2}$. Each grid contains firing rates for a total of 64 neurons for the RNN, and activations for 8 neurons for each of the 8 heads from the final embedding of the sequence for GPT-2. (b) Correlation coefficient of activations for both models with $x_{1}$ and $x_{2}$, respectively.
Refer to caption: extracted/5927657/Figures/Fig4.png

Finally, we examined RNN and GPT unit activations, and their relation to the latent variables. In Figure 4a we plot the steady-state firing rates for all 64 neurons for both networks, while regularly sampling $x_{1}$ and $x_{2}$. RNNs representations are sparse, with only $\sim 10\,\%$ of neurons active at any time, which is in line with sparse coding in the brain. In addition, the average firing rate is $\sim 1$ spike/s, which is surprisingly close to cortical values. Transformers on the other hand, do not have these features, shared by RNNs and their biological counterparts. Furthermore, we find that both networks display mixed selectivity, i.e. neurons are tuned to both variables, which is a known property of cortical neurons [] (Figure 4b). This suggests that metrics of disentanglement that assume that individual neurons encode distinct factors of variation [, , , , ] might be insufficient in detecting disentanglement in networks that generalize well. While recent work incorporates such axis-alignment in the definition of disentaglement, our work along with others [] showcases the advantages of approaching disentanglement from a mixed representations perspective. Importantly, these properties were not imposed during training, nor was there any parameter fine tuning involved; they emerged from task and optimization objectives.

### 5.3 Experiments confirm and extend theoretical predictions

Here we expore the relation between the theory in Section 3 and Appendix B and experiments in Section 5 in more depth. First, we wondered why performance saturates in our networks to a high yet non-1 $r^{2}$. The central limit theorem predicts that the estimate of the ground truth $\mathbf{x}^{*}$ in any optimal multi-task classifier becomes more accurate with $\sqrt{t}$, providing a theoretical maximum $r^{2}$ given trial duration $T$ (Section A.4). Since the RNNs trained on the free reaction-time (free RT) task in Section A.10 are required to output their decision confidence at any time in the trial, we can compute OOD $r^{2}$ of free RT network predictions at any timepoint $t$, and compare that to the theoretical prediction. Figure 5a shows that indeed the highest RNN $r^{2}$ falls in the vicinity of or just short of the theoretical maximum. This indicates that RNNs trained with BPTT on these tasks behave like near-optimal multi-task classifiers that create increasingly accurate predictions with time, tightening the relation between our theoretical and experimental results.

Figure: Figure 5: Experiments confirm theoretical predictions. (a) OOD $r^{2}$ for free RT RNN required to report its estimate of $\mathbf{x}^{*}$ at different times (see Section A.10 for details, $N_{\textit{task}}=24$, $D=2$). Maximum network $r^{2}$ matches optimal multi-task classifier theory predictions (Equation 8 in Section A.4). (b) OOD $r^{2}$ as a function of input dimensionality $D$ and number of tasks $N_{\textit{task}}$. Good values of $r^{2}$ are obtained when $N_{\textit{task}}\geq D$, especially for GPT models, confirming our theoretical results. (c) Increasing amounts of noise in pretraining results in better OOD generalization ($D=2$).
Refer to caption: extracted/5927657/Figures/Fig5.png

An important prediction of our theory is that to learn abstract representations, $N_{\textit{task}}$ should exceed $D$. To test this, we increase $D$ (adding more inputs to Figure 2b), while varying $N_{\textit{task}}$. Sampling classification hyperplanes homogeneously (similar to Figure 2a, center) in high-dimensional spaces is non-trivial; therefore we resort to randomly sampling them. Figure 5b shows OOD generalization performance for various combinations of $D$ and $N_{\textit{task}}$. We observe that performance is bad when the $N_{\textit{task}}<D$, but it increases when $N_{\textit{task}}\geq D$. For RNNs, this increase is abrupt for smaller $D$ and more gradual for higher, which is in line with remarks by Johnston and Fusi [] that it is easier to learn abstract representations when $D$ is high. Transformers on the other hand display higher generalization performance than RNNs, and always perform almost perfectly when $N_{\textit{task}}\geq D$, demonstrating their superior performance in learning abstract representations. Looking at the angles between latents for higher $D$ (Figure S10), we find that transformers have excellent disentanglement as long as $N_{\textit{task}}\geq D$, which might explain their superior generalization performance to RNNs for lower $N_{\textit{task}}$. These results, together with Figure 3c demonstrate the superior ability of transformers in disentangling latent factors. Overall, our findings confirm our theory that abstract representations emerge when $N_{\textit{task}}\geq D$, and even go beyond to suggest that disentangled representations emerge earlier than the theoretical condition $N_{\textit{task}}\gg D$, as long as the architecture is appropriate. These results are remarkable, especially for high $D$, because they go against our intuition that $N_{\textit{task}}$ should scale exponentially with $D$ to fill up the space adequately; instead it need only scale linearly.

##### Importance of noise for generalization

Our theory and experiments provide insight on the importance of noise for developing efficient, abstract representations (Figure S9e). The closer to a classification boundary the ground truth $\mathbf{x}^{*}$ is, the more likely noise will cross over the boundary. Since, as our theory shows, any optimal multi-task classifier has to estimate $\Pr\{y_{i}(\mathbf{x}^{*})=1\}$, and said probability directly relates to the actual distance from the boundary, it follows that noise allows the model to learn distances from boundaries (Lemma B.3)), leading to efficient localization. We reasoned that additional noise might be even more beneficial, as it would allow more accurate estimation of $\Pr\{y_{i}(\mathbf{x}^{*})=1\}$, especially when $\mathbf{x}^{*}$ is far from the boundary. To test this, we increase noise strength $\sigma$ when pretraining RNNs, while testing with the same $\sigma=0.2$. Indeed, increasing amounts of noise consistently result in better OOD generalization (Figure 5c). This benefit comes for smaller numbers of tasks, allowing us to consider less supervised tasks (e.g. 3), train on them with more noise, and achieve the same performance as more tasks (e.g. 12). So even though networks with more noise perform worse in pretraining (low 90%s classification accuracy), they learn more abstract representations. These findings are highly non-trivial, and have informed our thinking about generalization and inherent variability of the underlying latent factors.

## 6 Discussion

In this work, we proved that disentangled, generalizable representations must emerge in agents optimally solving multi-task evidence accumulation tasks canonical in the neuroscience literature. We also conducted experiments in a suite of autoregressive models (RNNs, LSTMs, transformers) which confirmed all of the main theoretical predictions. A key takeaway is that transformers more readily disentangle representations, which may explain their unique world understanding abilities.

### 6.1 Implications for representation learning

##### Topology-preserving representation learning

Our work has profound implications for learning representations that inherit the topological structure of the world. We prove this naturally happens as long as there are enough tasks to uniquely identify the location of $\mathbf{x}^{*}$. Crucially, the constraints from different tasks should be placed simultaneously on the representation, which explains why representations from context-dependent computation [] are typically not disentangled.

##### Representational alignment across individuals

Our results provide a new perspective on the Platonic representation hypothesis [], which suggests that the convergence in deep neural network representations is driven by a shared statistical model of reality, like Plato’s concept of an ideal “Platonic” reality.
Theorem 3.1 suggests that the key factor driving convergence is the diversity and comprehensiveness of the tasks being learned.
As long as individuals are faced with similar day-to-day tasks that collectively span the space of the underlying data representation, convergence to a shared, reality-aligned representation can occur. This could explain why for example modern LLMs come to encode high-level, human-interpretable concepts [].

##### Manifold hypothesis

While our problem is framed in terms of arbitrary injective observation map $f$, the formulation encompasses many scenarios relevant to the manifold hypothesis [].
The function $f$ can represent a smooth manifold embedded in a high dimensional space, directly modelling the manifold hypothesis of deep learning.
In neuroscience, $f$ could be a non-linear encoding of stimuli in a neural population response, connecting our work to neural manifold research [].
By developing and testing theoretical guarantees for the emergence of disentangled representations in this multi-task problem formulation, we provide insight on how neural networks can inherently discover and linearize low-dimensional manifolds within high-dimensional, non-linear observations, enhancing our understanding of how complex data structures are captured and represented in deep learning models and biological systems alike.

##### Interplay between number of tasks and fine-grainness of representations

Finally, the theorem and experimental results provided here are not a one-way-street from dimensionality $D$ of the latents to how many tasks $N_{\text{task}}$ are required to uncover them. Instead, there is a fundamental interplay between richness of tasks performed and detail of the representation learned. In a high-dimensional world, the richness of the tasks at hand directly affects the dimensionality $D$ of the latents that can be extracted, allowing for "ground truths" $\mathbf{x}^{*}$ at different levels of granularity to be explored. The richer the label information available, the more fine-grained the resulting world model will be.

### 6.2 Limitations

A limitation of the present work is that factorization is assumed. Yet not all problems are factorizable, or should be factorized. For instance, a more coarse-grained understanding of the world, that doesn’t disentangle all factors, might be more suitable in many cases, and that might be reflected in the nature of the tasks. Furthermore, we focus on canonical cognitive neuroscience tasks which are somewhat removed from standard ML benchmarks. Normally, disentanglement methods would be tested against a benchmark such as dSprites []; however to the best of our knowledge no such benchmark exists for sequential tasks where evidence has to be aggregated over time. Future work could endeavor to apply our setting to richer tasks, like extracting latent item attributes from item embeddings when sequential decisions are made in online retailer settings.

### 6.3 Implications for neuroscience

The brain encodes variables of interest in a disentangled format, in processes as disparate as memory [], emotion [], and decision making []. Furthermore, performance in tasks has been shown to degrade once abstract representations collapse [], supporting their role in guiding generalizable behavior. Given our findings, and that the cortical architecture is uniquely suited for parallel processing [], the cortex is a prime candidate area for the construction of disentangled world models. Another such area is the thalamus; it is posited that thalamocortical loops operate in parallel, and combined with internal state-dependent mechanisms lead to state-dependent action selection (e.g. prioritizing water when thirsty), while evidence integration occurs in corticostriatal circuits []. The representations discovered here (continuous attractors, CANs) have been widely found in the brain when solving similar tasks, highlighting their role as a general computational substrate for cognitive functions in the brain (for relations of our work to the neuroscience literature, see Section A.11). The algorithmic efficiency of multi-task learning compared to alternatives (“context-dependent computation”, Mante et al. [], Section A.7), makes us think that it is no coincidence that the cortex can support parallel processing; all the pieces are there, and we feel that the brain has to leverage this feature to construct faithful models of the world, as it does.

## Acknowledgments and Disclosure of Funding

PV would like to thank the Onassis Foundation and AR the NOMIS Foundation for funding.
AB thanks the NIH PTQN program for funding.
No competing interests to declare. We would like to thank Yisong Yue for early discussions, Stefano Fusi for early feedback and Aiden Rosebush for discussions of proof methods.

## Appendix A Supplementary materials

### A.1 Definitions

In the main text we used the terms "abstractness" and "disentanglement". Since there exists some ambivalence about their meaning in the literature, we would like to strictly define them here. We will be using definitions adapted from Ostojic and Fusi []:

- •
Abstract representation of $x_{1},\dots,x_{n}$ represents each $x_{i}$ linearly and approximately mutually orthogonally.
Thus, abstractness ensures a simple linear map can decode each $x_{i}$ regardless of variation in $x_{j\neq i}$.
- •
Disentangled representations of $x_{1},\dots,x_{n}$ encode each $x_{i}$ orthogonally, without the necessity of linearity.

Note that under this definition, axis-alignment is not a requirement for disentanglement (also see Higgins et al. []). Our work suggests that the computer science and neuroscience communities should adopt this broader definition of disentanglement, because otherwise we might be missing cases where the factors are not axis-aligned, but they are still orthogonal and can still be isolated by a linear decoder. Our argument is that there is nothing special about individual factors being encoded by individual neurons. Rather, we think that allowing for mixed representations within the definition of disentanglement leads to a more holistic view of disentanglement. A contribution of this work, along with others [], is to bring this argument to the forefront.

### A.2 Quantification of generalization performance

To assess OOD generalization performance, we keep the trained networks fixed and train a linear decoder $\mathbf{A}$ to predict the ground truth $\mathbf{x}^{*}$ from network activity at the end of the trial. We train the decoder in 3 out of 4 quadrants and test OOD in the remaining quadrant, repeating this process 5 times for each quadrant, which results in a total of 20 OOD $r^{2}$ values for each network. To account for randomness in initialization and sythetic generation of datasets, we train 5 networks for each combination of number of tasks $N_{\text{task}}$ and dimensionality $D$, resulting in a total of 100 OOD $r^{2}$ values for each pair of $(N_{\text{task}},D)$. We report the 25, 50 (median) and 75 percentiles of those values in Figure 3a,b and throughout the text. For ID generalization performance, we train on all quadrants and test in one quadrant at a time. For input dimensionality $D>2$, we keep the same logic by choosing every 4-th quadrant to be sampled only in testing, repeating the process for every $\textit{mod}\,4$ group of quadrants.

### A.3 Estimation of angles between latent factors

To estimate the angles between latent factors in the representation, we obtain the normal vectors of the decoders $\mathbf{A}$ for each of the latents, and compute pairwise angles for all of them. To account for variability in the decoder fits, we repeat the decoder fit 5 times for each out-of-distribution region (see Section A.2 for details). We also repeat this process across 5 trained networks for each combination of $(N_{\text{task}},D)$, and report the 25, 50 (median) and 75 percentiles of all values for each $(N_{\text{task}},D)$ combination in Figure 3c and Figure S10.

### A.4 Derivation of theoretical r 2 superscript 𝑟 2 r^{2} italic_r start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT for optimal multi-task classifiers

Here we derive the theoretical $r^{2}$ for the estimation of ground truth $\mathbf{x}^{*}$ from noisy data for a discrete time optimal multi-task classifier at time $t$. $r^{2}$ is defined as:

$$ $r^{2}=1-\frac{\textit{MSE}(\mathbf{x}^{*},\mu)}{\textit{Var}(\mathbf{x}^{*})}$ (7) $$

where $\mu$, the mean of $\mathbf{X}(1),\dots,\mathbf{X}(t)$, is the prediction of the multi-task classifier (see Appendix B).
The optimal estimator of $\mathbf{x}^{*}$ given observations $\mathbf{X}(1),\dots,\mathbf{X}(t)$ is denoted $\hat{\mathbf{X}}(t)\sim\mathcal{N}(\mu(t),t^{-1}\sigma^{2}I_{D})$ where $\sigma$ is the noise strength.
Note that $\mu(t)\to\mathbf{x}^{*}$ as $t\to\infty$ by the central limit theorem, and $\mu(t)$ is the optimal estimator of $\mathbf{x}^{*}$ given Gaussian-noised observations.
Since the dimensions in both noise and ground truth are independent, we can focus on one dimension at a time i.e.:

$$ $r^{2}=1-\frac{\textit{MSE}(x^{*}_{i},\mu_{i}(t))}{\textit{Var}(x^{*}_{i})}=1- \frac{\mathop{\mathbb{E}}[(x^{*}_{i}-x^{*}_{i}+\mathcal{N}(0,t^{-1}\sigma^{2}) )^{2}]}{Var(x^{*}_{i})}=1-\frac{\sigma^{2}}{t\,Var(x^{*}_{i})}.$ (8) $$

Remembering that $x^{*}_{i}\sim\textit{Uniform}(-0.5,0.5)$ it follows that $Var(x^{*}_{i})=\frac{2}{3}0.5^{3}$, and replacing $\sigma=0.2$ from Table S1 we arrive to $r^{2}=1-\frac{0.48}{T}$ for given trial duration $T$ which we compare to RNN OOD generalization performance in Figure 5a.

### A.5 GPT-2 experiments

We train GPT-2 causal transformers with $d_{\textit{model}}=N_{\textit{neu}}=64$, $N_{\textit{layer}}=1$, $N_{\textit{head}}=8$ in the multi-task classification task of the main text. The networks receive continuous, noisy and non-linearly mapped inputs $f(\mathbf{X}(1)),\dots,f(\mathbf{X}(t))$, and should output multi-task classifications $\mathbf{y}(\mathbf{x}^{*})\in\{0,1\}^{N_{\textit{task}}}$. The output of the network is $\hat{\mathbf{Y}}(t):=g(\mathbf{Z}(t))$, where $\mathbf{Z}(t)$ is the last embedding of the sequence in the last layer and $g=\text{sigmoid}$. Since the input is continuous, we omit the tokenization and embedding steps, and project the input directly to the hidden state with a linear map. Furthermore, since the inputs are IID, we do not include positional encodings. The networks are trained with binary cross-entropy loss for $N_{\textit{batch}}=2*10^{4}$ batches, while the rest of the parameters are identical to the fixed RT networks of the main text (Table S1).

### A.6 Finding fixed points and linearization of dynamics

To find approximate fixed points of RNN dynamics after training, we follow a standard procedure outlined in Sussillo and Barak []. Specifically, we keep network weights fixed, provide no inputs to the network, and instead optimize over hidden activity. Specifically, we penalize any changes in the hidden activity, motivating the network to find stable states of the dynamics in the absence of input, i.e. attractors of the dynamics. This process finds all states of accumulated evidence that can be stored in this network as short-term memory. Network dynamics could then leverage these states to maintain and update the internal representation of the ground truth $\mathbf{x}^{*}$ on a single trial level, and drive downstream decisions.

Then for every approximate fixed point $\mathbf{z}^{f}$, we linearize RNN dynamics around it and estimate the eigenmodes which describe how the system behaves in a small region $\delta\mathbf{z}$ around $\mathbf{z}^{f}$. Specifically, following Sussillo and Barak [], Mante et al. [] we take the difference system $\delta\mathbf{z}(t+t_{0})=\mathbf{z}(t+t_{0})-\mathbf{z}(t_{0})$ and linearize it, i.e.

$$ $\dot{\delta\mathbf{z}}=\mathbf{F}^{\prime}(\mathbf{z}^{f})\,\delta\mathbf{z}$ (9) $$

where $\dot{\mathbf{z}}=\mathbf{F}(\mathbf{z})$ is the function describing the RNN dynamics and $\mathbf{M}\equiv\mathbf{F}^{\prime}(\mathbf{z}^{f})$ is its Jacobian at $\mathbf{z}^{f}$. To estimate $\mathbf{F}^{\prime}(\mathbf{z}^{f})$, we let network dynamics run in the absence of inputs for one time step $\Delta t$ starting from $\mathbf{z}^{f}$, i.e. $\delta\mathbf{z}(\Delta t)=\mathbf{z}(\Delta t)-\mathbf{z}^{f}$, and autodifferentiate $\delta\mathbf{z}(\Delta t)$. We then perform eigendecomposition of $\mathbf{M}$ and report the eigenvalues around each approximate fixed point. Eigenvalues near 0 0 indicate that the difference system $\delta\mathbf{z}(t)=\mathbf{z}(t)-\mathbf{z}^{f}$ changes slowly over time, i.e. they correspond to "slow" dimensions in network dynamics which can integrate inputs and maintain them over time (continuous attractors) [, ].

### A.7 State-space efficiency of context-dependent computation

The workhorse model for computational neuroscience has been context-dependent computation, where tasks are carried out one at a time and task identity is cued to the RNN by a one-hot vector []. However, this approach can be algorithmically inefficient, because as we show here it scales linearly with the number of tasks $N_{\textit{task}}$, and exponentially with input dimensionality $D$. This is because context-dependent computation utilizes different parts of the state space for different tasks, and the resulting representations collapse to what is minimally required for each task (also see [, ]). This can be detrimental for brains, which need to pack a lot of computation within a large yet limited neural substrate. In contrast, abstract representations are general, compact [], can be used for any downstream task involving the same variables, scale linearly with $D$, and as we show readily emerge from relatively simple tasks.

To compare context-dependent decision making, where one task is performed at a time [], to multitasking, in terms of state-space usage efficiency, we train RNNs to perform context-dependent decisions on the same tasks encountered in the main text. Compared to the network in the main text (Figure 2b), the RNN now also receives a one-hot task rule vector indicating the current task, and it outputs the decision for that task only (Figure S1b). We have also omitted the non-linear encoder, making the tasks easier. We train the RNN for two tasks, one task at a time, in interleaved batches (Figure S1a). In one task, the RNN is required to decide which stream has more evidence, and at the other whether the sum of evidence across streams exceeds a certain decision threshold (here 0).

Figure: Figure S1: Representations in an RNN trained in context-dependent decision making. (a) We trained RNNs for two classification tasks: two-alternative forced choice (where the decision boundary is the $x_{1}=x_{2}$ line) and evidence integration (corresponding to the $x_{1}=-x_{2}$ line). Each task corresponds to a different one-hot task rule vector. (b) Network architecture. In addition to the inputs in Figure 2b, the network also a one-hot vector indicating the current task. (c), Top 3 PCs of RNN activity example trials (40 in total). The task rule biases the network towards learning separate solutions in different parts of the state space for different tasks, in the form of separate line attractors; red x’s for two-alternative forced choice and orange x’s for evidence integration.
Refer to caption: extracted/5927657/Figures/FigS1.png

We find that in this setting the network is not incentivized to learn abstract representations. Instead a separate line attractor is present in the dynamics for each task (red and orange x’s in Figure S1c); one of them is presumably tracking the difference of evidence (similar to Yang and Wang [] but for independent evidence streams) and the other the sum of evidence. That is to say, the task rule biases the network to learn different computations in separate regions of state space, as in Mante et al. []. As a result, the 2D latent space has collapsed and cannot be decoded from network activity; therefore generalization to any task that involves these two variables is not possible.

It follows that the network can be inefficient in terms of state space usage, because instead of compressing all of its activity around the same region, it spreads it across multiple regions, one for each task, which scales badly (linearly with the number of tasks $N_{\textit{task}}$ and exponentially with input dimensionality $D$). To demonstrate the latter, imagine a family of tasks with classification boundaries of the form $\oplus\,x_{1}\oplus x_{2}\oplus..\oplus x_{D}=0$, where $\oplus\in\{+1,-1,0\}$ is an operator indicating contribution with a positive sign, negative sign or absence of contribution for a factor to a specific task, respectively. As just shown, each one of this tasks will require its own line attractor, resulting in a total of $3^{D}$ line attractors lying in separate regions of the state space, just for this simple family of tasks. As mentioned in the main text, such inefficiency can be detrimental for brains, which need to pack a lot of computation within a large yet limited neural substrate. Compare that to multitasking, which builds representations that can serve any task that involves the same latent variables, scaling linearly with $D$ (as we saw that we only need $N_{\textit{task}}\geq D$ to learn them). Note that context-dependent computation can still be efficient, if tasks have a compositional structure where the solution for one task is part of the solution for another [, ]; in this case, representations developed for the former can act as a scaffold for representations for the latter.

Overall, we believe that multitasking may present a paradigm swift for generalizable representation learning in biological and artificial systems alike. That is not to say that context-dependent representations are not useful; they are great at leveraging the compositional structure of tasks [, ], but tend to overfit to the specifics of the task, while multitask representations serve as world models applicable to various scenarios. Both types of representations are likely to be found in the brain.

### A.8 Robustness to other noise distributions and correlated inputs

We here show that our setting is robust to Gaussian anisotropic and autocorrelated noise, and other asymmetric distributions of noise (Gumbel) whose CDF no longer matches the sigmoid functions in shape, with almost no drop in performance, and correlated inputs. This demonstrates that abstract representations are also learned outside of the specific assumptions made by our theory.

Starting from anisotropic noise, we observe that doubling the standard deviation of noise across one dimension ($\sigma=0.4$) does not result in a reduction in OOD generalization performance (median $r^{2}=0.96$ for $N_{\textit{task}}=24$, $D=2$). This is in line with our theory that can be extended to cover anisotropic noise (Lemma B.10). Non-IID noise should not be a problem either, since we are training our network for many samples and the effects of correlations will cancel out over long ensembles. Indeed, we find that including autocorrelated AR(1) noise with an AR coefficient of 0.7 results in only minor reduction in performance (median $r^{2}=0.95$ for $N_{\textit{task}}=24$, $D=2$).

We were also curious to see the impact of correlated inputs. A problem with high correlations is that they render parts of the state space virtually invisible to the network (Figure S2a). Surprisingly, OOD generalization performance is very weakly affected by input correlations, even though the state space is sampled uniformly in test (Figure S2b). The behavior is highly non-linear: performance is great until $\rho=0.97$, but for perfectly correlated inputs ($\rho=1$), the performance drop is sharp.

Figure: Figure S2: Disentanglement and factor correlations. (a) We introduce strong correlations in the latent factors, rendering parts of the state space virtually invisible to the network during pre-training (trained for a total of 24 classification tasks). (b) Despite that, generalization performance is excellent for correlations very close to 1. Once the factors are perfectly, performance drops significantly. This implies that the network can learn an abstract representation from correlated inputs, as long as there is some signal about the factors independently. This finding goes beyond [] to show that the multi-task learning setting allows OOD generalization when the distribution during training the RNN itself is vastly different that the one during testing.
Refer to caption: extracted/5927657/Figures/FigS4.png

Finally, our theory pointed out sigmoid functions as a choice for activation function because of their close resemblance to the Gaussian CDF, resulting in the best OOD $r^{2}$. Still we find that for an asymmetric noise distribution (Gumbel) whose CDF does not match sigmoid functions well, there is only a slight drop in performance (median $r^{2}=0.95$ from $0.96$). Therefore the conditions for the activation function/CDF should be quite lax; any monotonic bijective function should work with small performance drop. This drop in performance is because the representation would be “stretched out” and “compressed” in a non-linear manner in regions where there is discrepancy between the noise CDF and the activation function. But this nonlinear squishing (determined by the term $\Phi^{-1}(g(\mathbf{Z}(t)))$) would be geometrically inoffensive — no cutting or gluing together would be required to map from $\mathbf{Z}(t)$ to a linear representation of $\mu(t)$. As a result, the representations would remain approximately linearly decodable.

### A.9 Nonlinear classification boundaries and interleaved learning

In the main text we trained networks on linear classification boundaries. The tasks are still non-linear, since the encoder renders these boundaries non-linear to the network. However, there are cases where the latent factors themselves might need to be combined non-linearly, to make decisions. For instance, if the two factors represent the amount and probability of reward respectively, an agent needs to multiply the two and decide whether the expected value exceeds a certain (metabolic) cost $\gamma$ of performing an action to obtain said reward. Figure S3a shows the classification lines for the multiplicative task, where the network should decide whether the ground truth $\mathbf{x}^{*}$ lies above or below the curve $x_{1}\,x_{2}=\gamma$, for multiple values of $\gamma$. This family of tasks is not covered by Theorem B.6, because they violate the injectivity condition. Hence, we wondered how the representation would look like if the network was trained on both the linear and multiplicative boundaries, as animals do.

Figure: Figure S3: Interleaved learning of linear and non-linear boundaries. (a) Classification lines for the multiplicative task. There is a total of 48 classification lines, 12 per quadrant. (b) The network learns an abstract representation when trained for the linear and multiplicative boundaries in interleaved batches.
Refer to caption: extracted/5927657/Figures/FigS5.png

For that we perform interleaved training of both tasks (i.e. train in batches sampled from one of the tasks at a time), a setting where neural networks excel at, compared to humans who excel at blocked training, where tasks are learned sequentially (but see Flesch et al. []). Figure S3b shows that the network still learns a disentanlged, two-dimensional continuous attractor. OOD generalization for this network is excellent, and almost identical to ID performance (median $r^{2}=0.94,0.97$ respectively). Overall, we conclude that our framework extends to interleaved learning of a mixture of linear and nonlinear boundaries, which better reflects the challenges encountered by agents in the real world. Note that during interleaved training, linear and non-linear tasks are not performed simultaneously; yet they are in immediate succession which can also place pressure to the network to gradually learn representations that satisfy all tasks. The relation between multi-task and interleaved learning is a promising topic for future research.

### A.10 Abstract representations are learned for a free reaction time, integrate to bound task

In the main text we trained networks to produce a response at the end of the trial. However, in many situations agents are free to make a decision whenever they are certain enough. Therefore, we here seek to extend our framework to free reaction time (RT) decisions. A canonical model accounting for choices and reaction times in humans and animals is the drift-diffusion model [, ]. It is composed of an accumulator that integrates noisy evidence over time, until a certain amount of certainty, represented by a bound, is reached, triggering a decision. In the linear classification task setting, the accumulated amount of evidence at time $t$ for a line with slope $\alpha$, $A_{\alpha}(t)$ is given by:

$$ $A_{\alpha}(t)=A_{\alpha}(t-1)+X_{1}(t)-\alpha\,X_{2}(t)$ (10) $$

Figure: Figure S4: Free reaction time task. (a) Data generating process. Every classification line from Figure 2a now corresponds to an accumulator (see corresponding colors), and the desired output for the RNN is the accumulator values for the entire trial. The accumulator is quantized to integer values between $\pm 5$. (b) Representation for RNN trained on free reaction time task. The network learns a two-dimensional continuous attractor, similar to Figure 3d. A 3D rotating figure to better visualize this representation is provided in the Supplementary Material. (c) OOD generalization performance for the free reaction time (RT) task. Free RT outperforms fixed RT for a small number of tasks.
Refer to caption: extracted/5927657/Figures/FreeRT.png

Intuitively, $A_{\alpha}(t)$ reflects the amount of confidence at time $t$ that the ground truth $\mathbf{x}^{*}$ lies above or below the classification line with slope $\alpha$. Essentially, the network has to explicitly report distance from the classification lines, not just in which side of the line $\mathbf{x}^{*}$ lies for that trial. We set the decision bound to $\pm 5$, and plot the accumulators $A_{\alpha}$ for all lines in Figure S4a. Note that once the bound is reached a decision is effectively made and $A_{\alpha}$ is kept constant. Also, instead of using continuous values, we quantize $A_{\alpha}$, because it is going to be used as target signal to train the network, and we do not want to introduce a strong inductive bias towards integrating the evidence streams.

We then train the RNN to reproduce confidence estimates from Figure S4a for the entire trial. Compared to previous experiments, the fixation input is no longer available to determine when to produce a decision. Instead, decisions evolve dynamically throughout the trial. We also use a MSE loss, change the activation function to $g=5\tanh$, and the Adam learning rate $\eta_{0}=3*10^{-3}$, but all other parameters remain the same as in the main text. To have a closer correspondence to the free RT experiments here, we also train the fixed RT task from the main text with MSE loss, symmetric labels $\mathbf{y}(\mathbf{x}^{*})\in\{-1,+1\}^{N_{\textit{task}}}$ and output non-linearity $g=\tanh$. We find that the change of objective and loss only has minor effects on generalization performance.

Figure S4b shows that in this setting the network still learns a two-dimensional continuous attractor of the latent space. Furthermore, the free RT outperforms the fixed RT network from the main text (Figure S4c) for a small number of tasks, since it is explicitly required to report distance from the classification lines. However, as our theory shows (Lemma B.3)) the fixed RT network is also implicitly reporting distance from the boundaries, when behaving like an optimal multi-task classifier, which explains the similar performance for a larger number of tasks. Overall, we showed that our setting accounts for naturalistic free RT decisions, and provides theoretical justification for the importance of confidence signals in the brain [, ].

### A.11 Relation to neuroscience literature

An ongoing debate in the brain sciences is whether to solve tasks the brain learns abstracts representations, or simple input-output mappings. Here we show that training RNNs to multitask results in shared, disentangled representations of the latent variables, in the form of continuous attractors.
In this multitask setting, one task acts as a regularizer for the others, by not letting the representation collapse, or overfit, to specific tasks [].

Our findings directly link to two important neuroscientific findings: spatial cognition and value-based decision-making. First, the tasks here bear close resemblance to path-integration, i.e. the ability of animals to navigate space only relying on their proprioceptive sense of linear and angular velocity [, , ]. In path-integration animals integrate velocity signals to get location, while here we integrate noisy evidence to get rid of the noise. In path-integration, networks have to explicitly report distances, while in our setting distances are estimated implicitly (Lemma B.3)). We learn abstract representations in the form of a 2D "sheet" continuous attractor, while the computational substrate for path integration is a 2D toroidal attractor [, ] – not an abstract representation. The conditions under which a 2D sheet vs. toroidal continuous attractor is learned is a potential area of future research. Second, decision making experiments in monkeys result in a 2D abstract representation in the medial frontal cortex, which supports novel inferential decisions []. Likewise, context-dependent decision-making experiments in humans also resulted in orthogonal, abstract representations [].

## Appendix B Theoretical Derivations

Here we prove our main theoretical result outlined in Section 3.

Notation: lower case variables denote scalars (e.g., $x$), upper case variables denote random variables (e.g., $X$), and boldfaced variables denote vector quantities (e.g., $\mathbf{x},\mathbf{X}$).
We denote the $D\times D$ identity matrix as $\mathbf{I}_{D}$.

Figure: Figure S5: Bayesian graphical model framework representing our theoretical framework for multi-task classification. The agent with latent state $\mathbf{Z}(t)$ estimates the ground truth decision output $\mathbf{y}(\mathbf{x^{*}})\in\{0,1\}^{N_{\text{task}}}$ from noisy observations $\mathbf{X}(t)$ transformed by injective observation map $f$. We prove that latent state $\mathbf{Z}(t)$ must encode an optimal, linearly decodable estimate of the de-noised environment state $\mathbf{x^{*}}$ when the decision boundary normal vectors $\{\mathbf{c}_{i}\}_{i=1}^{N_{\text{task}}}$ span $\mathbb{R}^{D}$.
Refer to caption: extracted/5927657/Figures/FigS2.png

##### Variable Glossary:

- •
$\mathbf{x}^{*}\in\mathbb{R}^{D}:$ Ground truth (un-noised) input variable of dimension $D$.
- •
$\mathbf{X}(t)\sim\mathbf{x}^{*}+\sigma\mathcal{N}(\mathbf{0},\mathbf{I}_{D})$ are i.i.d. noisy measurements of $\mathbf{x}^{*}$, where
–
$\sigma$ is the amount of equivariant Gaussian noise, and
–
$t$ is the discrete time index within a trial.
- •
$f:\mathbb{R}^{D}\to\mathcal{Z}:$ An injective observation map that transforms the noisy measurements $\mathbf{X}(t)$ before they reach the latent state $\mathbf{Z}(t)$ of the optimal estimator. The map $f$ is injective, meaning that it preserves the uniqueness of the input, i.e., if $f(\mathbf{x}_{1})=f(\mathbf{x}_{2})$, then $\mathbf{x}_{1}=\mathbf{x}_{2}$. The codomain $\mathcal{Z}$ can be any suitable space, such as $\mathbb{C}^{M}$, $\mathbb{R}^{\infty}$, or other spaces.
- •
$N_{\textit{task}}$ is the number of classification tasks,
- •
$\{(\mathbf{c}_{i},b_{i})\}_{i=1}^{N_{\textit{task}}}$ are the classification boundary normal vectors and offsets respectively, with $\mathbf{c}_{i}\in\mathbb{R}^{D}$ and $b_{i}\in\mathbb{R}$. We assume each $\|\mathbf{c}_{i}\|=1$.
- •
$(\mathbf{C},\mathbf{b})$ are a matrix and vector representing each of the $N_{\textit{task}}$ classification tasks where $\mathbf{C}\in\mathbb{R}^{N_{\textit{task}}\times D}$
- •
$\mathbf{y}(\mathbf{x}^{*})\in\{0,1\}^{N_{\textit{task}}}:$ Ground truth classification outputs, where each ground truth classification $y_{i}(\mathbf{x}^{*})$ is given by
$y_{i}(\mathbf{x})=\begin{cases}1&\text{ if }\mathbf{c}_{i}^{\top}\mathbf{x}>b_
{i}\\
0&\text{ otherwise }\end{cases}$
(11)
- •
$\mathbf{Z}(t):$ Latent variable of a multi-task classification model, conditional on $\mathbf{X}(1),\dots,\mathbf{X}(t)$.
- •
$g:$ Map from latent state $\mathbf{Z}(t)$ to multi-task classification estimates $\hat{\mathbf{Y}}(t)$. For most of our experiments, readout map $g=\text{sigmoid}$, for instance.
- •
$\hat{\mathbf{Y}}(t):=g(\mathbf{Z}(t))\in[0,1]^{N_{\textit{task}}}:$ Output vector of the multi-task classification model at time $t$, where each $\hat{Y}_{i}(t)$ is a Bernoulli random variable estimating the conditional probability $\Pr\{y_{i}(\mathbf{x}^{*})=1\}$ given the noisy observations (via latent variable $\mathbf{Z}(t)$ – see Equation 12).
- •
$\hat{\mathbf{X}}(t)=\mathcal{N}(\mu(t),\Sigma(t)):$ Optimal estimate of $\mathbf{x}^{*}$ given measurements $\mathbf{X}(1),\dots,\mathbf{X}(t)$, derived in Lemma B.1.

##### Problem Statement:

We consider optimal estimators of $\mathbf{y}(\mathbf{x}^{*})$ in the multi-classification paradigm in Equation 12, shown graphically in Figure S5.

$$ $\mathbf{x}^{*}\to{\mathbf{X}(1),\dots,\mathbf{X}(t)}\overset{f}{\to}\mathbf{Z} (t)\overset{g}{\to}\hat{\mathbf{Y}}(t)$ (12) $$

##### Contribution:

We prove in Theorem B.6 (“Optimal Representation Theorem”) that any optimal estimator of $\mathbf{y}(\mathbf{x}^{*})$ described above will represent an optimal estimate of $\mathbf{x}^{*}$ in latent state $\mathbf{Z}(t)$.
We begin by proving results on optimal estimators in Sections B.1, B.2 with identity observation map $f$, developing the linear case of the optimal representation theorem (Theorem B.5) showing that the latent state $\mathbf{Z}(t)$ must encode an estimate of $\mathbf{x}^{*}$ (visualized in Figure S6).
We generalize this result any injective observation map $f$ in Section B.3 and derive closed-form solutions for extracting the estimate of $\mathbf{x}^{*}$ from $\mathbf{Z}(t)$.
We derive approximation results for $g=\tanh$ in Corollary B.7 and $g=\text{sigmoid}$ in Corollary B.8 that show the representation of $\mathbf{x}^{*}$ in $\mathbf{Z}(t)$ will be linear-affine decodable if $g$ is in the sigmoid family of functions.

Figure: Figure S6: An overview of the classification process using an RNN with Gaussian noisy observations. The ground truth $\mathbf{x}^{*}$ generates the noisy observations $\{\mathbf{X}(1),...,\mathbf{X}(t)\}$. These observations are processed by the filter-based model illustrated graphically in Figure S5, maintaining a latent state $\mathbf{Z}(t)$. The latent state $\mathbf{Z}(t)$ is then used to produce classification outputs $\hat{Y}_{1}(t)$ and $\hat{Y}_{2}(t)$. Theorem B.6 proves that $\mathbf{Z}(t)$ must encode an estimate of $\mathbf{x}^{*}$, visualized in this figure, shown as $\hat{\mathbf{X}^{*}}$, including its mean $\mu(t)$, which is the optimal estimator for $\mathbf{x}^{*}$ given the noisy observations.
Refer to caption: x1.png

### B.1 Single Decision Boundary

First, we will derive $\hat{Y}(t)$ for a single decision boundary with parameters $(\mathbf{c},b)$.
We focus on $P(\hat{Y}(t)|\mathbf{X}(1),\dots,\mathbf{X}(t))$, reintroducing the latent variable $\mathbf{Z}(t)$ later on.

Since $y(\mathbf{x}^{*})$ is a deterministic function of non-random variable $\mathbf{x}^{*}$, we will derive the probability distribution over $P(\mathbf{x}^{*}|\mathbf{X}(1),\dots,\mathbf{X}(t))$ – denoted $\hat{\mathbf{X}}(t)$ – to determine $\hat{Y}=y(\hat{\mathbf{X}}(t))$.
(^2^22Note that the intermediate computation of $\hat{\mathbf{X}}(t)$ does not imply that a system must compute this value to predict $\hat{Y}$, as the full computation of $\hat{\mathbf{X}}(t)$ may not be necessary to determine $\hat{Y}(t)$.)

###### Lemma B.1 .

Assuming no prior on $\mathbf{x}^{*}$, the conditional probability distribution $\hat{\mathbf{X}}(t)\sim P(\mathbf{x}^{*}|\mathbf{X}(1),\dots,\mathbf{X}(t))$ is given by

$$ $\hat{\mathbf{X}}(t)=\mathcal{N}(\mu(t),\Sigma(t))$ (13) $$

where $\mu(t)=\text{mean}(\mathbf{X}(1),\dots,\mathbf{X}(t))$ and $\Sigma(t)=t^{-1}\sigma^{2}\mathbf{I}_{D}$.

###### Proof.

Since $\mathbf{X}(1),\dots,\mathbf{X}(t)$ are i.i.d. from a Gaussian distribution with mean $\mathbf{x}^{*}$ and identity covariance, the sample mean is known to be distributed normally centered at the ground truth $\mathbf{x}^{*}$.
We apply the known standard deviation of the underlying distribution (identity covariance scaled by $\sigma$) to arrive at $\Sigma(t)=t^{-1}\sigma^{2}\mathbf{I}_{D}$ as the variance on the sample mean (derived from the central limit theorem).
∎

We can use estimator $\hat{\mathbf{X}}(t)$ to construct $\hat{\mathbf{Y}}(t)$ by expanding $\hat{\mathbf{Y}}(t)=y(\hat{\mathbf{X}}(t))$ via Equation 11.

In essence, we are interested in the amount of the probability density of $\hat{\mathbf{X}}$ that lies on each side of the decision boundary.
Deriving this probability is simplified by the fact that $\hat{\mathbf{X}}$ is isotropic – i.e., it inherits the spherical covariance of the underlying data generation process (Lemma B.2).

###### Lemma B.2 .

$\hat{\mathbf{X}}(t)=\mathcal{N}(\mu(t),\Sigma(t))$ with isotropic covariance $\Sigma(t)=t^{-1}\sigma^{2}\mathbf{I}_{D}$ and mean $\mathbf{\mu}(t)\in\mathbb{R}^{D}$.
The probability density of $\hat{\mathbf{X}}(t)$ on the positive side of the decision boundary $\{\mathbf{x}:\mathbf{c}^{\top}\mathbf{x}>b\}$ can be expressed as

$$ $\hat{Y}(t)\triangleq\Pr\{\mathbf{c}^{\top}\mathbf{x}^{*}>b\}=\Phi(k\sqrt{t}/\sigma)$ (14) $$

where $\Phi$ is the CDF of the normal distribution and $k=\mathbf{c^{\top}}\mu(t)-b$ is the signed projection distance between the decision boundary and the mean $\mu(t)$ of $\hat{\mathbf{X}}(t)$.

###### Proof.

Since the $\hat{\mathbf{X}}(t)$ is isotropic, the variance on every axis is equal and independent.
We may rotate our coordinate system such that the projection line between the plane and the mean of $\hat{\mathbf{X}}(t)$ aligns with an axis we denote as “axis 0”.
The rest of the axes must be orthogonal to the plane.
Since each component of an isotropic Gaussian is independent, the marginal distribution of $\hat{\mathbf{X}}(t)$ on axis 0 is a univariate Gaussian with variance $t^{-1}\sigma^{2}$ mean at distance $k$ from the boundary.
Equation 14 applies the normal distribution CDF $\Phi$ to determine the probability mass on the positive side of the boundary.
∎

Observe that $\hat{Y}(t)$ in Equation 14 monotonically scales with the signed distance $k$ between the hyperplane and $\mathbf{\mu}(t)$ (CDFs are monotonic).

###### Lemma B.3 .

Knowledge of time $t$ and optimal classification estimate $\hat{Y}(t)$ is sufficient to determine the projection distance $k$ between $\mathbf{\mu}(t)=\text{mean}\big{(}\mathbf{X}(1),\dots,\mathbf{X}(t)\big{)}$ and the decision boundary $(\mathbf{c},b)$.

###### Proof.

Recall Equation 14 from Lemma B.2.
We may solve for projection distance $k$ separating the decision boundary and the mean $\mathbf{\mu}(t)$ of observations $\mathbf{X}(1),\dots,\mathbf{X}(t)$ as

$$ $k=\frac{\sigma}{\sqrt{t}}\Phi^{-1}(\hat{Y}(t))$ (15) $$

Since $\Phi$ is the CDF of the normal distribution, and the normal distribution is not zero except at $\pm\infty$, the inverse $\Phi^{-1}$ is well-defined.
∎

Note that non-zero noise is required for Lemma B.3 to hold, as zero noise would yield zero probability mass on one side of each decision boundary, meaning that no distance information would be recoverable from $\hat{Y}(t)$ (and Equation 15 would lead to a $0\cdot\infty$ indeterminacy).

###### Lemma B.1 .

###### Proof.

###### Lemma B.2 .

###### Proof.

###### Lemma B.3 .

###### Proof.

### B.2 Trilateration via Multiple Decision Boundaries

##### To recap Section B.1

: We derived an optimal estimator of $\mathbf{x}^{*}$ (denoted $\hat{\mathbf{X}}(t)$) based on noisy i.i.d. measurements $\mathbf{X}(1),\dots,\mathbf{X}(t)\sim\mathcal{N}(\mathbf{x}^{*},\sigma^{2}
\mathbf{I}_{D})$ in Lemma B.1.
In Lemma B.2 we derived the equation for Bernoulli variable $\hat{Y}(t)$ to estimate a single classification output $y(\mathbf{x}^{*})$ based on the same noisy measurements via $\hat{\mathbf{X}}(t)$.
Finally, we showed in Lemma B.3 that the uncertainty in $\hat{Y}(t)$ and the time $t$ is sufficient to determine the projection distance between the decision boundary and $\mu(t)=\text{mean}(\mathbf{X}(1),\dots,\mathbf{X}(t))$ via Equation 15.

Let $\hat{\mathbf{Y}}(t)$ denote the vector of classification estimates $\hat{Y}(t)$ from Equation 15. We now have the tools to prove our final result via trilateration. Much like distance information from cell towers can be used to trilaterate(^3^33Trilateration differs from triangulation, and it is more frequently used in practice. Triangulation is when one has angle information w.r.t. the cell towers. Usually, this is not available – so one trilaterates their position []. This more closely matches our setting, where we just have distances information w.r.t. the decision boundaries and must determine the position.) one’s position, we will leverage Lemma B.3 and use distances from decision boundaries $\{(\mathbf{c}_{i},b_{i})\}_{i\in[N_{\textit{task}}]}$ to constrain the positions.

###### Theorem B.4 (Trilateration Theorem) .

If $\mathbf{C}$ is full-rank, then $\hat{\mathbf{Y}}(t)$, $t$, $\mathbf{b}$, and $\mathbf{C}$ are sufficient to reconstruct the exact value of $\mathbf{\mu}(t)$, the mean of $\mathbf{X}(1),\dots,\mathbf{X}(t)$, which is also the optimal estimator for $\mathbf{x}^{*}$.

###### Proof.

We may prove this claim by providing an algorithm to reconstruct $\mathbf{\mu}(t)=\text{mean}(\mathbf{X}(1),\dots,\mathbf{X}(t))$ from $\hat{\mathbf{Y}}(t),\mathbf{C}$, and $t$.
Invoke Lemma B.3 to compute the signed projection distance between $\mathbf{\mu}(t)$ and each decision plane $(\mathbf{c}_{i},b_{i})$.
Let $\mathbf{k}=[k_{1},\dots,k_{M}]^{\top}$ where each $k_{i}$ corresponds to decision boundary $\mathbf{c}_{i}$.
Then the mean $\mathbf{\mu}(t)$ must satisfy

$$ $\mathbf{C\mu(t)}=\mathbf{k}+\mathbf{b}$ (16) $$

Thus, for full rank $\mathbf{C}$, we will have a uniquely determined $\mu(t)$ value.
∎

###### Theorem B.5 (Optimal Representation Theorem, Linear Case) .

Any system that optimally estimates $\hat{\mathbf{Y}}$ based on noisy measurements $\{\mathbf{X}(1),\dots,\mathbf{X}(t)\}$ must implicitly encode a representation of optimal estimator $\mu(t)=\text{mean}(\mathbf{X}(1),\dots,\mathbf{X}(t))$ in its latent state $\mathbf{Z}(t)$ if decision boundary matrix $\mathbf{C}$ is full rank.

###### Proof.

This follows from the data processing inequality. We begin with the following Markov chain:

$$ $\mathbf{x}^{*}\to\{\mathbf{X}(1),\dots,\mathbf{X}(t)\}\to\mathbf{Z}(t)\to\hat{ \mathbf{Y}}(t)\to\mu(t)$ (17) $$

Put more simply, we have $\mathbf{x}^{*}\to\mathbf{Z}(t)\to\mu(t)$.
Applying the data processing inequality, we obtain

$$ $I\big{(}\mathbf{x}^{*};\mathbf{Z}(t)\big{)}\geq I\big{(}\mathbf{x}^{*};\mu(t) \big{)}$ (18) $$

where $I(\cdot;\cdot)$ denotes the mutual information between two variables.

Since $\hat{\mathbf{X}}(t)$ is the optimal estimator of $\mathbf{x}^{*}$ given measurements $\{\mathbf{X}(1),\dots,\mathbf{X}(t)\}$, $I\big{(}\mathbf{x}^{*};\mu(t)\big{)}=H(\mu(t))$.
Therefore $I(\mathbf{x}^{*};\mathbf{Z}(t))\geq H(\mu(t))$, implying that $I(\mathbf{Z}(t);\mu(t))=H(\mu(t))$.
In other words, $\mathbf{Z}(t)$ must contain all the information of $\mu(t)$, and $\mu(t)$ must be expressible as a deterministic function of $\mathbf{Z}(t)$.
∎

Theorem B.5 boils down to the observation that the confidence associated with each $\hat{Y}_{i}$ in $\hat{\mathbf{Y}}(t)$ are measures of distance between an implied estimate of $\mathbf{x}^{*}$ (denoted $\mu(t)$) and classification boundary $i$ (denoted $(\mathbf{c}_{i},b)$).
$\hat{\mathbf{Y}}$ specifies the position of $\hat{\mathbf{X}}=\mu$ via “coordinates” defined by decision boundary normal vectors $\mathbf{c}_{1},\dots,\mathbf{c}_{N_{\textit{task}}}$.

For sub-optimal estimators of $\hat{\mathbf{Y}}$, we may still obtain an understanding of the implied estimate $\hat{\mathbf{X}}$ using the same methods.
In fact, the machinery of least-squares estimation for $\mathbf{Ax=b}$ provides a readily accessible formula for $\tilde{\mu}$ in sub-optimal estimators of $\hat{\mathbf{Y}}$ (Equation 16) in the form of the Moore-Penrose pseudoinverse:

$$ $\tilde{\mu}=(\mathbf{C^{\top}C})^{-1}\mathbf{C}^{T}(\mathbf{k}+\mathbf{b})$ (19) $$

Conveniently, if the estimation errors in sub-optimal $\hat{\mathbf{Y}}$ have a mean of zero, additional decision boundaries in $\mathbf{C}$ (e.g., beyond the minimum $D$ linearly independent boundaries) result in improved estimation of $\mathbf{x}^{*}$ by the central limit theorem, thus generalizing our results to sub-optimal estimators.

###### Theorem B.4 (Trilateration Theorem) .

###### Proof.

###### Theorem B.5 (Optimal Representation Theorem, Linear Case) .

###### Proof.

### B.3 Optimal Representation Theorem (General Case)

We extend the results from the linear case (Theorem B.5) to the general case where observations are transformed by an injective observation map $f$ in Theorem B.6.

###### Theorem B.6 (Optimal Representation Theorem) .

Let $\mathbf{x}^{*}\in\mathbb{R}^{D}$ be a latent representation for linear binary classification task $\mathbf{y}(\mathbf{x}^{*})\in\{0,1\}^{N_{\textit{task}}}$
and $\mathbf{X}(t)=f(\mathbf{x}^{*}+\sigma\mathcal{N}(\mathbf{0},\mathbf{I}_{D}))$ be noisy observations transformed by an injective observation map $f$.

If $\mathbf{C}\in{N_{\textit{task}}\times D}$ is a full-rank matrix representing the decision boundary normal vectors in $\mathbb{R}^{D}$ and $N_{\textit{task}}\geq D$, then any optimal estimator of $\mathbf{y}(\mathbf{x}^{*})$ must encode an optimal representation of the latent variable $\mathbf{x}^{*}$ in its latent state $\mathbf{Z}(t)$.
Furthermore, the mutual information between $\mathbf{x}^{*}$ and $\mathbf{Z}(t)$ is at least as great as the entropy of the theoretically optimal estimator $\mu(t)$, ensuring that all the information of $\mu(t)$ is contained in $\mathbf{Z}(t)$.
Consequently, $\mu(t)$ – the optimal estimate of $\mathbf{x}^{*}$ based on $f(\mathbf{X}(1)),\dots,f(\mathbf{X}(t))$ – can be written as a deterministic function (Equation 20) of latent state $\mathbf{Z}(t)$.

$$ $\mu(t)=(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}\begin{pmatrix}\frac {\sigma}{\sqrt{t}}\Phi^{-1}\big{(}g(\mathbf{Z}(t))\big{)}+\mathbf{b}\end{pmatrix}$ (20) $$

###### Proof.

We use proof by contradiction to extend the linear case of the general representation theorem to account for injective observation maps $f$ that map $\mathbf{X}(t)$ before they are input to $\mathbf{Z}(t)$.
Assume toward a contradiction that there exists a superior way of computing $\hat{Y}$ based on injectively mapped $f(\mathbf{X}(t))$ other than learning $f^{-1}$ and following the same procedure as when $\mathbf{X}(t)$ was fed in directly (which we derived the optimal estimator for in Lemma B.1 and Lemma B.2).
This assumption implies there is some additional information in $f(\mathbf{X}(t))$ that is not in $\mathbf{X}(t)$, violating the data processing inequality.

Formally, consider the following Markov chain:

$$ $\mathbf{x}^{*}\to\{\mathbf{X}(1),\dots,\mathbf{X}(t)\}\to\mathbf{Z}(t)\to\hat{ \mathbf{Y}}(t)\to\mu(t).$ (21) $$

Since $f$ is injective, $f^{-1}$ exists, making $f(\mathbf{X}(t))\to\mathbf{X}(t)$ an equivalent transformation in terms of information content. Hence, any optimal estimator that processes $f(\mathbf{X}(t))$ can only perform as well as if it had directly processed $\mathbf{X}(t)$.

Applying the data processing inequality, we have:

$$ $I\big{(}\mathbf{x}^{*};\mathbf{Z}(t)\big{)}\geq I\big{(}\mathbf{x}^{*};\mu(t) \big{)},$ (22) $$

where $I(\cdot;\cdot)$ denotes the mutual information between two variables. Since $\hat{\mathbf{X}}(t)$ is the optimal estimator of $\mathbf{x}^{*}$ given measurements $\{\mathbf{X}(1),\dots,\mathbf{X}(t)\}$, $I\big{(}\mathbf{x}^{*};\mu(t)\big{)}=H(\mu(t))$. Therefore, $I(\mathbf{x}^{*};\mathbf{Z}(t))\geq H(\mu(t))$, implying that $I(\mathbf{Z}(t);\mu(t))=H(\mu(t))$. In other words, $\mathbf{Z}(t)$ must contain all the information of $\mu(t)$, and $\mu(t)$ must be expressible as a deterministic function of $\mathbf{Z}(t)$.

To complete the proof, we show that $\mu(t)$ can be reconstructed from $\mathbf{Z}(t)$.
Given the full-rank matrix $\mathbf{C}$, we can use the same trilateration process as in the linear case. The optimal estimate $\mu(t)$ can be written as:

$$ $\mu(t)=(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}\begin{pmatrix}\frac {\sigma}{\sqrt{t}}\Phi^{-1}\big{(}g(\mathbf{Z}(t))\big{)}+\mathbf{b}\end{ pmatrix},$ (23) $$

where $g(\mathbf{Z}(t))$ represents the transformation from the latent state to the classification probabilities. This completes the proof by showing that $\mu(t)$ is a deterministic function of $\mathbf{Z}(t)$.
∎

Motivated by the similarity between $\Phi(z)$ and sigmoid-like activation functions $g(z)$, we show that the two can be approximately canceled in Equation 20, implying that $\mu(t)$ can be reconstructed with high accuracy with a linear-affine transformation (e.g., linear decoding) when $g=\tanh$ or $g=\text{sigmoid}$. This implies that $\mathbf{Z}(t)$ contains an abstract representation of $\mu(t)$ [].

###### Corollary B.7 .

If the readout function $g$ is $\tanh$, then the reconstruction equation for $\mu(t)$ from $\mathbf{Z}(t)$ can be simplified using the approximation $\Phi(z)\approx\frac{1}{2}\tanh(z)+\frac{1}{2}$.
Consequently, $\mu(t)$ can be expressed directly in terms of $\mathbf{Z}(t)$ without the need for the inverse CDF.

$$ $\mu(t)\approx\frac{2\sqrt{3}\sigma}{\pi\sqrt{t}}(\mathbf{C}^{\top}\mathbf{C})^ {-1}\mathbf{C}^{\top}\mathbf{Z}(t)+(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C }^{\top}\mathbf{b}$ (24) $$

###### Proof.

Consider the readout function $g$ given by $g(\mathbf{Z}(t))=\hat{\mathbf{Y}}(t)=\frac{1}{2}\tanh(\mathbf{Z}(t))+\frac{1}{2}$.
To show that this function allows for linear decoding of $\mathbf{x}^{*}$ from $\mathbf{Z}(t)$, we need to leverage the similarity between $\tanh$ and $\Phi$.

The normal distribution CDF $\Phi(z)$ and the function $\frac{1}{2}\tanh(z)+\frac{1}{2}$ are known to be very similar, as both functions are sigmoid-like, centered at zero, and asymptotically approach 0 and 1 [].

Page [] proposed a simple approximation of $\Phi$ via $\tanh$.
Eliminating higher order terms, their approximation is $\Phi(x)\approx\frac{1}{2}\tanh(\sqrt{\frac{2}{\pi}}x)+\frac{1}{2}$.
We found the following approximation yielded a superior mean squared error:

$$ $\Phi(z)\approx\frac{1}{2}\tanh\left(\frac{\pi}{2\sqrt{3}}z\right)+\frac{1}{2}.$ $$

Using this approximation, we can express $\Phi^{-1}$ in terms of $\tanh$:

$$ $\Phi^{-1}\left(\frac{1}{2}\tanh(z)+\frac{1}{2}\right)\approx\frac{2\sqrt{3}}{ \pi}z.$ $$

Substituting this approximation into the reconstruction equation for $\mu(t)$ from Theorem B.6:

$$ $\displaystyle\mu(t)$ $\displaystyle=(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}\begin{ pmatrix}\frac{\sigma}{\sqrt{t}}\Phi^{-1}\left(\frac{1}{2}\tanh(\mathbf{Z}(t))+ \frac{1}{2}\right)+\mathbf{b}\end{pmatrix}$ $\displaystyle\approx(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}\begin{ pmatrix}\frac{\sigma}{\sqrt{t}}\left(\frac{2\sqrt{3}}{\pi}\mathbf{Z}(t)\right) +\mathbf{b}\end{pmatrix}$ $\displaystyle=\frac{2\sqrt{3}\sigma}{\pi\sqrt{t}}(\mathbf{C}^{\top}\mathbf{C}) ^{-1}\mathbf{C}^{\top}\mathbf{Z}(t)+(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{ C}^{\top}\mathbf{b}.$ $$

Therefore, we have shown that $\mu(t)$ can be expressed as a linear transformation of $\mathbf{Z}(t)$ when the readout function $g$ is sigmoid-like. This confirms the corollary.

∎

###### Corollary B.8 .

For $g=\textup{sigmoid}$, linear scaling by $a_{\sigma}=0.5886$ yields a mean absolute error of 0.0038699 from $Z(t)$ in the range $[-10,10]$, enabling the following accurate linear-affine approximation of $\mu(t)$ from $\mathbf{Z}(t)$ given $g=\textup{sigmoid}$:

$$ $\mu(t)\approx\frac{a_{\sigma}\,\sigma}{\sqrt{t}}(\mathbf{C}^{\top}\mathbf{C})^ {-1}\mathbf{C}^{\top}\mathbf{C}^{\top}\mathbf{Z}(t)+(\mathbf{C}^{\top}\mathbf{ C})^{-1}\mathbf{C}^{\top}\mathbf{b}$ (25) $$

###### Proof.

We found $a_{\sigma}=0.5886$ by computationally minimizing the mean squared error between $\Phi(a_{\sigma}z)$ and $\sigma(z)$ (see sigmoid_approx_gaussianCDF.m in supporting code).
Upon computing $a_{\sigma}$ on successively larger optimization bounds $T=1,10,100,...$, we found that $a_{\sigma}$ converged to $0.5886$.
We note that sigmoid approximations to the Gaussian distribution CDF have existed in the literature for some time [].
∎

Figure: Figure S7: Sigmoid ($\sigma(\cdot)$) and $\tanh$ approximations of the normal distribution CDF $\Phi$ via horizontal scaling.
Refer to caption: x2.png

Corollary B.7 and B.8 are visualized in Figure S7, showing the close approximations to the Gaussian CDF.

###### Corollary B.9 .

$N_{\textit{task}}\gg D$ implies orthogonal representations in latent $Z(t)$.

###### Proof.

Recall equation (3) from the disentangled representation theorem:

$$ $\mu(t)=(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}~\begin{pmatrix} \frac{\sigma}{\sqrt{t}}~\Phi^{-1}\big{(}g(\mathbf{Z}(t))\big{)}+\mathbf{b}\end {pmatrix}$ $$

For sigmoid-like $g$, we can approximate

$$ $\mu(t)\approx\frac{a_{g}\,\sigma}{\sqrt{t}}(\mathbf{C}^{\top}\mathbf{C})^{-1} \mathbf{C}^{\top}\mathbf{Z}(t)+(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{ \top}\mathbf{b}$ $$

The orthogonality of the representations in $\mathbf{Z}(t)$ is therefore governed by the orthogonality of the rows in the matrix $\mathbf{A}:=(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}\in\mathbb{R}^{
D\times N_{\textit{task}}}$.
If $\mathbf{A}\mathbf{A}^{\top}\in\mathbb{R}^{D\times D}$ is diagonal, then the rows of $\mathbf{A}$ are orthogonal.

$$ $\mathbf{A}\mathbf{A}^{\top}=\big{(}(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C }^{\top}\big{)}\big{(}(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}\big{ )}^{\top}$ $$

$$ $=\big{(}(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}\big{)}\big{(} \mathbf{C}((\mathbf{C}^{\top}\mathbf{C})^{-1})^{\top}\big{)}$ $$

$$ $=(\mathbf{C}^{\top}\mathbf{C})^{-1}(\mathbf{C}^{\top}\mathbf{C})((\mathbf{C}^{ \top}\mathbf{C})^{-1})^{\top}$ $$

$$ $=((\mathbf{C}^{\top}\mathbf{C})^{-1})^{\top}$ $$

$B^{\top}B$ is a symmetric for any matrix B. Recall that the inverse of a symmetric matrix is also symmetric. So $(\mathbf{C}^{\top}\mathbf{C})^{-1}$ is also symmetric.
Therefore

$$ $\mathbf{A}\mathbf{A}^{\top}=(\mathbf{C}^{\top}\mathbf{C})^{-1}$ $$

As the columns of $\mathbf{C}$ are high-dimensional randomly sampled vectors, their probability of being orthogonal vanishes as the dimensionality $N_{\textit{task}}$ increases.
We can also state the condition in terms of the singular value decomposition (SVD) of $\mathbf{C}=\mathbf{U}\Sigma\mathbf{V}^{T}$ where $\mathbf{U}\in\mathbb{R}^{N_{\textit{task}}\times D}$, $\Sigma=\text{diag}(\sigma_{1},...,\sigma_{D})$, $\mathbf{V}\in\mathbb{R}^{D\times D}$, and $\sigma_{i}$ is the $i$th singular value of $\mathbf{C}$ and $\mathbf{U},\mathbf{V}$ are orthonormal.
Then

$$ $\mathbf{A}\mathbf{A}^{\top}=\mathbf{V}\Sigma^{-2}\mathbf{V}^{T}$ $$

If the singular values are approximately uniform $\sigma_{1}\dots\sigma_{D}\approx\sigma$ then

$$ $\mathbf{A}\mathbf{A}^{\top}\approx\mathbf{V}(\frac{1}{\sigma^{2}}\mathbf{I}_{D })\mathbf{V}^{T}$ $$

$$ $\mathbf{A}\mathbf{A}^{\top}\approx\frac{1}{\sigma^{2}}\mathbf{V}\mathbf{V}^{T} =\frac{1}{\sigma^{2}}\mathbf{I}_{D}$ $$

Therefore, uniform singular values in $\mathbf{C}$ is a sufficient condition to guarantee an orthogonal, disentangled representation of $\mu(t)$ in $\mathbf{Z}(t)$(^4^44This uniformity condition in the singular value decomposition is analogous to the outcome of the LM damping technique [, ], used for least squares inversion problems in various applications.).
∎

###### Theorem B.6 (Optimal Representation Theorem) .

###### Proof.

###### Corollary B.7 .

###### Proof.

###### Corollary B.8 .

###### Proof.

###### Corollary B.9 .

###### Proof.

### B.4 Suitable Noise Distributions

While the original proof leverages Gaussian noise due to its mathematical convenience, the key property required for the proof is more general. Specifically, the essential requirement is that the marginal posterior distributions along the decision boundary normals $\mathbf{c}_{i}$ have invertible cumulative distribution functions (CDFs), allowing us to recover the distances from the observed classification probabilities.

We will now provide a precise mathematical description of the class of noise distributions where this key property holds, generalizing the disentangled representation theorem beyond Gaussian noise.

##### Key Noise Property Required for Proof:

Invertibility of the Marginal Posterior CDFs Along Decision Boundary Normals.
For each decision boundary normal vector $\mathbf{c}_{i}$, the marginal posterior distribution of $\mathbf{x}^{*}$ projected onto $\mathbf{c}_{i}$ must have an invertible CDF.
This allows us to map the observed classification probabilities to unique distances between the estimated mean $\mu(t)$ and the decision boundaries.

##### Mathematical Description of Suitable Noise Distributions

: Let us define a class of noise distributions $\epsilon(t)$ where the key property holds and is straight forward to solve analytically.

Definition: The proof is immediately generalizable to noise distribution $\epsilon(t)$ if it satisfies the following conditions:

- 1.
Additive noise model:
$\mathbf{X}(t)=\mathbf{x}^{*}+\epsilon(t)$
where $\epsilon(t)$ are i.i.d. random vectors.
- 2.
Posterior Distribution Tractability: The posterior distribution $P(\mathbf{x}^{*}|\{\mathbf{X}(s)\}_{s=1}^{t}$ must be analytically tractable or well-approximated, allowing us to compute the posterior mean or maximum a posteriori estimate $\mu(t)$ of $\mathbf{x}^{*}$ and understand its properties.
- 3.
Existence of Invertible Marginal Posterior CDFs: For each decision boundary normal vector $\mathbf{c}_{i}$, the marginal posterior distribution of $\mathbf{c}_{i}^{\top}\mathbf{x}^{*}$ has a continuous and strictly increasing CDF $F_{i}(k)$, which is invertible.
- 4.
Support over $\mathcal{X}$: Let $\mathcal{X}\subseteq\mathbb{R}^{D}$ be the connected subset of allowable $\mathbf{x}^{*}$ values. The noise distribution must have full support over $\mathcal{X}$, ensuring that any real-valued $\mathbf{x}^{*}$ is possible to trilaterate. For our proof, we assume support over the maximally permissible $\mathbb{R}^{D}$ is used.

##### Implications:

Any suitable noise distribution allows classification task probability $\hat{Y}_{i}(t)$ to be expressed as

$$ $\hat{Y}_{i}(t)=\Pr\{\mathbf{c}_{i}^{\top}\mathbf{x}^{*}>b_{i}|[\mathbf{X}(s)]_ {s=1}^{T}\}$ $$

$$ $=1-F_{i}(b_{i}-\mathbf{c}_{i}^{\top}\mu(t))$ $$

where $F_{i}$ is the marginal distribution of $\mathbf{c}_{i}^{\top}\mathbf{x}^{*}$.

Since $F_{i}$ is invertible, we can solve for distance $k_{i}=\mathbf{c}_{i}^{\top}\mu(t)-b_{i}$ as

$$ $k_{i}=F_{i}^{-1}(1-\hat{Y}_{i}(t)).$ $$

This equation allows us to reconstruct decision boundary distances $k_{i}$ from optimal classification probabilities $\hat{Y}_{i}(t)$.
Thus the proof via trilateration for the disentangled representation theorem is feasible for any suitable noise distribution $\epsilon(t)$ as described above.

### B.5 Examples of Suitable Noise Distributions

#### B.5.1 Elliptical Distributions

##### Definition:

A multivariate distribution ([]) is elliptical if its density function $f(\mathbf{x})$ can be expressed as:

$$ $f(\mathbf{x})=|\boldsymbol{\Sigma}|^{-1/2}g\left((\mathbf{x}-\boldsymbol{\mu}) ^{\top}\boldsymbol{\Sigma}^{-1}(\mathbf{x}-\boldsymbol{\mu})\right)$ $$

where $g:[0,\infty)\to[0,\infty)$ is a non-negative function, $\mu\in\mathbb{R}^{D}$ is the location parameter, and $\Sigma\in\mathbb{R}^{D\times D}$ is the scale matrix.

##### Properties:

- •
Symmetric and unimodal around $\boldsymbol{\mu}$.
- •
Projections onto any direction $\mathbf{c}_{i}$ yield univariate elliptical distributions.
- •
Marginal distributions along $\mathbf{c}_{i}$ have invertible CDFs if $g$ leads to such marginals.

##### Examples of Suitable Elliptical Distributions:

- •
Multi-variate Gaussians with Full-Rank Covariance Matrix (Lemma B.10).
- •
Multi-variate T-distributions with Full-Rank Scale Matrix: Heavy-tailed alternative to the Gaussian.
- •
Multivariate Laplace Distribution With Full-Rank Scale Matrix: Has exponential tails.

#### B.5.2 Exponential Power Distributions

Definition: Also known as the generalized Gaussian distribution, defined by the density:

$$ $f(\mathbf{x})=\frac{\beta}{2\alpha\Gamma(1/\beta)}\exp\left(-\left(\frac{| \mathbf{x}-\boldsymbol{\mu}|}{\alpha}\right)^{\beta}\right),$ $$

where $\beta>0$ controls the kurtosis ([]). Properties:

- •
For $\beta=2$, it reduces to the Gaussian distribution.
- •
For $\beta=1$, it becomes the Laplace distribution.
- •
Symmetric and unimodal.
- •
Marginal distributions are of the same form and have invertible CDFs.

Generalizing the Proof

Given the above, the proof can be generalized to any noise distribution $\epsilon(t)$ satisfying the conditions stated. The key steps are as follows:

- 1.
Compute the Posterior Distribution:
•
Since $\epsilon(t)$ is i.i.d., the likelihood function is:
$P(\{\mathbf{X}(s)\}_{s=1}^{t}\mid\mathbf{x}^{*})=\prod_{s=1}^{t}f_{\epsilon}(
\mathbf{X}(s)-\mathbf{x}^{*}).$
•
Without a prior (uniform prior), the posterior is proportional to the likelihood.
•
The posterior distribution $P(\mathbf{x}^{*}\mid\{\mathbf{X}(s)\}_{s=1}^{t})$ can be found (or approximated) based on the noise distribution.
- 2.
Marginalize Along Decision Boundary Normals:
•
For each $\mathbf{c}_{i}$, compute the marginal posterior distribution of $\mathbf{c}_{i}^{\top}\mathbf{x}^{*}$.
•
Due to the symmetry and unimodality of the noise distribution, this marginal will also be symmetric and unimodal.
- 3.
Compute Classification Probabilities: The classification probability is:
$\hat{Y}_{i}(t)=\Pr\{\mathbf{c}_{i}^{\top}\mathbf{x}^{*}>b_{i}\mid\{\mathbf{X}(
s)\}_{s=1}^{t}\}=1-F_{i}(b_{i}-\mathbf{c}_{i}^{\top}\mu(t)),$
where $F_{i}$ is the marginal posterior CDF of $\mathbf{c}_{i}^{\top}\mathbf{x}^{*}$.
- 4.
Invert Marginal CDFs to Find Distances: Since $F_{i}$ is invertible, we can solve for $k_{i}$:
$k_{i}=F_{i}^{-1}(1-\hat{Y}_{i}(t)).$
- 5.
Set Up Linear System to Recover $\mu(t)$:
•
The distances $k_{i}$ relate to $\mu(t)$ via:
$\mathbf{c}_{i}^{\top}\mu(t)=k_{i}+b_{i}.$
•
Collecting all $N_{\text{task}}$ equations:
$\mathbf{C}\mu(t)=\mathbf{k}+\mathbf{b}.$
- 6.
Solve for $\mu(t)$: If $\mathbf{C}$ is full rank, we can solve for $\mu(t)$:
$\mu(t)=(\mathbf{C}^{\top}\mathbf{C})^{-1}\mathbf{C}^{\top}(\mathbf{k}+\mathbf{
b}).$

Implications

- •
Optimal Estimator Must Encode $\mu(t)$:
- •
The latent state $\mathbf{Z}(t)$ must contain sufficient information to recover $\mu(t)$, as it is essential for optimal classification across all tasks.
- •
The theorem holds for any noise distribution satisfying the stated conditions, not just Gaussian noise.

#### B.5.3 Example with Multivariate t-Distribution

Suppose $\epsilon(t)$ follows a multivariate t-distribution ([]) with degrees of freedom $\nu>2$:

- 1.
Posterior Distribution: The posterior $P(\mathbf{x}^{*}\mid\{\mathbf{X}(s)\}_{s=1}^{t})$ is also a multivariate t-distribution.
- 2.
Marginal Posterior Distributions: Projections onto $\mathbf{c}_{i}$ yield univariate t-distributions.
- 3.
Invertible Marginal CDFs: The CDF of the t-distribution is known and invertible.
- 4.
Recover Distances: Use the inverse t-CDF to find $k_{i}$:
$k_{i}=s_{t}\cdot T_{\nu}^{-1}(1-\hat{Y}_{i}(t)),$
where $s_{t}$ is the scale parameter, and $T_{\nu}^{-1}$ is the inverse CDF of the t-distribution with $\nu$ degrees of freedom.
- 5.
Proceed with the proof: Follow the same steps as before to reconstruct $\mu(t)$.

#### B.5.4 Example with Anisotropic Gaussian Noise

###### Lemma B.10 .

Suppose $\epsilon(t)$ follows an anisotropic multi-variate Gaussian distribution with full-rank covariance matrix $\Sigma$ and zero mean.
Then we can update Equation 14 from Lemma B.2 as

$$ $\displaystyle\hat{Y}(t)$ $\displaystyle\triangleq\Pr(\mathbf{c}^{\top}\mathbf{x}^{*}>b)$ (26) $\displaystyle=\Phi\begin{pmatrix}\frac{k\sqrt{t}}{\sqrt{\mathbf{c}^{\top} \Sigma\mathbf{c}}}\end{pmatrix}$ (27) $$

###### Proof.

Anisotropic noise results in the quadratic form $\mathbf{c}^{\top}\Sigma\mathbf{c}$ in the denominator representing the variance of the marginalized anisotropic noise distribution along decision boundary normal vector $\mathbf{c}_{i}$.
As long as $\Sigma$ is non-singular, the remainder of the disentangled representation proof may proceed substituting Equation 14 with Equation 27.
∎

###### Lemma B.10 .

###### Proof.

#### B.5.5 Conclusion

The key property enabling us to recover distances from classification probabilities is the invertibility of the marginal posterior CDFs along the decision boundary normals. This property is not exclusive to Gaussian noise but is shared by a broader class of noise distributions, including but not limited to:

- •
Elliptical distributions (e.g., multivariate t-distributions, Laplace distributions).
- •
Exponential power distributions.
- •
Other symmetric and unimodal distributions with invertible marginals.

Therefore, the proof of the Disentangled Representation Theorem generalizes to any noise distribution satisfying the conditions outlined above. The essential requirement is that we can uniquely map the observed classification probabilities to distances along the normals, allowing us to reconstruct the posterior mean $\mu(t)$ and establish that any optimal estimator must encode this information in its latent state $\mathbf{Z}(t)$.

Correspondence in the structure of noise distribution CDF along marginals $F_{i}$ and point-wise activation functions $g$ (the activation function $\hat{\mathbf{Y}}(t)=g(\mathbf{Z}(t))$).

### B.6 Discussion

The theoretical results presented in this appendix, particularly the Optimal Representation Theorem (Theorem B.6), provide insights into the factors driving representational convergence and alignment in neural networks and, more generally, any optimal multi-task classifier in the setup shown in Figure S5. This theorem establishes a clear connection between the latent representations learned by optimal multi-task classifiers and the true underlying data representation, offering a principled explanation for the emergence of disentangled representations aligned with the intrinsic structure of the data.

##### Connection to Manifold Hypothesis:

Our theoretical results have important implications for the manifold hypothesis, which posits that real-world high-dimensional data tend to lie on or near low-dimensional manifolds embedded in the high-dimensional space [, ]. The key insight is that our proofs show an optimal multi-task classifier must encode an estimate of the disentangled coordinates of the true underlying environment state in its latent representation.
Consider the disentangled space in which $\mathbf{x}^{*}$ resides, denoted $\mathcal{X}^{*}$.
The injective observation map $f:\mathcal{X}^{*}\to\mathcal{X}$, where decision boundaries $y_{i}:\mathcal{X}^{*}\to\{0,1\}$ are linear.
Our results imply that an optimal classifier’s latent state $\mathbf{Z}(t)$ must encode disentangled coordinates in $\mathcal{X}^{*}$ rather than ambient coordinates $\mathcal{X}$.

The injective observation map $f$ aligns closely to the typical conception of a data manifold (e.g., if $f\in C^{1}$ or $f\in C^{n}$, as described in []).
The disentangled space $\mathcal{X}^{*}$ can be seen as the intrinsic coordinate system of the manifold, while $f$ maps these coordinates to the high-dimensional observation space $\mathcal{X}$.
Our findings suggest that an optimal classifier will implicitly learn to invert this mapping to recover the disentangled coordinates.
Moreover, for natural data where the manifold hypothesis holds, the learned latent representation would plausibly capture the manifold structure, as this is essential for disambiguating noisy observations and estimating the true underlying state.
The low-dimensional manifold structure is a key prior that an optimal classifier can (and in our case must) exploit to improve its performance.

##### Relation to Autoregressive Language & Multi-Modal Transformers:

Consider an analogy with masked autoencoder vision foundation models, where $\mathbf{x}^{*}$ is the “ground truth” of a scene (objects, positions, states, and relationships), the measurement variable $\mathbf{X}$ is an image with missing patches [, ], and the model predicts the missing patch data $y(\mathbf{x}^{*})$. The model’s latent variable $\mathbf{Z}$ exhibits some “understanding” of $\mathbf{x}^{*}$ in the form of abstract representations useful for downstream tasks. This analogy extends to masked language models [] and autoregressive language models [], where $\mathbf{x}^{*}$ is “meaning” in a semantic space, $\mathbf{X}(t)$ are words, and $y$ is the next word. Localizing $\mathbf{x}^{*}$ from $\mathbf{Z}(t)$ relates to constructing a world model, showing that $\mathbf{Z}$ represents $\mathbf{x}^{*}$ abstractly and with high fidelity.

##### Ordering of Noise and Observation Map:

The ordering of the noise and the non-linear observation map matters for the latent space representation. When the noise is applied before the observation map, the noisy observations are constrained to lie on a manifold with the same intrinsic dimension as the true latent space $\mathcal{X}^{*}$.
In contrast, when the noise is applied after the observation map, the noisy observations can deviate from the low-dimensional manifold, potentially introducing degeneracy where two noised observations arising from different $\mathbf{x}^{*}$ may appear identical (i.e., non-injective).
Imagine $\mathcal{X}^{*}$ as a 2D piece of paper.
An injective, smooth, continuous observation map $f:\mathcal{X}^{*}\to\mathcal{X}$ where $\mathcal{X}$ is a 3-dimensional space “crumples” the sheet of paper $\mathcal{X}^{*}$ into a crumpled ball in $\mathcal{X}$.
If you add noise after the mapping, a point on one corner of the paper could get “popped out” of the 2D manifold by the noise and end up very far away on the crumpled surface if you were to examine it flattened out (illustrated in Figure S8).

Figure: Figure S8: (A) $\mathbf{x}^{*}$ is noised before being transformed by injective observation map $f$, resulting in observations $f(\mathbf{X}(t))$ lying on the image of $f$ (here $f$ is a 2D folded surface). (B) $\mathbf{x}^{*}$ is first transformed by injective observation map $f$ and noise is added afterward, resulting in observations $f(\mathbf{x}^{*})+\sigma\mathcal{N}(0,I)$ that do not lie on the image of $f$.
Refer to caption: extracted/5927657/Figures/noise_order.png

The curvature of the observation map $f$ and the level of noise $\sigma$ are fundamental factors influencing the extent of the degeneracy introduced by the noise after the observation map.
High curvature in $f$ can make the intrinsic geometry of the data more challenging to identify (e.g., more tightly crumpled paper).
Large noise levels can push observations further from the underlying manifold, similarly worsening the potential degeneracy in the observations.
The reach of the manifold $f$ ([]) can be used as an immediate loose bound for post-observation map noise $\epsilon_{2}(t)$ to ensure that the derived theorems still hold.
Interestingly, this observation map degeneracy is a key concern in work on visual predictive coding for map learning by Gornet and Thomson [].
They demonstrate that a predictive coding network can learn to map a Minecraft environment with visually degenerate states by integrating information to perform predictive coding along trajectories within the environment.

##### Connection to the Platonic Representation Hypothesis:

Our results provide a new perspective on the Platonic representation hypothesis [].
The Platonic representation hypothesis suggests that the convergence in deep neural network representations is driven by a shared statistical model of reality, like Plato’s concept of an ideal reality.
Convergence of representations is analyzed in terms of similarity of distances between embedded datapoints among AI models trained on various modalities.
While the authors of the hypothesis argue that energy constraints might lead to divergence from a shared representation for specialized tasks, our Optimal Representation Theorem suggests that the key factor driving convergence is the diversity and comprehensiveness of the tasks being learned.
As long as the tasks collectively span the space of the underlying data representation, convergence to a shared, reality-aligned representation can occur, even in the presence of energy or computational limitations.
Our theoretical results amount to a necessary condition for optimal multi-task classifiers to represent a disentangled representation of the data within their latent state.
With energy constraints, extraneous network activity may be regularized out of the model, resulting in greater alignment between disentangled representations in energy constrained models that “understand” the Platonic nature of reality.
The very energy constraints [] suggest may lead to divergence could actually facilitate convergence of the platonic representations, as they may encourage the learning of simple, generalizable features that capture the essential structure of the data.
This insight opens up interesting avenues for future research on the interplay between task diversity, energy constraints, and the emergence of shared representations. Finally, energy constraints have been shown to naturally lead to predictive coding [], tightening the relationship between energy efficiency, prediction, and cognitive map learning.

##### Implications and Future Directions:

The theoretical analysis presented in this appendix sheds light on the factors driving the emergence of disentangled representations in neural networks and their alignment with the intrinsic structure of the data.
By formalizing the conditions under which learned representations recover the true underlying data manifold, our work provides a foundation for understanding the remarkable success of representation learning across diverse domains.
Avenues for future research include exploring the sample complexity of learning under different observation maps and noise levels, and empirically validating the convergence of representations across models and modalities in the context of task diversity and energy constraints.

## Appendix C Supplementary figures & tables

**Table S1: Hyperparameter values for RNN training. These values apply to all simulations, unless otherwise stated. $\tau=100\textit{ms}$ was chosen as a conservative estimate of membrane time constant. $\sigma$ was varied in some simulations (e.g. Figure 5c). We found that free RT tasks benefited from a higher learning rate. Other hyperparameters worked out of the box.**
| Parameter | Value | Explanation |
| --- | --- | --- |
| $\Delta t$ | $100\,\textrm{ms}$ | Euler integration step size |
| $\tau$ | $100\,\textrm{ms}$ | Neuronal time constant |
| $N_{\textit{neu}}$ | $64$ | Number of hidden neurons |
| $\sigma$ | $0.2$ | Input noise standard deviation |
| $T$ | $20$ | Trial duration (in $\Delta t$s) |
| $\eta_{0}$ | $0.001/0.003$ | Adam learning rate fixed/free RT |
| $B$ | $16$ | Batch size |
| $N_{\textit{batch}}$ | $10^{5}$ | Number of<br>training batches |
| $D$ | $2$ | Dimensionality of latent space |
| $N_{\textit{layer}}$ | $1$ | RNN/LSTM number of layers |

Figure: Figure S9: Details of learned representations and of learning. (a) Representation after the decoder. 3 out of 40 features were chosen randomly to be displayed. Compared to Figure 3d the representations wrap around non-linearly, and the quadrants are overlapping. The RNN needs to invert the non-linear mapping and remove the noise to arrive at disentangled representations. (b) Individual trial examples from network in Figure 2b. Plotting conventions same as in Figure 3d, except here every trial has been mapped to a separate color (lines and final dot). The ground truth $\mathbf{x}^{*}$ for these example trials is shown in the bottom right, and the attractors have been made transparent for better visibility. Note that these trials include noise, like the ones the network has been trained on. As can be seen, the network maintains a sense of metric distances in the 2D space: examples close in state space are also close in representation space. (c) Representation early in learning, for a network trained with 1/4 of the examples compared to Figure 3d. The representation is not disentangled yet, however it is visible how the quadrants start separating and the attractors start spreading in the 2D manifold. (d) Same as in b, but for network with a delay period of 500 ms (5 darker dots at the end of trajectories). Activity remains localized after the removal of the evidence streams, maintaining a short-term memory of the joint evidence with only minor leaks. (e) Representation learned in a network trained without input noise ($\sigma=0$). Trajectories separate from the beginning, and there is no pressure to learn a 2D continuous attractor anymore. (f) Train and test errors for linear decoder for the OOD generalization task. Transparent lines correspond to different quadrants while opaque lines to the average across quadrants for one network.
Refer to caption: extracted/5927657/Figures/FigS3.png

Figure: Figure S10: Angles between latent factor decoders in higher dimensions. Angles converge to 90 degrees as $N_{\text{task}}\gg D$ for RNNs, and as early as $N_{\text{task}}\geq D$ for transformers (see Section A.3 for angle estimation details). This confirms that multi-task learning leads to orthogonal, disentangled representations, in some cases even earlier than our theoretical guarantees.
Refer to caption: extracted/5927657/Figures/FigS9.png

## Peer Reviews

confidence: 2
contribution: 3
initial_rating: 6
presentation: 3
questions: - In Equation 6, could you clarify if $x_{in}$ is the encoded input, i.e., $f(x)$?

- Does the dimensionality of the latent state Z influence the results? Also, does the dimensionality of the encoded input play a significant role? Have these aspects been examined?

- Have you conducted experiments with other encoding functions, such as a quadratic mapping? 

- In Figure 5b, the blue curve for GPT appears to increase at the end. Could you clarify the reason behind this behavior?

- Since the noise at each time step is independent, temporal information isn’t modeled in this setup. How might the results differ if a transformer with self-attention layers was used? Would such a setup still yield disentangled representations?

- On the other hand, if the inputs contained some temporal structure, how might this affect the nature of the representations?

- Have you tested the framework with much larger values of $N_{task}$ and $D$ (e.g., over 100)?
soundness: 3
strengths: The paper presents theoretical results that establish specific conditions—relating to the number of tasks, input dimensionality, input noise, and more—that lead to the emergence of abstract and disentangled representations in agents solving multi-task evidence aggregation classification tasks. The authors conduct thorough experiments across several architectures (RNNs, LSTMs, and transformers) to validate their theoretical results, showing that even architectures like GPT-2 can exhibit these properties. The work bridges AI and neuroscience, with potential explanations for how abstract, human-aligned representations might arise in artificial neural networks, making it valuable for both fields.
summary: This paper explores the important question of how abstract (linear and approximately orthogonal) and disentangled (orthogonal without the necessity of linearity) representations can emerge in biological and artificial agents. 
The authors present both theoretical and experimental results demonstrating that multi-task learning, specifically within the framework of evidence aggregation classification tasks, can lead to the development of such representations.
weaknesses: One notable limitation of this work is the assumption of factorization, as acknowledged by the authors. Additionally, the theoretical framework is tailored to a specific type of multi-task learning problem—evidence aggregation classification with linear decision boundaries—which may not capture the full diversity of tasks and decision boundaries that agents encounter in dynamic environments. It would be valuable to explore how these ideas generalize to other multi-task learning scenarios. Furthermore, the experiments focus on synthetic data with simple latent structures. While these experiments effectively support the theoretical results, testing the framework on slightly more complex data could provide further insights.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 3
questions: 1. Most examples and empirical validations focus on low-dimensional cases (e.g., D=2). Could you provide examples using moderately higher-dimensional datasets, such as CIFAR or dSprites, to illustrate how N_task scales with D in these settings? 
2. For a given D, what is the maximum number of tasks N_task can be learned with low error? Additionally, how do the test and generalization errors scale with N_task if we keep the number of training data in at a realistic scale?
soundness: 3
strengths: 1. Originality: the study of the emergence of disentangled representation in temporal tasks and models is relatively new. 
2. Quality: the empirical validation is comprehensive. 
3. Clarity: the theory is well explained. The background section is also very nicely written and thorough. 
4. Significance: The paper addresses the key problem of learning the world model in representation learning and also discusses in detail the biological relevance. The results offer meaningful insights for future research on disentangled representation in both artificial systems and the brain.
summary: The paper presents theoretical and empirical results showing that, in multi-task evidence aggregation classification tasks, representations become disentangled as the number of tasks N_task greatly exceeds the input dimensionality 𝐷 when the agent solves the tasks optimally.
weaknesses: 1. The theory assumes that agents are optimal multi-task classifiers, which may not be achievable in realistic settings where the input dimension D is already large and the number of tasks N_task >>D. This raises questions about the practical relevance of the regime considered in the paper. Additionally, it’s difficult to imagine a large number of orthogonal tasks in real-world settings. For instance, in the dSprite dataset, as the authors noted, how could a meaningful, larger set of tasks be constructed, and what implications would this have for the applicability of the framework?
2. The connection to neuroscience also appears somewhat speculative. The authors could clarify how their findings might directly relate to brain function. For example, can the theory predict the relationship between the disentanglement of neural representations and the level of noise or variability in different brain regions?
3. While explaining zero-shot generalization capabilities in artificial neural networks (ANNs) is a central claim, this remains a substantial challenge for most networks. The theory should address whether prior models fail in zero-shot generalization due to insufficient N_task and how practitioners could estimate an adequate N_task, especially in settings where underlying latent factors are unknown, making it impractical to sample random classification tasks as in the paper.

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 2
questions: **Sparsity:**

The emergence of sparsity in Fig. 4 is interesting. Could the authors specify if they applied any particular architectural constraints, such as regularization techniques or sparsity-promoting mechanisms, to encourage this behavior?

Additionally, quantifying the sparsity (e.g., lifetime sparsity, [Vinje and Gallant, 2000](https://www.science.org/doi/10.1126/science.287.5456.1273)) and examining how this metric varies with N_task, the number of latent dimensions, and specific RNN architecture choices would provide further insights into the effects of task density on network representation.

**More nonlinear encoding:**

The authors' use of a piecewise linear MLP+ReLU encoding of ground truth signals raises questions about the robustness of their empirical results under more complex nonlinear encodings.

Could the authors explore how the N_task vs. out-of-distribution r2 relationship (Fig. 3) might change if the encoding network incorporated more nonlinear functions such as exponential or power-law activations, to simulate more biologically plausible ([Priebe et al., 2004](https://www.nature.com/articles/nn1310)) nonlinear encoding? This line of inquiry is particularly relevant given that the choice of activation function significantly influences the geometry of representations ([Alleman et al., 2024](https://openreview.net/forum?id=k9t8dQ30kU)).
soundness: 2
strengths: The paper introduces a theoretical framework connecting optimal multi-task classification to disentangled representations, building upon the empirical observations in [Johnston and Fusi (2023)](https://www.nature.com/articles/s41467-023-36583-0) . To support these theoretical claims, the paper provides a range of experiments exploring different architectures, task structures, and decision boundary geometries.
summary: This paper extends the work of [Johnston and Fusi (2023)](https://www.nature.com/articles/s41467-023-36583-0)  by investigating how multiple supervised binary classification tasks can lead to abstract or disentangled representations in recurrent neural networks that accumulate evidence from noisy inputs. The authors present theoretical and experimental evidence suggesting that optimal multi-task classifiers can learn abstract representations of underlying ground truth factors.
weaknesses: A significant weakness of this paper is its heavy reliance on dense supervised signals to achieve abstract representations. Similar to [Johnston and Fusi (2023)](https://www.nature.com/articles/s41467-023-36583-0), this work utilizes multiple binary classification tasks, framed as "multi-task" learning. This framing implies a diversity of tasks that is not truly reflected in this setup. The dependence on numerous, highly similar, supervised tasks raises questions about the biological plausibility and real-world applicability of the proposed mechanism.

The requirement of a large number of tasks (N_task >> D) to achieve disentanglement adds to concerns regarding the model's biological plausibility and practical relevance. Biological and artificial agents operating in real-world environments rarely encounter such an abundance of supervised signals.

The authors assert (lines 486-493) that their Theorem 3.1 implies "the key factor driving convergence [to a Platonic representation of reality] is the diversity and comprehensiveness of the tasks being learned." This claim is not supported by the results presented. The tasks in this paper are essentially multiple variations of the same supervised classification task, a far cry from the genuinely diverse tasks (e.g., multimodal vision and language tasks) considered in the Platonic representation paper ([Huh et al., 2024](https://arxiv.org/abs/2405.07987)).

It is well-established that achieving disentangled representations in real-world, unsupervised settings is incredibly difficult, if not impossible, without incorporating appropriate inductive biases ([Locatello et al., 2019](https://arxiv.org/abs/1811.12359); which the authors cite). A substantial body of research, spanning decades, has demonstrated that source signals become non-identifiable when mixed non-linearly ([Hyvarinen and Pajunen, 1999](https://www.sciencedirect.com/science/article/pii/S0893608098001403)). Considering this extensive history of work in machine learning dedicated to tackling this complex problem, this paper's approach—attaining abstract or disentangled representations by providing the model with an abundance of supervised signals in the form of binary classification tasks—appears contrived and ultimately of limited practical value. The reliance on such a heavily supervised setting makes it difficult to see how these findings could generalize to more realistic scenarios where supervision is scarce and the underlying structure of the data must be inferred, rather than provided.

Overall, this paper makes incremental progress on the work of [Johnston and Fusi (2023)](https://www.nature.com/articles/s41467-023-36583-0)  but fails to address the fundamental concern of over-reliance on dense supervised signals. As suggested by [Johnston and Fusi (2023)](https://www.nature.com/articles/s41467-023-36583-0), exploring unsupervised mechanisms such as "predicting the sensory consequences of our actions," might offer a more promising path forward.

Instead of relying on a multitude of supervised signals to enforce disentanglement, future work in this area should investigate whether disentanglement can emerge from a smaller number of more diverse tasks, where the need for efficient generalization across tasks drives abstraction. This shift in focus would significantly enhance the biological plausibility, practical relevance, and overall impact of this line of research to understanding disentangled representation learning.

---

confidence: 4
contribution: 3
initial_rating: 6
presentation: 4
questions: Comments:

Line 231: “…in the column space of (C^TC)^{-1}C^T potential with some element-wise non-linearity.” This statement seems too strong given that the restriction on the activation function g has been significantly relaxed. Are there any preliminary results to qualify this statement?

Corollary B9: While I agree with the results of this corollary, it would be good to explicitly connect the uniformity of the singular values to the corollary statement using the Marchenko-Pastur law. Also in this corollary, at line 1613, it is stated that the probability of being orthogonal vanishes as the dimensionality N_task increases. Was this supposed to be “non-orthogonal” instead?

Figure 2: This figure is particularly unclear, and it is perhaps one of the important foci in explaining all the experiments to follow. Upon first viewing with the caption, it is not clear what the arrows (two grey and one red) in Fig. 2a are supposed to imply.

Line 294: “…in the RNN’s hidden layer, when tasks span the latent space.” Does this really imply anything about the tasks formally spanning the latent space?

Figure 4a: I agree that the RNN representations are sparse, and this looks like a good spot to test if there is any lower threshold on the size of the hidden units before the latent encoding fails.

Line 450: “…which might explain their superior generalization performance to RNNs for lower N_task.” It is not really clear from Fig. S10 that the RNNs are indeed worse at orthogonalization than the GPT.

Line 1119/1120: “Figure S3b shows that the network still learns a disentangled, two dimensional continuous attractor.” Not convinced that this actually shows disentanglement since the metric for that qualification from before was the orthogonalization of different tasks. Did you mean to say abstract here? Also, small typo in the spelling of “disentangled”.

Minor comments:

Line 1321: \hat{Y}_i(t) is noted as a Bernoulli random variable. This implies the support of the estimator is {0,1}, but it should really be [0,1].

Line 1408: Similar comment here to Line 1321 on the use of Bernoulli variable for \hat{Y}(t).

Line 1426: In Equation 16, boldfaced t should be scalar.

Line 1592: “Proof: Recall equation (3)…” should be equation (4).

Line 1608: “B^TB is a symmetric for any matrix B.” Some LaTeX formatting errors here and possibly missing the word matrix following “symmetric”.

Line 309: “disentaglement” misspelled

Fig. 3d Caption: May be good to include a short statement about the inset on PCA components accounting for variance.

Line 1070: “Once the factors are perfectly, performance…” missing the word correlated after “perfectly”

Line 1162: “…for all lines in Figure S4a.” Did you mean all lines from Fig. 2a, shown in Fig. S4a?
soundness: 3
strengths: The key contribution is an extension of the Johnston and Fusi (2023) feedforward framework to recurrent networks. They show that abstract variables are indeed represented in the latent states of RNNs, LSTMs and GPT-2 style transformer architectures when these models are trained using the multi-task paradigm. The results are interesting and point to a marked advantage in adopting the multi-task paradigm for understanding canonical neuroscience experiments in an AI framework. The discussion of these results in the context of contemporary neuroscience literature is also well framed and places this paper in a good position to appeal to both the broader neuroscience and task-learning communities.
summary: This paper studies the problem of learning disentangled representations using a multi-task evidence aggregation approach. In contrast to previous works which have studied a similar problem of abstract and disentangled representations using contextual information, the authors here adopt an approach which simultaneously collects multiple streams of evidence to enable linear classification in multiple tasks at each step. They prove the emergence of an abstract representation of ground truth data given an optimal multi-task classifier, which is shown to be learnable using RNN, LSTM, and GPT-2 based transformer architectures.
weaknesses: While the experimental results are solid contributions, the theoretical contributions are less appealing. The key theoretical results follow from fairly straightforward arguments, but appear a bit overstated. This can potentially be remedied with some re-wording and clarifying statements.  

In my opinion, the following two sentences in the abstract are overstated for reasons that I expand further below:  "The key conceptual finding is that, by producing accurate multi-task classification estimates, a system implicitly represents a set of coordinates specifying a disentangled representation of the underlying latent state of the data it receives.....Overall, our framework puts forth parallel processing as a general principle for the formation of cognitive maps that capture the structure of the world in both biological and artificial systems, and helps explain why ANNs often arrive at human-interpretable concepts, and how they both may acquire exceptional zero-shot generalization capabilities". 

The conditions under which the authors prove the theoretical result are rather strong. Specifically, the authors require 1) that the network is an *optimal* classifier in the sense that the network correctly computes the N_task logits associated with each of the N_task tasks, 2) that decision boundaries in the world are linear in the space of abstract variables, and 3) a highly simplified evidence accumulation problem. 

It follows from 1) and 2) that the output of an optimal network encodes the distance to the N_task decision boundaries. The optimal network will thus represent a linearly transformed version of the input if N_task is larger than the dimensionality of the input (provided the decision boundaries are not degenerate). The mathematical proofs presented in this paper formalize this argument. I believe it will help clarify the results if the authors provide this intuition upfront. The proofs have various conceptual issues, for example, in the use of the data processing inequality in Theorem B.5 and the mix-up of random variables and their estimators (lines 1442-1445). 

The authors state that their framework offers a "general principle for the formation of cognitive maps". I believe it will be helpful if the authors can clarify what this general principle is -- is it the proposal that decision boundaries in the world are linear in the space of the abstract variables or that biological networks are solving multiple tasks at the same time? How is the current work related to the formation of cognitive maps and zero-shot generalization?

---

confidence: 4
contribution: 3
initial_rating: 8
presentation: 3
questions: For the neuroscience reader, it would be good to clarify what multi-task means in this setting. Does it mean that there are many different classification criteria or decision boundaries that have to be met? In other words, is the multi-task aspect a way of saying that the number of classification criteria have to exceed the dimensionality of the underlying (ground truth) evidence? Perhaps it would be useful to have a simple example that people can imagine applying to a perceptual classification task in a psychophysics laboratory?

By evidence aggregation, did you mean evidence accumulation in the spirit of drift diffusion and race to bound models?

Is there any relationship between the functional form of your formulation and schemes based upon the principle of maximum mutual information (a.k.a. infomax principle) (Linsker, 1990). Canonical schemes here would include canonical variates analysis and non-linear versions, such as independent component analysis that take us into the realm of sparse coding models. One interesting aspect of independent component analysis is the identification of latent variables that have a non-Gaussian structure under the assumption that the random fluctuations are Gaussian. Is this related to your interesting observation that noise is required for the kind of disentanglement you are considering?

Can you formulate your evidence accumulation scheme as a Bayesian (e.g., extended Kalman Bucy) filter? If so, can you relate this to predictive coding in the brain (Rao, 1999)?

On a related note, can you formulate your description in terms of inverting a generative model? In other words, can you turn your scheme on its head and generate ground truth evidence from the ground truth classifications; i.e. causes. If so, is this one perspective on the requisite invertibility of f?
soundness: 3
strengths: The strengths of this paper rest upon a detailed treatment of the functional forms of mappings — implicit in neural network architectures — and how they can be unpacked in relation to maximising the mutual information between inputs and (classification) outputs. Another nice feature of this paper is its reference to neuroscience; in the sense of potential implications for neuronal processing in the brain.
summary: This paper demonstrates the emergence of disentangled representations in recurrent neural networks and transformer architectures in classification tasks based on evidence aggregation or accumulation over time. The conditions under which disentangled (latent) representations emerge are studied in relation to the number of classification criteria, relative to the dimensionality of the input. The paper motivates its focus with reference to the neuroscience literature on evidence accumulation and offers a number of theorems predicated on mutual information and the functional forms of nonlinearities in various mappings, implicit in the network architectures that could be adopted.
weaknesses: The specific contributions of the analysis are not foregrounded sufficiently. For example, one could read the setup considered by the authors as characterising a mapping between inputs x and classification estimates (Y^) using a bottleneck architecture (i.e., mapping through a low dimensional latent space or manifold). If any such mapping were optimised with respect to cross entropy or mutual information, would the latent representations not be disentangled? In other words, is it a linear (orthogonal) disentanglement that qualifies as interesting disentanglement? And, if so, does this inherit from the assumptions and functional form of the mappings in question?

The second weakness is the rather colloquial appeal to the neuroscience literature. For example, evidence aggregation or accumulation would not be considered canonical in the cognitive neurosciences. Canonical paradigms will be things like oddball paradigms, psychophysical paradigms, working memory paradigms, attentional paradigms, and so on. Furthermore, most of neuroscience nowadays cast disentanglement in terms of predictive processing under hierarchical or deep generative world models (i.e., disentanglement is a way of describing the inversion of a generative model of how independent causes become entangled). This inversion is usually articulated in terms of predictive coding or belief propagation. Given that the authors mention Bayesian filtering — and predictive coding can be read as extended Kalman (Bayesian) filtering — there might have been a missed opportunity to join the dots between the authors work and current formulations of perceptual synthesis and evidence accumulation in the brain. 

Related to this, there is a long history of sparse coding models in neuroscience that speak to the current questions; for example, sparse coding models, variants of independent component analysis, liquid computation, echo state machines, and so on (Gros, 2009; Hu et al., 2020; Maass et al., 2002; Olshausen and Field, 1996; Simoncelli and Olshausen, 2001; Suh et al., 2016). More recently, people have been looking at latent representations at various hierarchical levels to address compositionality and disentanglement; especially in relation to spatiotemporal receptive fields that can be assessed empirically in the brain e.g., (Ficco et al., 2021; George et al., 2021; Rao et al., 2023).

Ficco, L., et al., 2021. Disentangling predictive processing in the brain: a meta-analytic study in favour of a predictive network. Scientific Reports. 11, 16258.
George, D., et al., 2021. Clone-structured graph representations enable flexible learning and vicarious evaluation of cognitive maps. Nature Communications. 12, 2392.
Gros, C., 2009. Cognitive Computation with Autonomously Active Neural Networks: An Emerging Field. Cognitive Computation. 1, 77-90.
Hu, H.-y., et al., 2020. RG-Flow: a hierarchical and explainable flow model based on renormalization group and sparse prior. Machine Learning: Science and Technology. 3.
Linsker, R., 1990. Perceptual Neural Organization - Some Approaches Based on Network Models and Information-Theory. Annual Review of Neuroscience. 13, 257-281.
Maass, W., Natschlager, T., Markram, H., 2002. Real-time computing without stable states: a new framework for neural computation based on perturbations. Neural Comput. 14, 2531-60.
Olshausen, B.A., Field, D.J., 1996. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature. 381, 607-9.
Rao, R.P., 1999. An optimal estimation approach to visual perception and learning. Vision Res. 39, 1963-89.
Rao, R.P.N., Gklezakos, D.C., Sathish, V., 2023. Active Predictive Coding: A Unifying Neural Model for Active Perception, Compositional Learning, and Hierarchical Planning. Neural Computation. 36, 1-32.
Simoncelli, E.P., Olshausen, B.A., 2001. Natural image statistics and neural representation. Annu Rev Neurosci. 24, 1193-216.
Suh, S., et al., 2016. Echo-State Conditional Variational Autoencoder for Anomaly Detection. In: 2016 International Joint Conference on Neural Networks. IEEE International Joint Conference on Neural Networks (IJCNN), Vol., ed.^eds., pp. 1015-1022.

Meta-review: This paper explores the question of how abstract and disentangled representations can emerge in biological and artificial agents. The authors present both theoretical and experimental results demonstrating that multi-task learning, specifically within the framework of evidence aggregation classification tasks, can lead to the development of such representations.

Strengths: The paper introduces a theoretical framework connecting optimal multi-task classification to disentangled representations, building upon the empirical observations in Johnston and Fusi (2023). The paper provides a range of experiments exploring different architectures, task structures, and decision boundary geometries to validate these claims. The discussion of these results in the context of contemporary neuroscience literature is also well framed and places this paper in a good position to appeal to both the broader neuroscience and task-learning communities.
Weaknesses: The conditions for the theoretical results are rather strong, which may limit their practical relevance.  The experiments focus on synthetic data with simple latent structures. While these experiments effectively support the theoretical results, testing the framework on more complex data could provide further insights.

Overall, while the theory and experiments have limitations,  the paper still contributes meaningfully  to the understanding of disentangled representations and how they might arise. I think it will be valuable for the community and recommend accepting it.

Decision: Accept (Poster)