(A) Model schematic of the two-module ‘frontoparietal’ RNNs. Each RNN consists of 24 motion direction turned input units, 100 hidden units, and 3 response units. The hidden layer of each RNN consists of two modules simulating lateral intraparietal (LIP) and prefrontal cortex (PFC), respectively, with half of the units designated to each module (and E/I proportion maintained). Both the excitatory and inhibitory units in each module are recurrently connected within each module. The cross-module connections are more sparse than recurrent connection within each module. Only excitatory units project to the units in the other module. (B) Example recurrent connectivity matrix of an example two-module RNN. Inhibition is strictly local to each module, as is emphasized by the block-diagonal structure in the bottom fifth of rows. Excitatory projections between modules are sparse, while excitatory projections within modules are denser. Each row/column represents one unit. The 1–40th and 41–80th represent PFC and LIP excitatory units, respectively; while the 81–90th and 91–100th represent LIP and PFC inhibitory units, respectively. (C) The averaged sample category selectivity, test category selectivity, and matching/nonmatching (M/NM) selectivity of units in the LIP modules of the 41 successfully trained RNNs were quantified using fraction of explained variance (FEV). Each thin line denotes the result from one RNN. The thick lines denote the average of all the RNNs. (D) The sample category selectivity, test category selectivity, and M/NM selectivity of PFC modules. (E) The comparison of the latencies of M/NM selectivity between LIP and PFC modules. All RNNs were separated into the late and early group based on the latency of the M/NM selectivity in LIP module. The error bar denotes STD. (F) The averaged nonlinearity index of units in LIP (green) and PFC (pink) modules. The thick lines denote the average across all the RNNs. (G, H) The task variable encodings (sample, test, and M/NM) of the more-nonlinear (G) and less-nonlinear (H) groups of units in the PFC module are shown separately.