Abstract
Vision Large Language Models (VLLMs) usually take input as a concatenation of image token embeddings and text token embeddings and conduct causal modeling. However, their internal behaviors remain underexplored, raising the question of interaction among two types of tokens. To investigate such multimodal interaction during model inference, in this paper, we measure the contextualization among the hidden state vectors of tokens from different modalities. Our experiments uncover a four-phase inference dynamics of VLLMs against the depth of Transformer-based LMs, including (I) Alignment: In very early layers, contextualization emerges between modalities, suggesting a feature space alignment. (II) Intra-modal Encoding: In early layers, intra-modal contextualization is enhanced while inter-modal interaction is suppressed, suggesting a local encoding within modalities. (III) Inter-modal Encoding: In later layers, contextualization across modalities is enhanced, suggesting a deeper fusion across modalities. (IV) Output Preparation: In very late layers, contextualization is reduced globally, and hidden states are aligned towards the unembedding space.
Introduction
Vision Large Language Models (VLLMs), such as LLaVA and InstructBLIP, have achieved remarkable success by integrating visual and textual modalities. These models typically function by "stitching" visual encoders to large language models (LLMs), feeding them a sequence of image and text tokens. Despite their performance, the internal mechanics of how these disparate data types interact across dozens of Transformer layers remain largely opaque. Understanding this "inference dynamics" is crucial for improving model efficiency, debugging reasoning errors, and developing advanced techniques like early-exit decoding.
Methodology
To dissect the inference process, the researchers employed three distinct probing techniques:
- Contextualization (Interaction Magnitude): Measuring the average cosine similarity between hidden states of image and text tokens to quantify cross-modal communication.
- Norm-based Attention: A more faithful alternative to standard attention weights for identifying which tokens the model prioritizes at various depths.
- LogitLens (Verbalization): Passing intermediate visual token representations through the final unembedding layer to observe how the model "translates" visual features into language at different stages.
The study evaluated InstructBLIP and LLaVA-v1.5 on the COCO Captions and Winoground datasets, the latter specifically testing compositional understanding.
The Four-Phase Inference Dynamics
The core contribution of this research is the identification of a structured "four-phase" lifecycle for multimodal interaction within the LLM backbone.
- Phase I: Alignment (Early Layers): The model immediately maps raw visual features into the language model's semantic space, evidenced by a rapid spike in inter-modal similarity.
- Phase II: Intra-modal Encoding (Early-Mid Layers): Cross-modal interaction temporarily dips as the model focuses on refining representations within each modality independently (image-to-image and text-to-text).
- Phase III: Inter-modal Encoding (Middle-Late Layers): This phase represents the peak of multimodal fusion. The model actively integrates visual cues with textual instructions to perform complex reasoning and solve the task.
- Phase IV: Output Preparation (Final Layers): Interaction drops sharply as the model shifts focus from reasoning to formatting hidden states for the final vocabulary output.
Experimental Results
Quantitative analysis reveals a characteristic "W-shaped" curve in inter-modal similarity across the Transformer layers, a pattern that remains consistent across different models and datasets.
Key findings from the experiments include:
- Visual Recall: Using LogitLens, the researchers found that visual "recall" (the ability to decode visual tokens into relevant words) peaks during Phase III (layers 10–32), reaching a score of approximately 0.39 before dropping in the final phase.
- Attention Saliency: Norm-based attention confirmed that intensive cross-modal focus emerges primarily in the middle and later layers, perfectly mirroring the "Inter-modal Encoding" phase.
- Token Bottlenecks: A notable discovery is that the first five visual tokens consistently receive significantly more attention than others, suggesting they may act as a summary or bottleneck for visual information.
Conclusion and Future Work
This study provides a foundational roadmap for understanding the internal dynamics of VLLMs. The discovery of the four-phase inference diagram suggests that these models do not blend modalities uniformly. Instead, they follow a structured sequence of alignment, internal refinement, deep fusion, and output preparation. These insights open the door for future optimizations, such as "early-exit" strategies where the model stops processing once fusion is complete, or token pruning techniques to enhance efficiency without compromising performance.
Summary updated