Selective Visual Prompting in Vision Mamba

Yifeng Yao, Zichen Liu, Zhenyu Cui, Yuxin Peng, Jiahuan Zhou · DOI

Abstract

The Vision Mamba (Vim) architecture has emerged as a high-efficiency alternative to Vision Transformers (ViTs), utilizing a selective state space mechanism for linear complexity. However, adapting pre-trained Vim models via standard Parameter-Efficient Fine-Tuning (PEFT) methods, such as static visual prompting, is often ineffective. We propose Selective Visual Prompting (SVP), a novel method that generates input-dependent, token-wise prompts. By employing a dual-path architecture—Cross-Prompting for inter-layer consistency and Inner-Prompting for layer-specific details—SVP effectively modulates Mamba’s internal gating mechanisms. Our results on HTA and VTAB-1K benchmarks demonstrate that SVP significantly outperforms existing prompting methods, achieving state-of-the-art accuracy with minimal parameter overhead.

Introduction

Vision Transformers (ViTs) have long dominated computer vision, but their quadratic complexity limits scalability. The Vision Mamba (Vim) architecture addresses this by using a "selective state space" mechanism, providing high efficiency. Despite its promise, fine-tuning Vim for downstream tasks like medical imaging or fine-grained classification is non-trivial.

Standard visual prompting, which prepends learnable tokens to the input, is a popular PEFT technique for ViTs. However, Vim's sequential processing and use of "update" and "forget" gates to compress data make static prefix prompts insufficient. As the model processes an image sequence, the influence of initial prompts tends to fade, leading to the loss of discriminative features.

Comparison of existing prompting methods versus the proposed Selective Visual Prompting (SVP). SVP uses dynamic prompts to steer the Mamba update gate toward discriminative regions.

Methodology: Selective Visual Prompting

To overcome the limitations of static prompting, we introduce Selective Visual Prompting (SVP). SVP shifts from fixed prefix tokens to dynamic, input-dependent prompts generated for every token in the sequence.

Token-wise Prompt Generation

Instead of a global set of tokens, SVP utilizes a lightweight prompter to generate a unique prompt for each image token based on its specific content. This ensures that the "instruction" to the model is refreshed at every step of the sequential pass.

Dual-Path Architecture

SVP employs a dual-path structure to balance general and specific feature extraction:

  1. Cross-Prompting: A shared generator is used across multiple layers to capture consistent, high-level semantic features.
  2. Inner-Prompting: A layer-specific, lightweight MLP (utilizing a "down-up" bottleneck structure) captures unique details relevant to different depths of the network.
Detailed architecture of the Selective Visual Prompting (SVP) module, illustrating the Cross-Prompting and Inner-Prompting pathways.

Gate Activation and Steering

The generated prompts are added directly to the original image tokens. In the Mamba architecture, internal parameters (the $B, C,$ and $\Delta$ matrices) are derived from the input. By injecting content-aware prompts, SVP directly influences the model's "update" and "forget" gates. This effectively "steers" the model to preserve discriminative features (e.g., the texture of a bird's feathers) while discarding irrelevant background information.

Experiments and Results

We evaluated SVP on the HTA (Head Tuning Adaptation) benchmark, comprising 10 diverse datasets, and the VTAB-1K (Visual Task Adaptation Benchmark), which includes 19 tasks across natural, specialized, and structured domains. We used Vim-Small (25M parameters) as our primary backbone.

Performance Highlights

  • State-of-the-Art Accuracy: On the HTA benchmark, SVP achieved an average accuracy of 89.8%, surpassing the previous state-of-the-art (VPT) by 5.3%. Notably, SVP outperformed full fine-tuning on 7 out of 10 datasets.
  • Robustness in Structured Tasks: SVP demonstrated significant gains in the "Structured" category of VTAB-1K, improving accuracy by 13.8% over standard visual prompting.
  • Efficiency: SVP is highly parameter-efficient, adding only approximately 1.6M tunable parameters, which is roughly 6% of the base model size.

Discussion and Key Insights

The core innovation of SVP is the realization that in a Mamba-based architecture, a prompt should function as a control signal rather than just additional data. By making prompts input-dependent and token-wise, SVP addresses the sequential "fading" problem inherent in Mamba. Saliency maps confirm that with SVP, the Mamba "update gate" focuses sharply on the primary object, whereas previous methods resulted in scattered or misaligned focus.

Conclusion and Future Work

Selective Visual Prompting provides a robust and efficient framework for adapting Vision Mamba models. By leveraging the architecture's unique gating mechanisms, SVP achieves superior performance with minimal overhead. Future research will focus on automating the hyperparameter tuning for layer sharing and extending SVP to multi-modal Mamba architectures and other non-transformer models like RWKV.

Summary updated

BibTeX
@inproceedings{yao2025selective,
  author = {Yifeng Yao and Zichen Liu and Zhenyu Cui and Yuxin Peng and Jiahuan Zhou},
  title = {{Selective Visual Prompting in Vision Mamba}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i21.34361},
}
Figure