Abstract
Recent research has demonstrated that incorporating frozen blocks from pre-trained Large Language Models (LLMs) into Vision Transformers (ViTs) significantly enhances their performance on visual tasks. However, the underlying mechanism for this improvement has remained poorly understood. This paper identifies frozen LLM blocks as "gradient coherence rectifiers." By analyzing the Gradient Signal-to-Noise Ratio (GSNR), we show that these blocks align gradients across different training samples, promoting the learning of more generalizable patterns. We introduce an auxiliary training strategy that allows ViTs to benefit from this rectification during training while maintaining standard inference speeds.
Introduction
In the development of multimodal models, a surprising phenomenon has emerged: attaching a frozen block from a pre-trained LLM (such as LLaMA) to a Vision Transformer (ViT) provides a notable performance boost. While initial hypotheses suggested this was due to "information filtering," where the LLM helps the ViT focus on salient pixels, this explanation fails to account for the sensitivity of performance to the LLM block's position or why larger LLMs yield better results. This study shifts the focus to optimization dynamics, specifically how LLMs influence the gradient descent process.
The Rectification Mechanism
The core finding of this work is that frozen LLM blocks act as rectifiers for gradient coherence. In standard ViT training, gradients from different samples in a batch can often be conflicting or noisy, leading to suboptimal optimization. When features pass through a frozen LLM block, the resulting gradients become more aligned across the batch. This increased coherence is measured by the Gradient Signal-to-Noise Ratio (GSNR).
To leverage this without incurring inference-time costs, we utilize an Auxiliary Training Framework. During training, the model processes data through two paths: a standard "Main" path and an "Auxiliary" path containing the frozen LLM. Gradients from both paths are backpropagated to update the ViT parameters. Post-training, the auxiliary path is discarded, leaving a standard ViT that has been optimized using these "rectified" gradients.
Proximity and Gradient Dynamics
A key insight of our analysis is the "proximity effect": the rectification is most potent in the layers closest to the LLM block. By calculating the relative difference in GSNR across layers, we observed that inserting the LLM block at the end of the ViT provides the most widespread benefit to preceding layers.
This finding explains why late-stage insertion is typically more effective. Furthermore, we found a direct correlation between the representation similarity (measured via Mutual-KNN) of the ViT and LLM layers and the resulting performance gains. As both models learn more abstract, general features in their deeper layers, their alignment becomes more beneficial for optimization.
Key Results and Performance
The impact of gradient rectification is evident across multiple benchmarks:
- Optimization Stability: Incorporating the LLM block increased the average GSNR of the ViT by over 10%, indicating a more stable training signal.
- Accuracy Gains: On ImageNet-1K, the auxiliary training method improved ViT-S accuracy from 80.1% to 80.3% and ViT-B from 80.6% to 80.9%.
- Robustness: The models trained with rectified gradients showed superior performance on robustness benchmarks like ImageNet-C and ImageNet-SK, suggesting that coherent gradients lead to more durable feature representations.
- Efficiency: Because the LLM path is only used during training, the final model maintains its original inference speed (e.g., 75 samples/sec for ViT-S), providing a "free" performance boost at test time.
Conclusion
This research provides a rigorous optimization-based explanation for the synergy between frozen LLMs and vision models. Rather than just filtering information, LLMs serve as a steadying influence during training, rectifying noisy gradients into a coherent signal. By using an auxiliary training path, researchers can capture these benefits to produce faster, more robust, and more accurate Vision Transformers.
Summary updated