Computer Science
Spatially embedded recurrent neural networks reveal widespread links between structural and functional neuroscience findings
J. Achterberg, D. Akarca, et al.
Discover the groundbreaking spatially embedded recurrent neural networks (seRNNs) model that uniquely merges artificial systems with biophysical constraints. This research, conducted by Jascha Achterberg, Danyal Akarca, D. J. Strouse, John Duncan, and Duncan E. Astle, unveils how seRNNs embody features akin to primate cerebral cortices, shedding light on structural and functional neuroscience.
~3 min • Beginner • English
Introduction
The study investigates how relationships between brain structure, function, and behavior emerge from fundamental constraints. Brains must optimize information processing while incurring metabolic costs for wiring and maintaining networks in physical space. Prior observations suggest common organizational solutions across species—sparse, small-world, modular connectivity and characteristic tuning—may arise from such optimization pressures. The authors pose the question of whether imposing biophysical constraints during learning leads artificial networks to converge on brain-like structure and function. They introduce spatially embedded recurrent neural networks (seRNNs), in which recurrent units are placed in 3D space and regularized by physical distance and network communicability while learning a working-memory-like inference task, to causally link how joint constraints shape both connectivity and coding.
Literature Review
Existing computational models have shown that network modularity can arise from spatial wiring costs, that orthogonal population dynamics can emerge by optimizing task performance, and that predictive coding can follow from energy efficiency constraints. Communication dynamics and constraints on signal propagation are central to complex brain networks. However, prior work has not simultaneously incorporated anatomical embedding and functional optimization into a single model that can trade off structural, functional, and behavioral objectives during learning. Generative network modeling literature indicates that homophily wiring rules often best reproduce empirical connectomes at macro- and micro-scales, and empirical cortical networks exhibit modularity and small-worldness. Mixed selectivity has been identified as advantageous for complex cognition, and neural coding is shaped by energy budgets. This study builds on and unifies these lines by jointly enforcing spatial and communication constraints during task optimization.
Methodology
The authors develop spatially embedded recurrent neural networks (seRNNs) by modifying the regularization of an RNN’s recurrent weight matrix to incorporate physical and topological constraints. Units in the recurrent layer (100 units) are assigned fixed coordinates on a 5×5×4 grid in three-dimensional Euclidean space. The loss combines task loss (cross-entropy) with a structural regularization term that penalizes large weights proportionally to Euclidean distance and a weighted communicability term, encouraging pruning of long and topologically peripheral connections: L = L_task + γ || W ⊙ D ⊙ C ||_1, where W is the recurrent weight matrix, D the pairwise Euclidean distance matrix between units, and C the weighted communicability matrix (Hadamard product). Weighted communicability preferentially preserves short, core connections that support efficient intra-network communication while discouraging redundant peripheral links. Networks are trained with Adam (lr=0.001, β1=0.9, β2=0.999, ε=1e−7) for 10 epochs; each epoch has 5,120 problems (batch size 128). Two groups are trained: 1,000 seRNNs with the joint spatial-communicability regularization and 1,000 baseline RNNs with standard L1 regularization (minimizing ||W||_1). Regularization strengths are varied across networks; spectra are matched functionally by where performance begins to deteriorate, and analyses focus on networks achieving ≥90% accuracy (seRNN n=390, L1 n=479). Task paradigm: a one-step inference/working-memory task of 50 time steps per trial—goal presentation (20 steps), delay (10), choice options (20). Inputs are eight one-hot channels (four goal locations; four choice directions) with Gaussian noise (σ=0.05). The network outputs one of four choices at the trial end. Structural analyses: modularity Q and small-worldness σ computed on absolute weights (Brain Connectivity Toolbox); for binary measures, top 10% strongest edges are retained. Generative network modeling is used to fit wiring rules (e.g., spatial, degree, clustering, homophily) to learned connectomes. Functional analyses: unit activity recorded over 640 trials; decoding via cross-validated L1 regression estimates explained variance (EV) per unit for variables (goal, choices). Spatial permutation tests assess clustering vs distribution by comparing weighted Euclidean distances among high-preference units against nulls. Mixed selectivity is quantified by the correlation across units between EV_goal and EV_choices at the decision time. Energy consumption is approximated by mean unit activation during the post-choice-onset integration period, controlling for average recurrent weight strength.
Key Findings
• Both seRNNs and L1 RNNs learn the task with high accuracy among converged networks (seRNN n=390; L1 n=479), with overall weight magnitudes decreasing during training, confirming effective regularization. • seRNNs preferentially prune long-distance connections, yielding a negative correlation between weight and Euclidean distance; L1 networks show no such relationship. seRNN pruning also targets topologically peripheral edges (lower weighted communicability). • Structural topology: seRNNs consistently exhibit higher modularity and higher small-worldness than L1 networks across training. At epoch 9, differences are large for modularity (Cohen’s d ≈ 1.07) and moderate-to-large for small-worldness (Cohen’s d ≈ 0.59), with highly significant group differences. seRNN modularity Q and σ fall within empirically observed ranges. • Generative network modeling: homophily wiring rules best approximate seRNN connectomes, aligning with empirical macro- and micro-scale data. • Functional spatial organization: in seRNNs, goal-coding units cluster spatially (lower P_perm), while choice-coding units are distributed (higher P_perm). This pattern evolves over the trial—goal information starts widespread, becomes clustered in mid-trial, and partially disperses by the decision time—whereas L1 networks show no systematic spatial functional organization. • Mixed selectivity: at decision time (epoch 9), the correlation across units between EV_goal and EV_choices is near zero in seRNNs (median r = −0.057) versus anticorrelated in L1 (median r = −0.303), indicating more neutrally mixed selectivity in seRNNs. • Energetic efficiency: seRNNs show lower mean unit activations than L1 networks during integration after choice onset, controlling for average weight strength (P < 0.001; t(86,497) = 21.4; 95% CI: [−0.271, −0.226]); the effect diminishes at higher mean weights (weaker spatial embedding). • Critical parameter window: accurate, sparse, modular, and small-world seRNNs co-occur within a sweet-spot of low-to-medium regularization strengths and later training epochs; outside this window, networks are either too dense (less modular) or too sparse (lose function and small-worldness). Within this window, coding is well mixed and balanced across goal and choice variables.
Discussion
The findings demonstrate that simultaneously optimizing task performance under biophysical constraints of spatial wiring cost and communication efficiency drives artificial recurrent networks to converge on hallmark structural and functional features of biological brains. By embedding units in 3D space and penalizing long, topologically peripheral connections, seRNNs develop sparse, modular, small-world architectures consistent with empirical cortices, best captured by homophily wiring rules. Functionally, seRNNs exhibit spatial clustering of task-relevant information (goal) and distribution of other variables (choices), implement mixed selectivity near the decision point, and achieve lower activation energy, supporting the view that coding strategies are shaped by energy-information trade-offs. Critically, these features emerge together within a constrained parameter regime, mirroring the idea that brains operate in a critical niche where structural and functional properties co-exist to support flexible cognition. The work bridges structural and functional communities by providing a controllable model where constraints, topology, coding, and behavior can be causally linked.
Conclusion
Spatially embedded RNNs show that enforcing realistic wiring and communication constraints during learning yields brain-like organization: modular small-world topology, homophily-like wiring, spatially structured functional codes, mixed selectivity, and reduced activation energy. These features co-occur within a critical parameter window, highlighting interdependence between structure and function under economic constraints. The seRNN framework offers a topophysical approach to connect structural and functional modeling, with potential to inform NeuroAI. Future directions include adding biological detail (molecular guidance, spiking heterogeneity), modeling developmental trajectories and specialization, exploring individual variability, extending to continuous multi-task environments, and quantifying how biophysical constraints modulate network randomness.
Limitations
The models abstract away many biological details (e.g., molecular circuit development, heterogeneous spiking dynamics), which may influence the trade-offs in real brains. Results focus on a simplified one-step inference/working-memory task; generalization to richer multi-step, multi-task settings remains to be tested. The matching of regularization spectra between seRNN and L1 groups is approximate; while analyses focus on high-accuracy networks, more precise numerical matching could refine comparisons. Decoding analyses exclude low-accuracy networks, potentially biasing functional assessments. The extent to which biophysical constraints reduce structural randomness relative to standard task-optimized networks is currently unknown.
Related Publications
Explore these studies to deepen your understanding of the subject.

