Manuscript Offprint

arXiv:2608.21194

ES-VP : Energy-Shaped Dynamic Visual Prompting for Efficient Model Adaptation

Can Jin, Ying Li, Jingchen Sun, Hongwu Peng, Jiahui Zhao, Yang Zhou, Lei Li, Dimitris N. Metaxas

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Can Jin 1∗^{1*}, Ying Li 2∗^{2*}, Jingchen Sun 3^{3}, Hongwu Peng 4^{4}, Jiahui Zhao 5^{5}, Yang Zhou 1^{1}, Lei Li 6^{6}, and Dimitris N. Metaxas 1^{1}

1^{1} Rutgers University

2^{2} Zhejiang University

3^{3} University at Buffalo, SUNY

4^{4} Adobe Research

5^{5} University of Connecticut

6^{6} Washington University

Abstract. Visual prompting (VP) has emerged as a parameter-efficient method for adapting pre-trained models to downstream tasks. However, existing approaches encounter a trade-off between flexibility and efficiency. Some methods apply a fixed prompt to all images, ignoring individual image characteristics, while others introduce auxiliary networks to generate diverse prompts. Although the latter can improve performance, it also significantly increases parameter usage and the potential for overfitting to specific datasets. Furthermore, the auxiliary networks, combined with inherent biases in pre-trained models, limit scalability and generalization. In this paper, we propose Energy-Shaped Visual Prompting (ES-VP), a novel approach that generates image-specific prompts using low-rank initialization and energy-guided dynamic adaptation, achieving superior performance with fewer parameters compared to single-prompt methods. ES-VP directly utilizes the pre-trained model for adaptive prompt generation, ensuring both parameter efficiency and improved generalization. Extensive experiments conducted on five architectures across fifteen datasets demonstrate that ES-VP consistently outperforms current state-of-the-art (SOTA) single and diverse VP methods. For instance, using the CLIP architecture across four datasets, ES-VP outperforms the SOTA method DAM-VP by an average of 2.6% in accuracy while utilizing 590×590 \times fewer VP parameters, thereby establishing a new benchmark for efficient and generalizable model adaptation.

1 Introduction

A wide range of computer vision (CV) and natural language processing (NLP) tasks leverage the flexibility and power of large-scale pre-trained models by adapting these foundational models to suit diverse task-specific applications [6, 12, 31, 38, 47]. Techniques like in-context learning [6, 34, 35, 48] and prompt tuning strategies [36] leverage well-designed input templates to improve model

  • Equal contribution.

C. Jin et al.

Figure

Fig. 1: Existing VP methods. Existing VP methods can be categorized into two groups: Single-VP and Diverse-VP methods. g(δ)g(\delta) is the VP parameters.

performance across diverse tasks. This paradigm has inspired visual prompting (VP) within computer vision, where it is employed to adapt pre-trained vision models by modifying inputs at the pixel level or through output transformations, rather than altering the model's internal weights or structure [4,7,8,23,50]. Unlike conventional transfer-learning methods that require full fine-tuning, linear probing (LP) of trainable layers, or zero-shot learning [43], VP retains the model's pre-trained backbone by adapting it to new tasks with minimal parameter tuning.

As shown in Figure 1, existing VP methods can be broadly categorized into two main strategies: ① Employing a single universal visual prompt (Single-VP) for all images in the downstream task [4,8,26,27,50]. Although this method is parameter-efficient, it fails to account for the considerable variability among images, resulting in prompts that lack the specificity necessary to capture the unique characteristics of individual images. Consequently, this approach limits the discriminative capability of deep models. ② Using diverse visual prompts (Diverse-VP) for different images, typically involving multiple VP initializations or auxiliary networks to generate image-specific prompts [7,23]. While this approach addresses the limitations of single-prompt methods by enhancing specificity, the additional parameters introduced by multiple prompts or auxiliary networks conflict with the objective of parameter-efficient adaptation and can substantially hinder the scalability of pre-trained models. Thus, we ask: Is there an effective visual prompting method capable of generating image-specific prompts while maintaining parameter efficiency?

In this paper, we introduce adaptive Energy-Shaped Visual Prompting (ES-VP), a method designed to generate image-specific visual prompts (VPs) without increasing the number of VP parameters or requiring auxiliary networks. As illustrated in Figure 2, ES-VP comprises two primary components: ① A universal low-rank prompt initialization, which is applied uniformly to all images, capturing global task characteristics and common dataset patterns. To enhance parameter efficiency, this initialization utilizes two low-rank matrices inspired

Figure

Fig. 2: Overview of ES-VP. We establish a single universal VP via a low-rank prior δ\delta to capture global information, and derive an image-specific dynamic adaptation μδ(x)\mu_{\delta}(\mathbf{x}) using an energy function to form the final prompted image P(x)\mathcal{P}(\mathbf{x}). Both the low-rank prior and the dynamic adaptation are jointly optimized via meta-learning.

by proven low-rank adaptation techniques and the intrinsic low-rank structure observed in deep neural networks [1, 2, 22]. ② An image-specific, parameter-free dynamic prompt adjustment derived from the initial prompt and tailored to each individual image. This dynamic adjustment captures unique and discriminative image features, enabling detailed adaptability. We generate these adjustments using a label-independent energy function from the pre-trained model, allowing automatic and adaptive VP generation for each image without additional networks, thus reducing the risk of overfitting. The low-rank prior and dynamic adaptation are jointly optimized via meta-learning to ensure rapid convergence and highly effective prompt generation. Furthermore, the energy-based approach provides flexibility and adaptability compatible with any pre-trained classifier, effectively shaping the energy landscape for out-of-distribution samples and improving VP generalization [14, 37].

We conduct extensive experiments using five different architectures to evaluate the effectiveness of ES-VP across various model designs. Experiments performed on fifteen datasets consistently demonstrate that ES-VP surpasses current SOTA Single-VP and Diverse-VP methods. For example, with the CLIP architecture [43], ES-VP achieves an accuracy improvement of 2.6% compared to the SOTA diverse-VP method DAM-VP [23] on four datasets, while utilizing ×590 fewer VP parameters. Additionally, ES-VP achieves 4.5% higher accuracy than the Single-VP method AutoVP [50] on ten datasets using ResNet-18 [17], with ×12 fewer VP parameters. In summary, our contributions are:

– We introduce a novel adaptive energy-shaped VP method capable of generating discriminative, image-specific visual prompts with significantly fewer parameters compared to existing Single and Diverse VP methods.

C. Jin et al.

– Extensive experiments across five architectures and fifteen datasets consistently demonstrate the superior in-distribution and out-of-distribution generalization capabilities of ES-VP to SOTA Diverse-VP methods, highlighting its potential effectiveness for real-world applications.

– Comprehensive analyses and ablation studies provide insights into the effectiveness and efficiency of ES-VP, offering valuable guidance for using energy-based methods in parameter-efficient dynamic adaptation.

References (54)

  • Intrinsic dimensionality explains the effectiveness of language model fine-tuning
  • On the convergence rate of training recurrent neural networks
  • Learning to learn by gradient descent by gradient descent
  • Exploring visual prompts for adapting large-scale models (opens arXiv in a new tab)
  • Food-101-mining discriminative components with random forests
  • In: Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., Lin, H. (eds.) Advances in Neural Information Processing Systems
  • Sample-specific masks for visual reprogramming-based prompting
  • Understanding and improving visual prompting: A label-mapping perspective
  • Describing textures in the wild
  • Imagenet: A large-scale hierarchical image database
  • BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
  • An image is worth $16 \times 16$ words: Transformers for image recognition at scale
  • Model-agnostic meta-learning for fast adaptation of deep networks
  • Your classifier is secretly an energy based model and you should treat it like one
  • Is meta-learning out? rethinking unsupervised few-shot classification with limited entropy
  • Mask r-cnn
  • Deep residual learning for image recognition
  • Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification
  • The many faces of robustness: A critical analysis of out-of-distribution generalization
  • Natural adversarial examples
  • Detection of traffic signs in real-world images: The german traffic sign detection benchmark
  • LoRA: Low-Rank Adaptation of Large Language Models
  • Diversity-aware meta visual prompting
  • How well do sparse imagenet models transfer? In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition
  • Learning from teaching regularization: Generalizable correlations should be easy to imitate
  • Visual prompting upgrades neural network sparsification: A data-model perspective
  • Lor-VP: Low-rank visual prompting for efficient vision model adaptation
  • Learning multiple layers of features from tiny images
  • Tiny imagenet visual recognition challenge
  • A tutorial on energy-based learning
  • Multiple human motion understanding
  • Human Motion Instruction Tuning
  • Prefix-tuning: Optimizing continuous prompts for generation (opens the publisher in a new tab)
  • Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning
  • Bcl: Bayesian in-context learning framework for information extraction
  • Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing
  • Energy-based out-of-distribution detection
  • Swin transformer: Hierarchical vision transformer using shifted windows
  • Reading digits in natural images with unsupervised feature learning
  • Automated flower classification over a large number of classes
  • Cats and dogs
  • Adapterhub: A framework for adapting transformers
  • Learning transferable visual models from natural language supervision
  • Language models are unsupervised multitask learners
  • Do imagenet classifiers generalize to imagenet? In: International conference on machine learning
  • Faster r-cnn: Towards real-time object detection with region proposal networks
  • Imagenet-21k pretraining for the masses
  • AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts (opens the publisher in a new tab)
  • Transfer learning without knowing: Reprogramming black-box machine learning models with scarce data and limited resources
  • AutoVP: An Automated Visual Prompting Framework and Benchmark
  • Learning robust global representations by penalizing local predictive power
  • Prompt tuning for unified multimodal pretrained models (opens the publisher in a new tab)
  • How transferable are features in deep neural networks? Advances in neural information processing systems 27
  • Understanding deep learning (still) requires rethinking generalization