Introduction
Vision Transformers (ViTs) have demonstrated remarkable performance on large-scale computer vision tasks, often surpassing traditional Convolutional Neural Networks (CNNs). However, ViTs are notoriously "data-hungry." Unlike CNNs, which possess an inherent inductive bias through local connectivity and translation invariance, ViTs start with a "blank slate." This lack of structure allows for great flexibility on massive datasets like ImageNet-21k but leads to significant performance degradation on small-scale datasets where CNNs still dominate.
Previous attempts to bridge this gap involved architectural modifications, such as integrating convolutional layers, or "Mimetic Initialization," which requires a pre-trained teacher model. This paper introduces Structured Initialization, a method that bakes the benefits of a CNN into a ViT's starting state without altering its mathematical formulation or requiring external pre-training.
Methodology
The core of the proposed approach is a novel initialization strategy for the Query ($Q$) and Key ($K$) weight matrices in the self-attention mechanism. Instead of initializing these weights with random noise, the authors aim to mimic the sparse, local structure of convolutional impulse filters.
The Initialization Process
- Impulse Filter Target: The method defines a target "Structured" attention map that resembles a convolutional matrix composed of random impulse filters. These filters act as simple shift operations, enforcing local spatial mixing.
- Pseudo-Input Optimization: Since attention maps are data-dependent, the authors use absolute sinusoidal positional encodings as a "pseudo-input" ($P$) to represent the spatial structure of the data without using actual training images.
- Optimization Step: Before training begins, a brief optimization (approximately 5 seconds) is performed to find $Q$ and $K$ parameters that minimize the Mean Squared Error (MSE) between the resulting attention maps and the target impulse filters.
Once initialized, the ViT is trained normally. The convolutional bias is only present at the start; the model remains free to learn global dependencies as training progresses, preserving the inherent flexibility of the Transformer architecture.
Theoretical Insights
- Initialization vs. Architectural Bias: The authors argue that the "convolutional advantage" stems from the structure of the operation rather than specific weight values. By moving this bias to initialization (soft-coded) rather than the architecture (hard-coded), ViTs retain their long-term scalability.
- Redundancy Condition: The paper provides a theoretical basis (Proposition 1) suggesting that if the model has sufficient channels ($D \ge kf^2$), the channel-mixing layers can compensate for structured spatial filters, ensuring that the initialization does not limit the model's expressive power.
- Multi-Head Advantage: The method's effectiveness scales with the number of attention heads, as more heads allow the model to represent a more diverse basis of convolutional filters.
Experimental Results
The authors evaluated Structured Initialization across various benchmarks, demonstrating its effectiveness in data-constrained environments:
- Small-Scale Performance: On CIFAR-10, Structured Initialization improved ViT-Tiny performance by approximately 3% over standard truncated normal initialization, reaching 91.62% accuracy without any pre-training. It consistently outperformed both standard methods and the "Mimetic" approach on CIFAR-100 and SVHN.
- Scalability: The method does not "over-specialize" for small data. On ImageNet-1K, it maintained or slightly improved performance (74.40% vs. 73.42%), proving it is a robust drop-in replacement for standard initialization.
- Efficiency: The pre-optimization step is computationally negligible, taking only a few seconds on a standard GPU.
Limitations and Future Work
While effective, the current method has some limitations. The use of positional encodings as pseudo-inputs does not fully account for network depth, which can lead to slightly blurred attention maps in deeper layers. Additionally, the study focuses exclusively on $Q$ and $K$ matrices, leaving the initialization of the Value matrix ($V$) for future exploration. In extremely small models with very few heads, the impulse filter constraint may also be too rigid to span the necessary filter space effectively.
Summary updated