TL;DR
TokenNMS is a training-free, two-stage framework that dramatically accelerates Vision-Language Models (VLMs) by intelligently pruning redundant visual tokens. By reframing token reduction as a "Non-Maximum Suppression" (NMS) problem in the feature space, it reduces computational costs by up to 90% while preserving nearly all the original model's reasoning performance.
What Problem Does This Paper Address?
Vision-Language Models (like LLaVA or Qwen-VL) are powerful but computationally expensive. When they "look" at a high-resolution image, they break it down into hundreds or thousands of "visual tokens." Because the attention mechanism in these models has quadratic complexity, the more tokens you have, the slower the model runs.
The standard way to fix this is "Top-$K$ pruning"—simply keeping the $K$ tokens with the highest importance scores. However, the authors identify three critical flaws in this approach:
- Spatial Bias: It clusters tokens around the most obvious objects, ignoring the rest of the image.
- Redundancy: It often keeps many tokens that represent almost identical information.
- Context Loss: It tends to throw away background cues that might be essential for complex reasoning.
Methods
The authors introduce TokenNMS, a two-stage pruning method that doesn't require any extra training. It borrows the concept of Non-Maximum Suppression (NMS)—a classic computer vision technique used to clean up overlapping bounding boxes—and applies it to high-dimensional token embeddings.
- Stage 1: Query-Agnostic Spatial Pruning. Before looking at the user's question, the model looks at the image's self-attention map. It selects tokens that are "salient" but enforces a distance constraint: if a candidate token is too semantically similar to one already selected, it’s suppressed. This ensures the model keeps a diverse "skeleton" of the entire image.
- Stage 2: Query-Aware Semantic Filtering. Now the model considers the user's text query. it calculates a joint score based on visual saliency and text-visual alignment. Crucially, it uses a decoupled NMS strategy here. It ranks tokens by their relevance to the question but suppresses them based on their visual similarity in the raw feature space. This prevents "semantic collapse," where multiple distinct objects (like two different dogs) might otherwise suppress each other because they share the same high-level concept.
Datasets
The researchers evaluated TokenNMS across a massive battery of benchmarks to ensure it wasn't just "overfitting" to one type of task:
- General VQA: VQAv2, GQA, ScienceQA (SQA).
- Text/Chart Understanding: TextVQA, OCRBench, ChartQA.
- Hallucination & Reasoning: POPE, HallusionBench, MME, MMBench (MMB), MMVet, AI2D.
They tested these on several state-of-the-art VLM backbones, including LLaVA-1.5-7B, LLaVA-NeXT-7B, and Qwen2.5-VL-7B.
Key Insights and Ideas
- Diversity over Density: The "aha moment" here is that a VLM doesn't need more tokens of the same object; it needs a diverse set of tokens covering the whole scene. By penalizing semantic overlap, TokenNMS forces the model to "look" at the background and smaller objects it would usually ignore.
- The Power of Decoupling: By separating the selection priority (what is relevant to the question) from the suppression criterion (what is visually redundant), the model can focus on task-specific details without losing the spatial variety of the scene.
- Training-Free is the Way to Go: Unlike many compression methods that require expensive fine-tuning, TokenNMS is "plug-and-play." You can drop it into an existing model and see immediate speedups.
Key Results
The quantitative results are impressive:
- Efficiency: On LLaVA-NeXT-7B, TokenNMS reduced the computational cost (TFLOPs) by roughly 10x and the KV cache size by nearly 90%.
- Performance Retention: Despite the massive reduction in tokens, the model preserved 98.45% of its original performance. In some high-resolution scenarios, it actually outperformed the unpruned baseline by filtering out redundant visual noise.
- Robustness: Under extreme compression (reducing 576 tokens down to just 64), TokenNMS maintained 97.14% relative performance, significantly outperforming existing Top-$K$ methods which often crashed in accuracy at that level.
Limitations and Future Work
While TokenNMS is highly effective, the authors note a few hurdles:
- Dependency on Base Attention: The method relies on the quality of the initial attention maps from the Vision Transformer (ViT). If the ViT fails to "see" a tiny, critical object initially, TokenNMS might inadvertently prune it.
- Hyperparameter Sensitivity: The framework uses predefined thresholds ($\tau_1, \tau_2$) and budgets ($K_1$). While they found these to be generally robust, images with extreme structural complexity might benefit from more dynamic, per-image thresholding.
- Token Deficit: In very homogeneous images (like a clear blue sky), the NMS constraint might suppress too many tokens, requiring a "fallback" padding mechanism that could reintroduce some localized redundancy.
Future work could involve making these thresholds adaptive or integrating the NMS logic directly into the training process for even tighter coupling.
Summary updated