Figures and data

Single-task and multi-task network dynamics.
(A) Left: Illustration of a state-space trajectory in the space of neuronal pre-activations (purple), confined to a task-relevant two-dimensional subspace. Such a geometry arises in rank-two networks with loading vectors m(1), m(2). Right: Illustration of the same trajectory in firing-rate space. Activity lies on a two-dimensional nonlinear manifold. (B) Schematic of a “multi-task” network that flexibly implements multiple low-dimensional dynamics. Each task is associated with a different nonlinear manifold, which collectively span more activity dimensions than any one manifold. (C) Schematic of multi-task network connectivity as a sum of low-rank matrices, each associated with a different task. (D) Each task is associated with an overlap matrix comprising pairwise inner products among the left and right loading vectors.

Dynamics of networks with varying P.
See Methods for parameter values. (A) Latent-variable flow fields (black) and a latent-variable trajectory (purple) in a single-task network with A chosen to produce limit-cycle dynamics. Dashed line: limit cycle. (B) Latent-variable flow fields (black) and latent variable trajectories for two separate runs with different initial conditions (red) in a single-task network with A chosen to produce two stable fixed points. Black X’s: final time points for all trajectories used to generate flow fields. (C) A two-task network with D(1) > D(2). Left: flow fields (black) of projections 






Task-selected states.
(A) Top: Illustration of task selection as promoting activity in the chosen task’s subspace, which contains task-specific dynamics. Bottom: Phase diagram as a function of the task strength D(µ), comprising the spontaneous, chaotic task-selected, and nonchaotic task-selected states. Schematic of task selection at the level of connectivity: modulating the strength of the chosen task’s connectivity component through the associated D(µ) value. (C) Trajectory of a task-1 latent variable (normalized by D(µ)), 


Phase diagrams for networks generated as a sum of single-task components associated with oscillatory dynamics (see Methods).
(A) Network state as a function of normalized number of tasks α = P/N and the strength of one task D(µ). All other tasks have D(ν≠µ) = 2 (solid line). Dashed line: Boundary between spontaneous and chaotic task-selected state for task µ. Dot-dashed line: Boundary between chaotic and nonchaotic task-selected state for task µ. (B) Same as (A) but for fixed α = 1 and instead varying the frequency of the limit cycle task that is selected. Black boxes: Parameter values whose associated single-neuron properties are examined in Fig. 5.

Single-neuron and population properties of a multi-task networks.
Parameters are the same as Fig. 4 (see Methods). (A) Example neurons (top) and latent variables for the selected task (bottom) across network states. (B) Histogram R2 values for linear regression of xi(t) against task-µ latent-variable activity. (C) Average single-neuron autocovariance functions Cx(τ) = ⟨xi(t)xi(t + τ) ⟩ t,i. (D) Top: Principal component trajectories across same network states from (A), (B), and (C). For currents xi(t) and firing rates ϕi(t), principal component axes and projections onto these axes are computed separately, with ϕi(t) projections doubled for visibility. Axis scales: 150 (left), 300 (middle), 500 (right). Bottom: Linear embedding dimension computed as participation ratio of the firing rates ϕi(t), as a function of D(µ). Light dots: individual network simulations. Heavy dots: averages over networks. (E) Firing-rate dimension as a function of recording time for a network in the spontaneous state and switching across task-selected states. For the latter, one of 150 tasks is randomly selected for 80 time constants, followed by 3 time constants of spontaneous activity, and this process is repeated. Thin lines: individual network simulations. Thick lines: average. Inset: The same plot but for networks with different N, showing dependence on N in the spontaneous state.

Illustrations of three interpretations of the network’s effective connectivity.
(A) Modulation of D(µ) modifies the recurrent connections 


Conceptual illustration of the DMFT.
(A) Cartoon illustrating an alternative interpretation of the neuron-to-neuron recurrent dynamics, as continuous-time, bidirectional interactions between a reservoir of neurons (blue: currents; yellow: firing rates) and a reservoir of latent variables (dark and light purple). Here we have a single set of dominant latent variables (P∗ = 1), illustrated as larger purple disks. (B) Types of effective input a single neuron receives in the DMFT: input from dominant task latent variables with tuning determined by 



Summary of network parameters used in simulations across figures.
In all cases, R = 2.

More detailed illustrations of connectivity structure.
(A) Alternative interpretation of the sum in Fig. 1C as one large matrix product, with left loadings organized in one matrix as columns (blue) and right loadings in another as rows (yellow), with scalings as diagonal elements. The blue or yellow rectangular boundaries group the loading vectors into tasks, so r = 1, 2 indexes vectors within a block, while µ = 1, …, P indexes rectangular blocks. (B) Example connectivity strength spectra D(µ), which can generally be dispersed or concentrated among tasks. (C) Illustration of the overall overlap matrix for all loading vectors, grouped by task by blue or yellow rectangular boundaries, as the matrix product of the left loading vectors as rows of one matrix (blue) with the right loading vectors as columns of one matrix (yellow). (D) Geometric interpretation of an entry of the overlap matrix as the degree of alignment of the associated left and right loading vectors. The m’s (and n’s) are shown to be orthogonal among themselves.

Dynamics for the same network as Fig. 2C but with D(1) = 2, D(2) = 2.2.
(A) Purple: activity in the task-1 subspace for a single run of the dynamics. Black: flow fields over many runs. (B) Red: activity in the task-2 subspace over two runs with different initial conditions. Black: average flow fields over many runs.

Similar simulations as in Fig. 2, but for networks with different nonlinearities.
(A) A network using a diagonally shifted error function, by 1 in each direction, such that outputs are always positive, and it requires positive current to activate a neuron. (B) A network using a non-saturating nonlinearity, in particular a relu function (shifted leftward by 1). To ensure global stability, an additional term −gI/N is added to each Jij, with gI = 2.

Comparing modulation of task-specific input drive and task-specific connectivity, for task µ = 1 in the same network shown in Fig. 3.
(A) Left: spontaneous-state activity in the task-1 subspace, featuring weak, noisy oscillations. Top: modulating the additive input drive 

Dynamics in the spontaneous state.
(A) Example activity traces for a network with α = 0.5; D(µ) = 2 for all µ; A(1), A(2) as in Fig. 2C, with 



(A) Participation ratio of firing rates for networks with variable D(ν) values for all non-selected tasks ν ≠ µ, as D(µ) is varied relative to its critical point for task selection. Light dots: individual network simulations. Heavy dots: averages over networks. Dashed line: theory.

Cartoon showing how to read off the dimensionality of the task-selected state from the single-unit autocovariance function.
(A) Black: Theoretically calculated autocovariance function Cϕ(τ) from Fig. 3F (middle). The value at τ = 0 at the average squared value over one period after full amplitude decay are the relevant quantities for computing the PR. The latter captures asymptotic behavior of the autocovariance function away from τ = 0, which is needed for Eq. (44).