Connectoformer: Predicting Synaptic Connectivity from Neuron Morphology

Sidharth Goel, Erdem VarolNeurIPS 2026

TL;DR

Just because two neurons brush up against each other in the densely packed jungle of the brain doesn't mean they actually talk. Connectoformer is a Transformer model that reads the complex 3D branching shapes of neurons like sentences, predicting not only which neighboring cells form directed synaptic connections, but also which specific branches likely host the synapses. By moving beyond simple spatial overlap, it reveals just how much of the brain’s wiring diagram is implicitly recorded in cell geometry alone.

What Problem Does This Paper Address?

For decades, neuroscientists have leaned on a heuristic called Peters' rule: ifNeuron A’s axon and Neuron B’s dendrite occupy the same space, they probably connect. Spatial overlap creates opportunity, sure, but brains are extraordinarily picky. Among fruit fly neurons whose cell bodies are within 30 µm of each other and whose branching trees ("arbors") substantially overlap, only 2.4% actually wire together.

Empirical connection rates showing that spatial overlap creates opportunity, but most overlapping nearby pairs still do not connect.

Because a neuron's physical shape develops alongside its circuit wiring—guided by genetics, chemical cues, and physical constraints—its final 3D tree structure is a partial fossil record of how it chose its partners. Thanks to massive electron-microscopy "connectomes," we finally have the data to ask: how much synaptic specificity can we predict from bare 3D skeletons alone, without knowing cell types or gene expression? Training a network to answer this requires solving two headaches: turning sprawling, variable-sized 3D trees into neural-network-friendly inputs, and dealing with extreme class imbalance without letting the model cheat using simple distance shortcuts.

Methods

Enter Connectoformer. Instead of squashing a neuron into averaged summary numbers or voxel grids, the authors tokenize its 3D skeleton into a sequence of non-branching segments ordered outward from the cell body (soma) via breadth-first search. Each branch token captures local geometry, normalized spatial coordinates, and learned tree-position embeddings (depth and sibling rank) so the model knows where every twig sits in the arbor.

Figure 3: From skeletons to topology-aware tokens. (1) An SWC skeleton records point coordi- nates, radii, and parent links. (2) Non-branching point sequences form nodes in a rooted segment tree; fork points belong to the upstream segment, and single-point terminal segments are retained. Colors track the same segments across panels. (3) Branch S1 illustrates the 18-D feature vector: three parent-relative direction components, twelve geometry/tree statistics, and three soma-centered, extent-normalized midpoint coordinates. The arrow and white marker show direction and midpoint. (4) Breadth-first (BFS) ordering yields a sequence of branch vectors, projected to 128 dimensions and augmented with learned depth and sibling-rank embeddings before bidirectional encoding. Bars are symbolic, not measured feature values. The example omits the additional subtree-summary to- kens and masked batch padding; BFS ordering does not impose a causal attention mask.

A shared bidirectional Transformer encodes each neuron independently. To decide if Neuron A connects to Neuron B, the model blends two scores:

  1. A pooled whole-neuron score comparing overall shapes (augmented with a 25-D global shape summary).
  2. A cross-attention score where the individual branches of Neuron A directly attend to the branches of Neuron B.
Figure 1: Connectoformer. Left: FlyWire neurons colored by super-class, with two example neu- rons (A, B). Each skeleton is split into branch segments ordered outward from the soma, and each neuron’s segment tokens are encoded independently by a shared bidirectional Transformer. A pair is scored in two ways, by comparing pooled whole-neuron summaries and by letting each neuron’s branches attend to its partner’s branches, and the two scores are combined; an optional arbor penalty suppresses pairs whose arbors barely overlap. The branch-to-branch similarity matrix also ranks which branches likely carry the pair’s synapses. (a) Predicted connectivity among held-out neurons grouped by neuroblast (black outlines; black dots mark true connections). (b) An example pair: segments with the top 5% predicted synapse scores on the presynaptic (red) and postsynaptic (blue) neuron, with ground-truth synapses (diamonds). (c) UMAP of the pooled neuron representations of held-out neurons, colored by the same super-class colors as the brain at left; neurons group by region and cell identity (Appendix D.5).

What’s particularly neat is the training recipe: alongside binary connectivity, the authors add auxiliary loss terms using ground-truth synapse locations (which are withheld at test time). This nudges the cross-attention matrix to highlight the exact branches carrying the synapses. An optional "arbor penalty" can also be tacked on to filter out pairs whose arbors barely overlap in space.

Datasets

  • FlyWire (v783): The primary training and evaluation playground, containing 138,584 adult female Drosophila neurons and ~3.73 million directed connections (thresholded at $\ge 5$ synapses). Neurons exceeding 2,048 branches (4.1%) are filtered out. The authors construct rigorous splits holding out random neurons, contiguous spatial patches, entire brain regions (optic lobe), developmental lineages, and unsupervised shape clusters.
  • Male Adult Drosophila CNS: Used zero-shot (without retraining) to test whether learned wiring rules transfer to a completely different individual fly of the opposite sex.
  • C. elegans Connectome: Used in appendix probes to test cross-species transfer.

Key Insights and Ideas

  • Branch-to-branch interactions break tough ties: Averaged whole-neuron features (fed into a matched MLP) are great at weeding out obvious non-partners. However, retaining individual branch tokens via cross-attention shines brightest on hard negatives—candidate neurons that live right next door or share the exact same developmental stem-cell lineage.
  • Morphology captures more than a cell-type lookup—up to a point: Models using only 3D skeletons outperform baselines given explicit cell-identity labels. Yet, if you hold both the source and target cell types fixed and ask which specific individuals connect, Connectoformer offers no advantage over a basic MLP (both hover near 0.56 AUROC). At that fine granularity, local molecular lock-and-key proteins likely take over without altering branch shape.
  • Asymmetric synapse localization: Using cross-attention scores to pinpoint where synapses form works surprisingly well on the sending (presynaptic) neuron, but barely beats random guessing on the receiving (postsynaptic) neuron.

Key Results

  • Beating overlap and pooled MLPs on hard cases: On randomly held-out neurons (morphology only), Connectoformer + summary achieves 0.842 Hard AUROC (nearby non-partners) and 0.834 In-Type AUROC (nearby, same-lineage non-partners), beating the raw arbor-overlap baseline (0.686 / 0.569) and the input-matched MLP (0.789 / 0.770). Adding a fixed spatial overlap prior pushes overall AUROC to 0.916.
  • Zero-shot generalization across flies: Applied directly to the male Drosophila CNS without retraining, Connectoformer reaches 0.739 Hard AUROC, outperforming both the matched MLP (0.701) and spatial overlap (0.623). It also generalizes better to unseen neuron shape clusters.
  • Presynaptic branch retrieval: Across 1,000 connected test pairs, a true synapse-bearing presynaptic branch lands in the model's top-10 highest-scored branches 41.0% of the time (3x the 13.6% chance rate), whereas postsynaptic top-10 retrieval is weak (14.4% vs. 11.1% chance).

Limitations and Future Work

The authors are admirably transparent about where morphology hits a wall. First, excluding the 4.1% largest neurons (>2,048 branches) leaves out massive wide-field cells during training. Second, morphology alone struggles to transfer to an entirely unseen brain region (training on the central brain and testing on the optic lobe yields ~0.70 Hard AUROC, with no clear architectural winner), and cross-species transfer from flies to C. elegans shows no robust benefit. Finally, because real brains are sparsely wired, absolute precision at the true population connection rate remains low—meaning Connectoformer can't replace electron-microscopy reconstruction. Instead, it is best suited as an intelligent triage tool to prioritize candidate connections and presynaptic branches for human proofreaders or wet-lab experiments. Future models could close the remaining specificity gap by incorporating subcellular compartment labels, ultrastructural cues, and molecular recognition profiles.

Summary updated

Abstract

Neuronal morphology constrains which neurons can form synaptic connections. Understanding how morphology shapes connectivity could help prioritize candidate synapses for proofreading and reveal structural features associated with circuit wiring. Recent connectomes provide the reconstructed morphologies and synapse annotations needed to build computational models that capture this relationship at scale. Training such models requires addressing the imbalance between the few neuron pairs that connect and the many that do not, as well as representing complex neuronal arbors as inputs to neural networks. Sampling nearby connected and unconnected pairs provides a more informative learning task, while the branching structure of neuronal arbors calls for a tokenization that preserves their geometry and topology. We introduce $\textit{Connectoformer}$, a Transformer-based model that predicts directed connections from neuron morphology. $\textit{Connectoformer}$ decomposes each neuron skeleton into branch segments and represents each segment as a token containing its geometric features and position within the neuronal tree. A shared Transformer encodes the branch tokens of each neuron independently. To predict a connection, the model combines a score derived from whole-neuron representations with a score derived from cross-attention between the branches of the two neurons. The model is trained to predict connectivity and, using synapse location annotations as additional supervision, to identify branches likely to contain the neuron pair’s synapses. On the FlyWire adult $\textit{Drosophila}$ connectome, $\textit{Connectoformer}$ distinguishes connected neurons from nearby unconnected neurons better than an arbor-overlap baseline. Compared with models that pool branch features into a single representation per neuron, branch-level interactions improve prediction most clearly for nearby and developmentally related candidates. We further evaluate generalization to held-out brain regions, developmental lineages, and neuron shapes, as well as to a second fly. Using synapse locations during training, $\textit{Connectoformer}$ also identifies branches likely to contain a neuron pair’s synapses, providing a starting point for investigating where connections form along neuronal arbors. Code is available at https://github.com/sgoe1/connectoformer.
BibTeX
@inproceedings{goel2026connectoformer,
  author = {Sidharth Goel and Erdem Varol},
  title = {{Connectoformer: Predicting Synaptic Connectivity from Neuron Morphology}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Ic7mZ8IFTo},
}
Figure