TL;DR
Researchers have developed a unified graph-based framework to represent various Vision Transformer (ViT) architectures, revealing that top-performing models share specific "sweet spots" in their graph topology. Crucially, the study finds that these high-performing artificial networks structurally resemble mammalian brains more closely than simpler models do, offering a new bridge between AI and neuroscience.
What Problem Does This Paper Address?
While Vision Transformers (ViTs) and their variants (like Swin, Mixer, and MetaFormer) have revolutionized computer vision, we lack a unified way to compare their internal structures. Each model uses different strategies to aggregate spatial information—some use self-attention, others use MLPs or even simple pooling.
Furthermore, while artificial neural networks (ANNs) are loosely inspired by biology, the structural similarity between modern ViTs and real biological neural networks (BNNs) remains largely unexplored. This paper aims to bridge these gaps by proposing a relational graph representation that can describe any ViT architecture and compare it directly to the "connectomes" of biological brains.
Methods
The authors decompose the complex operations of a ViT into two distinct sub-graphs:
- Aggregation Graph: This treats spatial image patches (tokens) as nodes. It describes how information is shared across different regions of an image. For example, in a standard ViT, the self-attention mechanism defines the edges of this graph.
- Affine Graph: This treats network channels as nodes. it reflects the communication between different features or dimensions, typically occurring within the Feedforward Networks (FFN).
To make different models comparable, the authors fixed the aggregation graph size (e.g., 14x14 nodes) and used down-sampling or up-sampling techniques for models with different resolutions. They then characterized these graphs using two standard metrics from graph theory:
- Clustering Coefficient ($C$): Measures how "clumped" the nodes are (segregation).
- Average Path Length ($L$): Measures how many "steps" it takes to get from one node to another (integration).
Datasets
The study evaluated 21 pretrained ViT models across several datasets:
- Image Classification: CIFAR10, Animal10, and Flower17 (a small-sample dataset to test adaptability).
- Training from Scratch: ImageNet-1k was used to observe how graph measures evolve during training.
- Biological Connectomes: The authors compared their artificial graphs to real brain data from C. elegans (nematode), rats, cats, and macaque monkeys.
Key Insights and Ideas
- The "Sweet Spot" for Performance: The researchers discovered a U-shaped correlation between graph measures and model accuracy. The best-performing models aren't those with the highest or lowest clustering, but rather those that fall into a specific "sweet spot" ($C \approx 0.84$, $L \approx 1.2-1.3$).
- ViTs are "Mammalian": In a striking finding, the relational graphs of ViTs showed high similarity to the brain networks of cats and macaques. In contrast, older MLP and CNN models were structurally closer to the simpler nervous systems of worms. This suggests that the success of ViTs may stem from their more "advanced" information exchange patterns.
- Indicators of Learning: During training, the graph measures change in tandem with accuracy. This suggests that $C$ and $L$ could serve as "health indicators" for model training, potentially identifying failing runs early.
- Adaptability in Few-Shot Learning: For small datasets like Flower17, the relationship between graph structure and performance becomes linear rather than U-shaped, indicating that certain graph topologies are inherently better at adapting to new tasks with limited data.
Key Results
- Quantitative Sweet Spots: Identified stable sweet spots across multiple datasets: $C \in [0.839, 0.842]$ and $L \in [1.256, 1.307]$.
- Predictive Power: On the Flower17 dataset, the clustering coefficient showed a strong linear correlation with accuracy ($R^2 = 0.51, p < 0.001$), proving it is a robust indicator of model performance in data-constrained scenarios.
- Biological Alignment: ViTs consistently demonstrated higher topological similarity to mammalian BNNs than traditional CNNs, as visualized in the comparative heatmaps of Figure 4.
Limitations and Future Work
The primary limitation acknowledged is the content-independent assumption. The current graph construction assumes that image patches are independent and that spatial relationships are fixed by positional embeddings, ignoring the actual visual content of the image.
Future work could involve:
- Integrating dynamic, image-content-dependent information into the graph construction.
- Using these "sweet spots" as constraints for Neural Architecture Search (NAS) to automatically design more efficient and biologically-plausible models.
- Exploring how these graph properties relate to model robustness and adversarial vulnerability.
Summary updated