Introduction
Our brains juggle seeing, hearing, remembering, thinking, and deciding all at once—yet we switch between tasks with remarkable ease.
The secret lies in how the brain divides labor: its networks are organized into relatively independent modules, with tight connections within each module and coordinated links between them.
So how does this department-like structure arise?
Using artificial neural networks, our team offers a new answer: modularity can emerge spontaneously as a network learns to handle many tasks.
Understanding this helps us appreciate the brain’s organizing principles and offers fresh ideas for building smarter brain-inspired AI.

Multi-task demands drive modularity, and artificial networks show structural links to brain networks
On September 28, 2026, the team of Gang Pan and Shi Gu from Zhejiang University’s State Key Laboratory of Brain-Machine Intelligence, College of Computer Science and Technology, and Liangzhu Laboratory—together with researchers from the University of Electronic Science and Technology of China, New York University, and the University of Pennsylvania—published “Task-structured Modularity Emerges in Artificial Networks and Aligns with Brain Architecture” in Nature Machine Intelligence. The study found that multi-task learning promotes the emergence of modular structure in recurrent neural networks with limited representational capacity, and that gradually adding connections further strengthens this process. By combining task-driven functional organization with spatial constraints, the team also built a generative model that better captures the topological features of human brain connectomes.

01 Background
Modularity is a key organizational feature of brain networks. Different modules support relatively specialized information processing, while cross-module connections enable integration. Previous work has proposed that constraints such as shorter connection distances and lower wiring costs can promote modularity, rooted in physical space and metabolic cost. But brains also continuously adapt to many cognitive tasks: some share sensory information and computations, while others require different or even opposing response rules. How these functional demands shape network structure still needs testable computational explanations.
It is difficult to disentangle task demands, learning, and network structure directly in biological systems. The team used artificial neural networks as a controllable experimental platform, systematically varying task number, network capacity, and connection-growth patterns, tracking the formation of modular structure and testing its role in task learning. This allowed them to examine how functional demands shape structure—and the organizing principles of brain-like networks.
02 Methods
The researchers used recurrent neural networks to learn 20 cognitive tasks spanning working memory, perceptual decision-making, multisensory integration, inhibitory control, and more. They compared three training regimes: each network learned a single task alone; one network learned multiple tasks in randomly interleaved fashion; or recurrent connections were gradually added during multi-task training. The third group ended with the same connection set as the control group, allowing the researchers to test the effect of the connection-formation process itself.
They combined modularity of recurrent connection weights, representational similarity of neural activity, and task performance to analyze joint changes in structure and function. They then preserved different types of connection structure, reinitialized the weights, and retrained the networks to test the functional value of modular structure. Finally, using Human Connectome Project (HCP) brain network data, they compared the explanatory power of spatial constraints versus task demands for network topology.

Figure 1. Cognitive tasks and three training regimes. Single-task, multi-task, and gradual connection growth during multi-task training are compared to track the emergence of network modularity
03 Key Results
1. Multi-task demands promote modularity when capacity is limited
Multi-task training led to more pronounced modular structure, an effect closely tied to task load and network capacity. In networks with fewer hidden neurons, modularity rose significantly as task number increased; when capacity was ample, task number had a weaker effect. Using the ratio of task number to the effective dimensionality of hidden states as a measure of relative task load, the researchers found that this ratio was significantly positively correlated with final modularity.

Figure 2. Task load and representational capacity jointly shape modularity. Under capacity constraints, multi-task training promotes stronger modularity; modularity rises with relative task load
This suggests that modularity can be an adaptive way for a network to coordinate multiple tasks under limited representational resources. In the tested configurations, a multi-task network with 32 hidden neurons approached the average performance of 20 independent single-task networks, each with 8 hidden neurons—evidence that multiple tasks can share internal representations.
2. Task relationships shape sharing and division of labor in neural representations
How do different tasks coexist in the same network?
The researchers distinguished three representative representational relationships: tasks with conflicting rules tended to form relatively separate representations; tasks with shared computations could partially share representations; and tasks with containment relationships could heavily reuse the same representational space. For example, responding toward a stimulus versus in the opposite direction imposes different output demands, while simple reaction tasks and reaction tasks involving a memory delay showed stronger representational reuse.
Similarity analysis of neuronal activity showed that as training progressed, initially diffuse representations gradually organized into clear, stable modules. Modularity thus reflects both sharing and division of labor across tasks: similar computational demands promote reuse, while differing task requirements drive functional specialization.

Figure 3. Task relationships and the formation of neural representation modules. Different tasks show separation, partial sharing, and containment; representational similarity reveals modules forming over training
Further analysis showed that the link between modularity and learning performance depends on network capacity and training stage. In models with only 8 hidden neurons, maximum modularity during training was negatively correlated with the number of iterations needed to reach 30% accuracy (r ≈ −0.28) and positively correlated with final task performance (r ≈ 0.38). This suggests that under resource constraints, the degree of modularity can reflect differences in both the learning process and final performance.

Figure 4. Modularity and learning performance. Left: the association varies with network capacity and training stage. Right: in 8-hidden-neuron models, maximum modularity versus learning speed and final performance
3. Gradually adding connections strengthens modularity and produces learning-friendly structure
With the final connection configuration held constant, networks that gradually added recurrent connections during training developed higher modularity than networks that started with all final connections. This indicates that the timing of connection formation also affects how a network organizes itself.

Figure 5. Connection growth and the learning value of modular structure. Gradually adding connections strengthens modularity; preserving the trained modular structure, reinitializing the weights, and retraining yields better task performance under capacity constraints
To test whether these modules had real functional value, the team preserved the trained within-module connections and a small number of strong cross-module connections, reinitialized the weights, and retrained the networks. With the same number of connections, this structure outperformed random connectivity and predefined modular structures, with the advantage more pronounced in smaller networks. The results indicate that task-adapted connection organization has reusable learning value.
4. Spatial constraints and task demands jointly improve fit to brain network topology
The team then used functional connectivity relationships formed through task learning for generative network modeling, comparing four models: random connectivity, spatial distance only, task-related connectivity only, and combined spatial and task information. Using brain networks from 758 participants, they assessed differences between generated and real brain networks across node degree, clustering coefficient, betweenness centrality, and connection length.
The model combining spatial constraints and task information achieved the best overall fit. Task-related organization helped capture higher local clustering and longer-distance connections, complementing the explanatory power of spatial distance constraints. Even after penalizing model complexity, the joint model remained superior. This provides computational evidence that functional demands and physical constraints jointly shape brain-like network topology.

Figure 6. Spatial constraints and task demands jointly improve fit to brain network topology. The joint model most closely matches real brain networks across node degree, clustering coefficient, betweenness centrality, and connection length
04 Summary and Outlook
This study addresses how task demands shape network structure, revealing the combined contributions of multi-task learning, representational capacity, and connection growth to modularity formation. Through structure-preserving and retraining experiments, it validates the functional value of task-adapted modules. Comparisons with the human connectome further show that incorporating task-related organization into models helps better explain the topological features of brain networks.
For brain-inspired AI, these results suggest that connection structures can be gradually adjusted during learning around task-sharing relationships and network resource constraints, offering testable ideas for structural design and resource allocation in multi-task models. These conclusions are based on controlled artificial recurrent network experiments; their applicability to biological neural development, synaptic plasticity, and more complex models remains to be investigated.
Shi Gu and Gang Pan of Zhejiang University are co-corresponding authors. The first author is PhD student Yuhang Wu. Shikuang Deng, a postdoc at the University of Electronic Science and Technology of China; graduate student Kangrui Du; Assistant Professor Marcelo G. Mattar of NYU; Professor Dani S. Bassett and Dr. Yifan Wu of the University of Pennsylvania; and Professor Huajin Tang of Zhejiang University also made important contributions. This research was supported by the National Natural Science Foundation of China, the National Key R&D Program of China, the Major Project of the Zhejiang Provincial Natural Science Foundation, and the Fundamental Research Funds for the Central Universities.
Original article:
https://www.nature.com/articles/s42256-026-01306-9
