CATP: Contextually Adaptive Token Pruning for Efficient and Enhanced Multimodal In-Context Learning

Yanshu Li, Jianjiang Yang, Zhennan Shen, Ligong Han, Haoyan Xu, Ruixiang Tang

TL;DR

CATP (Contextually Adaptive Token Pruning) is a training-free image token pruning method designed specifically for multimodal In-Context Learning (ICL). By accounting for complex cross-modal and cross-sample interactions, CATP removes up to 77.8% of redundant visual tokens while actually improving accuracy by an average of 0.6% and reducing inference latency by nearly 11% across multiple large vision-language models.

What Problem Does This Paper Address?

Large Vision-Language Models (LVLMs) process images by converting them into a massive number of visual tokens. While this high resolution boosts perception, it introduces severe token redundancy. In Multimodal In-Context Learning (ICL)—where a model learns a task on the fly from a few interleaved image-text examples (In-Context Demonstrations, or ICDs)—this problem compounds drastically. Stacking multiple images creates a massive computational bottleneck, slowing down inference and exploding memory usage.

Existing token pruning methods designed for single-image tasks fail in this multi-image ICL setting.

  1. Diversity-based methods analyze images in isolation, completely missing the broader cross-sample context.
  2. Attention-based methods suffer from "attention shifts" in interleaved text-image sequences, where the model's attention mistakenly concentrates on visual tokens simply because they are close to text boundaries, rather than because they are semantically important.

As a result, standard pruning techniques often perform worse than completely random pruning when applied to few-shot multimodal prompts.

Figure 1: Comparison of token pruning methods on a 3-shot sequence. Attention-based methods suffer from attention sinks, diversity methods lack global semantic guidance, while CATP accurately preserves contextually relevant tokens.

Methods

To bridge this gap, the authors propose Contextually Adaptive Token Pruning (CATP), a training-free, two-stage progressive pruning pipeline:

  • Stage 1: Pre-Decoder Filtering
    Operates immediately after the vision projector and before the heavy LLM decoder layers. It evaluates token importance across two dimensions: semantic alignment with its paired text and feature diversity across the image. This is formulated as a weighted submodular maximization problem and solved efficiently using a greedy algorithm, discarding the most obviously redundant tokens early on.

  • Stage 2: Intra-Decoder Progressive Adaptation
    Executed within the shallow layers of the LLM decoder. Instead of pruning each image exemplar by a fixed, isolated ratio, CATP treats all ICD images as a single global context. It scores context tokens based on their semantic relevance to the query sample and the layer-wise growth in attention they receive from the query's last token. After distilling this global context, the remaining context tokens are used to guide the pruning of the query image's tokens in the subsequent layer.

Datasets

The authors comprehensively evaluated CATP across eight diverse vision-language benchmarks:

  • Standard VQA/Reasoning: VQAv2, VizWiz, OK-VQA, GQA
  • Challenge-specific: HatefulMemes (multimodal hate speech detection)
  • Recent/Advanced: MMStar, MME-Realworld, and the image-to-text split of VL-ICL Bench

These benchmarks were tested across four prominent LVLMs: LLaVA-Next-7B, LLaVA-Next-13B, InternVL2.5-8B, and Qwen2.5VL-7B.

Key Insights and Ideas

  • The ICL Pruning Paradox: Standard pruning methods degrade performance more in 4-shot ICL than in single-image settings, sometimes underperforming random pruning. Interleaved text-image inputs amplify positional biases and attention sinks, rendering raw attention scores deceptive.
  • Global Context Over Local Ratios: Forcing every demonstration image to lose an identical percentage of tokens is suboptimal. CATP shares a common pruning ratio across all demonstrations globally, allowing the model to dynamically preserve more tokens for highly relevant examples and aggressively prune less useful ones.
  • Attention Difference > Static Attention: Measuring the change in attention weights between consecutive shallow layers provides a much cleaner signal for tracking query-guided reasoning than relying on static attention maps from a single layer.
Figure 2: Performance comparison showing how existing pruning methods degrade significantly in 4-shot ICL compared to single-image tasks, while CATP maintains or improves performance.

Key Results

  • Performance Boost: At a standard 77.8% pruning ratio, CATP achieved an average relative performance of 100.1% to 101.9% compared to unpruned vanilla models. It was the only evaluated method that consistently enhanced accuracy while pruning.
  • Efficiency Gains: CATP reduced FLOPs by up to 79% and KV cache size by up to 80.6% across the evaluated models.
  • Wall-Clock Speedups: It delivered the largest actual reduction in total inference latency—saving 16.5% of processing time for LLaVA-Next-7B and 10.0% for Qwen2.5VL-7B.
  • Scalability: The benefits of CATP scale non-linearly with the number of shots; as the prompt length grows (tested up to 16 shots), CATP's ability to filter out compounding token redundancy becomes even more effective.

Limitations and Future Work

The primary limitation of CATP is that its hyperparameters—specifically the balancing coefficients ($\lambda_1, \lambda_2$) and the target decoder layer ($K$) for Stage 2—are model-specific and require manual calibration to achieve optimal results.

For future work, the authors suggest exploring methods to automatically or adaptively determine these hyperparameters on the fly. Additionally, extending this contextually adaptive pruning framework to video understanding and many-shot Retrieval-Augmented Generation (RAG) settings represents a promising direction for mitigating extreme token explosion.

Summary updated

BibTeX
@inproceedings{li2026catp,
  author = {Yanshu Li and Jianjiang Yang and Zhennan Shen and Ligong Han and Haoyan Xu and Ruixiang Tang},
  title = {{CATP: Contextually Adaptive Token Pruning for Efficient and Enhanced Multimodal In-Context Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i8.37592},
}
Figure