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 onto task-1 subspace and a latent-variable trajectory (purple). Right: flow fields (black) of projections onto task-2 subspace simulated over many initial conditions, as well as two example trajectories (red). Black X’s: final time points for all trajectories. (D) Time-averaged latent variable norm for task µ = 1 as a function of the number of total tasks α = P/N normalized by N. Same overlap parameters as (C) for µ = 1, 2, and beyond µ > 2 we randomly sampled . (E) Same plot of task-1 dynamics as in left panel of (C) but for a network with P = 1000 and smaller axis scales. (F) Time-averaged power of the projections onto all task subspaces, normalized by D(µ) and sorted in descending order, for a network with P = 500 tasks (black) and a network with P = 2500 tasks (gray) from panel (D). (G) Top: average gain as a function of time for two different networks, one with no task dominant (gray) and one with task 1 dominating (black). Middle: normalized latent-variable trajectories for each task in the task-1-dominant network. Bottom: same as middle for the network with no task dominant; note the difference in y-axis scale.

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(µ)), , when task-1 limit-cycle dynamics are selected (left) vs. when task-2 bistable dynamics are selected (right), in all 3 regimes. To illustrate bistability, multiple trajectories with different initial conditions are plotted on the right. (D) Same as (C) but for a task-2 latent variable . (E) Same as (C) and (D) but for an example neuron’s activity.

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 of a cortical network. (B) Interactions between neurons are driven by effective connectivity defined by thalamocortical loops. Modulation of D(µ) adjusts the gain of thalamic neurons [50]. (C) Model in which the effective connectivity is a combination of (A) and (B).

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 (top); summed input from weak-task latent variables, which is well described as a sample from a Gaussian process (middle); and nonlinear effective self-interaction that arises through coherent summation of the neuron’s perturbative effect on latent-variable trajectories (bottom). (C) Types of effective input a single weak-task latent variable receives in the DMFT: summed input from neurons, which is well described as a sample from a Gaussian process (top); and effective self-interactions that are mediated by single-neuron response properties as well as task-specific parameters D(µ) and A(µ) (bottom).

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 to each neuron i in the direction of the first task-1 left loading vector. Values of I0 are (left to right) 0, 0.5, 1, 1.5. Bottom: modulating the strength of the task-1 connectivity component. Values of D(1) are (left to right) 2, 2.75, 3.5, 4.25.

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 i.i.d. with rejection sampling for positive-definiteness violations; and N = 8000. Top: latent activity for a limit-cycle task (µ = 1) and a fixed-point task (µ = 2) in the spontaneous state. Bottom: current and firing-rate traces for two example neurons in the network. (B) Lagged cross-covariance functions for , i.e. . Top left: r = 1, r′ = 1. Top right: r = 1, r′ = 2, etc. Solid: simulation. Dashed: theory. (D) Single-neuron autocovariance function Cϕ(τ) = ⟨ ϕi(t)ϕi(t + τ) ⟩t (top) and impulse-response function Sϕ(τ) = ⟨ϕ′⟩ F(τ) (bottom) and for the same network. Solid: simulation. Dashed: theory.

(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).