TL;DR
While knowledge distillation successfully shrinks Multimodal Large Language Models (MLLMs), it often fails to pass down the teacher's complex visual perception and compositional reasoning skills. CompoDistill fixes this by explicitly aligning the student's visual attention with the teacher's using a novel group-layer matching strategy and an adapter-fetching module. This approach significantly boosts the student's ability to understand object relationships and attributes without sacrificing standard visual question-answering performance.
What Problem Does This Paper Address?
Knowledge distillation (KD) is a popular technique to compress massive MLLMs into smaller, deployable student models by transferring knowledge from a larger teacher. While current KD methods successfully transfer visual recognition skills (like identifying a single object in an image for simple Visual Question Answering), they fail at visual perception. Visual perception requires a deeper, compositional understanding of how objects interact, their spatial arrangements, and their precise attributes (e.g., distinguishing "a woman riding a bike" from "a woman holding a bike").
The authors discover that the root cause of this failure is visual attention misalignment. When processing complex compositional queries, smaller student models tend to focus on completely irrelevant regions of an image compared to their teachers, leading to poor reasoning performance.
Methods
The authors introduce CompoDistill, a framework designed to explicitly align student attention with teacher attention via two core components across a three-stage training pipeline:
- Visual ATtention alignment (VAT) module: This module minimizes the cosine distance between the student's and teacher's attention matrices over visual tokens. Because the teacher has more layers than the student, they use a Group Layer Matching strategy: a sliding window approach that maps each student layer to a block of consecutive teacher layers in a one-to-many fashion, preserving sequential order while capturing broader knowledge.
- Teacher Adapter Fetch (TAF) module: Simply forcing attention alignment fails if the student and teacher operate in incompatible vision-language feature spaces. TAF directly reuses the teacher's frozen, pretrained projector/adapter and adds a lightweight, trainable MLP to align dimensions, ensuring the student views the visual tokens through the exact same "lens" as the teacher.
Three-Stage Distillation Framework:
- Stage 1: Distilled Pre-Training (DPT): Optimizes the lightweight student adapter using standard language modeling and logit-level KL-divergence loss while keeping the vision encoder and LLM frozen.
- Stage 2: Distilled Fine-Tuning (DFT): Co-optimizes the student LLM and adapter by adding the Attention Distillation Loss ($L_{ADL}$) to align visual attention maps.
- Stage 3: Supervised Fine-Tuning (SFT): Fine-tunes only the student model on autoregressive language modeling to consolidate the transferred knowledge and ensure robust instruction-following.
Datasets
- Training: The baseline framework uses LLaVA-1.5-558K for pre-training and LLaVA-mix-665K for fine-tuning (totaling ~1.2M samples). For data-scaling experiments, they incorporated an additional 1.2M samples from LLaVA-MoD, spanning diverse tasks like ShareGPT4V, TextCaps, GQA, VQAv2, OKVQA, RefCoCo, ScienceQA, and ChartQA.
- Evaluation:
- Visual Recognition (VQA): VQAv2, GQA, VizWiz, TextVQA, and MME.
- Compositional Reasoning (CR): SugarCrepe, SADE, BiVLC, and Winoground.
- Relational Hallucination: R-Bench and Reefknot.
Key Insights and Ideas
- The Intermediate Layer Sweet Spot: Attention alignment is most critical in the intermediate layers (the 30% to 70% depth range of the LLM), which function as the core "visual understanding layers" where cross-modal semantic integration happens. Distilling early or late layers degrades performance.
- Relative Importance > Absolute Scores: Using Cosine Similarity as the attention loss function significantly outperforms Mean Squared Error (MSE) or KL Divergence. This indicates that teaching the student the relative importance of different visual patches matters much more than forcing it to match exact absolute attention values.
- Feature Space Compatibility: Attention maps are tightly coupled with the underlying vision-language projection space. Without the TAF module to bridge the feature space gap, direct attention distillation is ineffective.
Key Results
- Compositional Reasoning Boost: CompoDistill-2B achieves an average CR score of 66.7%, a massive leap from standard LLaVA-KD-2B (61.5%) and the SFT baseline (60.7%), nearly closing the gap to the 4B teacher model (70.3%).
- Preserved VQA Performance: Unlike other methods that trade off one skill for another, CompoDistill maintains a strong average VQA score of 61.9% (compared to 61.6% for standard LLaVA-KD).
- Mitigating Hallucinations: By accurately capturing object relationships, CompoDistill significantly reduces relational hallucinations, achieving a score of 66.7% on the Reefknot benchmark (on par with the teacher's 67.9%).
- High Data Efficiency: It achieves these state-of-the-art 2B compression results using just 1.2M training samples, outperforming models trained on up to 5M samples.
Limitations and Future Work
- Multi-Head Attention Averaging: CompoDistill distills the average of the teacher's visual attention across all heads, which discards head-specific fine-grained information and unique roles played by individual attention heads.
- Architectural Constraints: The framework assumes that the teacher and student belong to the same LLM family because logit-based distillation requires vocabulary consistency.
- Future Directions: The authors plan to incorporate head-specific attention characteristics into the distillation process to capture even more nuanced visual cues.
Summary updated