Abstract
In the last few years, the success of Transformers in computer vision has stimulated the discovery of many alternative models that compete with Transformers, such as the MLP-Mixer. Despite their weak induced bias, these models have achieved performance comparable to well-studied convolutional neural networks. Recent studies on modern Hopfield networks suggest the correspondence between certain energy-based associative memory models and Transformers or MLP-Mixer, and shed some light on the theoretical background of the Transformer-type architectures design. In this paper we generalize the correspondence to the recently introduced hierarchical Hopfield network, and find iMixer, a novel generalization of MLP-Mixer model. Unlike ordinary feedforward neural networks, iMixer involves MLP layers that propagate forward from the output side to the input side. We characterize the module as an example of invertible, implicit, and iterative mixing module. We evaluate the model performance with various datasets on image classification tasks, and find that iMixer reasonably achieves the improvement compared to the baseline vanilla MLP-Mixer. The results imply that the correspondence between the Hopfield networks and the Mixer models serves as a principle for understanding a broader class of Transformer-like architecture designs.
Introduction
The field of computer vision has recently shifted from purely convolutional models toward Transformers and MLP-Mixers, collectively referred to as "MetaFormers." While these architectures have demonstrated exceptional performance, their designs have largely been heuristic, driven by empirical success rather than deep theoretical principles.
This research aims to bridge the gap between practice and theory by leveraging Hopfield networks, a classical model of associative memory. While previous work established a correspondence between standard Transformers/MLP-Mixers and single-layer Hopfield networks, this paper explores the architectural implications of a hierarchical Hopfield network with multiple hidden layers. The result is iMixer, a novel architecture that introduces an invertible, implicit, and iterative mixing module.
Methods
The iMixer architecture is mathematically derived from the energy-minimization dynamics of a three-layer hierarchical Hopfield network. This derivation reveals a unique mixing module, the iMLP, which is "implicit" in nature. Unlike standard feedforward layers where output $y$ is a direct function of input $x$ ($y = f(x)$), the iMLP module defines a relationship where the input is implicitly determined by the output.
To implement this implicit relationship within a standard neural network framework, the authors employ a Fixed-Point Approximation (FPA). This iterative approach, inspired by invertible ResNets (i-ResNets), refines the module's internal state over $n$ iterations (typically $n=2$ or $4$) to solve the implicit equation. To ensure stability and convergence during training, spectral normalization is applied to the weights, maintaining the contractive nature of the transformations.
The overall "macro" structure of iMixer mirrors that of the vanilla MLP-Mixer, alternating between mixing information across patches and across channels. However, the standard patch-mixing step is replaced by the theoretically-grounded iMLP module.
Results and Discussion
The iMixer was evaluated across several standard image classification benchmarks, including CIFAR-10, CIFAR-100, Stanford Cars, Food-101, and ImageNet-1k. The model consistently matched or outperformed the baseline vanilla MLP-Mixer.
Performance Highlights:
- CIFAR-10: iMixer-Large achieved 87.48% accuracy, surpassing the baseline's 86.67%.
- ImageNet-1k: iMixer-Small reached 74.10% top-1 accuracy, edging out the vanilla Mixer-S (73.91%).
Key Insights:
- Efficiency of Iteration: Experimental results indicate that the model does not require a high number of iterations to be effective. As shown in the performance table, even with $n=1$ or $n=2$, iMixer remains highly competitive, suggesting that the "direction" of computation (propagating information "backward" from output to input) is a critical design element.
- Scaling Benefits: Larger iMixer models showed a more significant performance boost over vanilla Mixers than smaller variants. This suggests that the iMLP module helps mitigate the weak inductive bias inherent in MLP-based models as they scale.
- Stability: Despite the iterative nature of the FPA, the model exhibited stable learning without the gradient issues often found in deep iterative structures.
Conclusion
iMixer represents a rare instance where a deep learning architecture was predicted by a theoretical model rather than discovered through trial and error. By grounding MetaFormer designs in the physics-inspired mathematics of hierarchical Hopfield networks, this work provides a stronger foundation for future architectural innovations. Future research will explore the performance of iMixer on more complex tasks such as object detection and the implications of even deeper Hopfield hierarchies.
Summary updated