Abstract
Current autoregressive Vision Language Models (VLMs) usually rely on a large number of visual tokens to represent images, resulting in a need for more compute especially at inference time. To address this problem, we propose Mask-LLaVA, a framework that leverages different levels of visual features to create a compact yet information-rich visual representation for autoregressive VLMs. Namely, we combine mask-based object representations together with global tokens and local patch tokens. While all tokens are used during training, it shows that the resulting model can flexibly drop especially the number of mask-based object-tokens at test time, allowing to adapt the number of tokens during inference without the need to retrain the model and without a significant drop in performance. We evaluate the proposed approach on a suite of standard benchmarks showing results competitive to current token efficient methods and comparable to the original LLaVA baseline using only a fraction of visual tokens. Our analysis demonstrates that combining multi-level features enables efficient learning with fewer tokens while allowing dynamic token selection at test time for good performance.
Introduction: The Token Explosion Problem
Modern autoregressive Vision-Language Models (VLMs), such as LLaVA, are inherently "token hungry." To interpret an image, these models typically decompose it into a dense grid of local patches. For instance, a standard $336 \times 336$ image yields 576 tokens. As models move toward higher resolutions, this count can balloon to nearly 3,000 tokens.
Since the computational cost of the Large Language Model (LLM) backbone scales quadratically with sequence length, this "token explosion" significantly increases inference latency and cost. Previous mitigation strategies often relied on simple pruning or pooling, which frequently sacrificed fine-grained details, particularly for specific objects within a scene.
Methodology: Multi-Level Token Composition
Mask-LLaVA addresses this by replacing the uniform grid of tokens with a "compositional" approach that integrates three distinct granularities of visual information:
- Global Context: Utilizes the
[CLS]token from the vision backbone to provide a high-level summary of the entire image. - Local Context: Instead of using every patch, 2D average pooling is applied to the patch grid (e.g., reducing a $24 \times 24$ grid to $6 \times 6$), preserving spatial layout while drastically reducing token count.
- Object-Level Features: This core novelty employs an object detector (Deformable DETR) and a segmenter (SAM) to identify up to 100 regions of interest. These are converted into "mask tokens" via Maskinversion, optimizing tokens so their attention maps align with object shapes.
To ensure these diverse token types are processed effectively by the LLM, the authors introduce Norm Scaling, which normalizes global and object tokens to match the statistical distribution (mean and standard deviation) of the patch tokens.
Experimental Setup
The model was evaluated across eight standard VLM benchmarks covering various capabilities:
- Perception & VQA: VQAv2, GQA, VizWiz, and MMBench.
- Hallucination: POPE (measuring object existence accuracy).
- Reasoning & Knowledge: ScienceQA-IMG, MME, and MM-Vet.
Training followed the standard LLaVA-1.5 two-stage pipeline: pre-training for feature alignment followed by instruction fine-tuning.
Key Results and Performance
Mask-LLaVA demonstrates remarkable efficiency, achieving performance parity with the original LLaVA-1.5-7B while using only 29 to 42 tokens—a reduction of approximately 93-95%.
At a 90% token reduction ratio, Mask-LLaVA consistently outperformed other efficient VLM methods, such as FastV and FitPrune, particularly on benchmarks like GQA, POPE, and MME. Qualitative analysis confirms that while standard LLaVA might overlook small or crowded objects, Mask-LLaVA’s object-centric tokens allow it to focus on and correctly identify these fine-grained elements.
Discussion: Flexibility and Robustness
- Dynamic Inference: Mask-LLaVA is uniquely robust to "test-time pruning." A model trained with 100 object tokens can be deployed using only the top 5 or 20 most confident tokens to save compute, with minimal impact on performance.
- Complementary Features: Different tokens serve different roles: the
[CLS]token is crucial for general scene understanding (MME), while mask tokens are essential for reducing hallucinations (POPE) and identifying small objects. - Redundancy as Strength: Training on overlapping masks creates a more flexible representation than rigid, non-overlapping grids.
Conclusion and Future Work
While Mask-LLaVA significantly reduces LLM workload, it currently relies on external models (DETR and SAM) for preprocessing, which could become a bottleneck. Additionally, the model occasionally struggles with complex logical conjunctions (e.g., "Is the bag brown AND soft?"), likely due to the additive nature of CLIP embeddings. Future research will focus on developing end-to-end trainable mask generators to further streamline the architecture and enhance the synergy between vision and language components.
Summary updated