Manuscript Offprint
arXiv:2608.21194ES-VP : Energy-Shaped Dynamic Visual Prompting for Efficient Model Adaptation
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Can Jin , Ying Li , Jingchen Sun , Hongwu Peng , Jiahui Zhao , Yang Zhou , Lei Li , and Dimitris N. Metaxas
Rutgers University
Zhejiang University
University at Buffalo, SUNY
Adobe Research
University of Connecticut
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 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.

Fig. 1: Existing VP methods. Existing VP methods can be categorized into two groups: Single-VP and Diverse-VP methods. 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

Fig. 2: Overview of ES-VP. We establish a single universal VP via a low-rank prior to capture global information, and derive an image-specific dynamic adaptation using an energy function to form the final prompted image . 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.
2.1 Visual Prompting
Prompting, initially developed for NLP, is a technique that adapts pre-trained models to specific tasks by modifying their inputs [26,27,34,36,48]. This method was subsequently extended to CV through VP, introduced by [4], where adjustable parameters are directly embedded into visual inputs to guide pre-trained models. A standard VP framework consists of two main components: input design, where prompts are integrated into the input image, and output transformation, which modifies model outputs to suit new tasks [4,7,49,50]. Several VP strategies have been proposed, either applying a single visual prompt (Single-VP) universally to the downstream dataset or utilizing diverse visual prompts (Diverse-VP) customized for individual images. Single-VP methods, such as [4], introduce VP parameters as frames around input images, whereas [8,50] place these parameters around resized images. Diverse-VP methods include clustering-based approaches by [23], where cluster-specific prompts partially address the limitations of single prompts but fail to capture finer image-specific details. [7] introduces auxiliary networks to generate individualized prompts; however, training separate auxiliary networks on small datasets increases the risk of overfitting [53,54]. Adapting outputs to downstream tasks necessitates a transformation because pre-trained model logits remain associated with the original source domain. Techniques such as random label mapping (RLM) align source labels to target labels. Frequency-based label mapping (FLM), proposed by [49], leverages label distribution statistics, whereas semantic-based label mapping by [52] aligns classes based on semantic meanings. Iterative frequency-based label mapping (ILM), developed by [8], refines FLM iteratively. To further enhance adaptability, [23] explores classifier head tuning, similar to linear probing (LP), to adapt the classifier head for specific tasks. Finally, [50] employs full mapping (FM) alongside an automated system to select optimal label mappings.
2.2 Transfer Learning
Transfer learning is a foundational technique in NLP and CV, allowing models to utilize knowledge obtained from pre-trained tasks to enhance performance on new, related tasks. In NLP, models such as BERT and GPT are first pretrained on large-scale text datasets and subsequently fine-tuned for specific applications like sentiment analysis and question answering . Likewise, in
CV, architectures including ResNet [17], and Vision Transformer [12, 38] are pre-trained on extensive datasets such as ImageNet [10], and then adapted to tasks like object detection and image segmentation [16, 32, 46]. Traditionally, transfer learning involves fully fine-tuning all parameters of the model on new task-specific data, using pre-trained weights as initialization. However, as models grow larger, this conventional approach becomes inefficient, leading to the development of parameter-efficient fine-tuning (PEFT) methods [4, 22, 25, 33, 42, 50]. These methods adjust only a subset of parameters or add task-specific modules while keeping most of the model unchanged, thereby reducing computational requirements and minimizing the risk of overfitting.
3 Methodology
We propose adaptive Energy-Shaped Visual Prompting (ES-VP), a novel VP approach that integrates low-rank prompt initialization with an image-specific adaptation to enhance generalization and improve the discriminative performance of pre-trained models. An overview of ES-VP is illustrated in Figure 2. We first formally define the visual prompting problem, then describe the low-rank initialization of VP, followed by the energy-shaped dynamic adaptation. Finally, we detail the optimization and inference procedures and present the comprehensive algorithm for ES-VP.
3.1 Problem Statement
Visual Prompt. Consider a downstream target image dataset with color channels (typically 3) and a pre-trained vision model that processes images with resolution (set to in our experiments). Visual prompting begins by resizing input images to a specific size , as previous studies such as AutoVP [50] and ILM-VP [8] have shown that the choice of significantly affects VP performance. Task-specific tunable parameter frames, known as visual prompts, are then added to the resized images to create prompted images. This procedure can be formally expressed as:
where resizes image to (typically smaller than in existing VP frameworks) and pads the resized image with zeros to match the dimensions of . Here, denotes the tunable parameters within VPs, is a transformation function applied to these parameters (e.g., a Sigmoid function mapping values between 0 and 1, matching the input image range), denotes element-wise multiplication, and is a binary mask indicating the prompted region. For universal single-VP methods, remains constant, whereas, in diverse-VP methods, can vary depending on the specific image [7]. An illustration of the current VP frameworks is presented in Figure 1.
C. Jin et al.
Output Transformation. The output logits of a pre-trained model typically remain within the source domain (e.g., ImageNet [10]). To adapt these predictions to the target labels of downstream tasks (e.g., CIFAR100 [28]), an output transformation M is necessary to map the source logits to downstream predictions. Several output transformation methods have been proposed in recent studies. For instance, [8] proposes iterative label mapping (ILM), which iteratively aligns the source logits with downstream predictions by utilizing frequency statistics from the training dataset at each epoch's start. [23] investigates head tuning, directly adapting the classifier head of the pre-trained model to the downstream task, similar to linear probing (LP). [50] introduces full mapping (FM), adding an extra fully connected layer after the original classifier head to convert source logits into predictions suitable for downstream classes. In ES-VP, we examine three output transformation settings, LP, FM, and ILM, to assess their respective impacts in our experiments.
3.2 Low-Rank Initialization of Visual Prompts
Inspired by the inherent low-rank structure observed in deep neural networks, suggesting that low-rank matrices can retain the expressive capacity of full-rank weights [22, 27], we introduce two low-rank matrices, and , where , for initializing VPs. The product of these matrices, , acts as a universal VP, effectively capturing global dataset information. To streamline the VP process, enhance scalability, and reduce the complexity of hyperparameter tuning, we set a fixed resizing factor for all images and employ a universal mask , ensuring that the prompt influences the entire image. This yields the following VP formulation:
where resizes input images to dimensions , and and represent the initialized parameters of the VPs. Following [22], we initialize with zeros and with random Gaussian values, resulting in equaling zero at the start of training.
The low-rank visual prompt initialization naturally generalizes traditional full-rank prompts; setting approximately restores the expressiveness of full-rank prompts. Notably, even at very low ranks, such as , the low-rank VP approach achieves performance comparable to full-rank VPs [27].
After the low-rank VP is applied, the output transformation is used to convert the pre-trained model's output logits on the prompted image into target logits, represented as .
3.3 Energy-Shaped Dynamic Adaptation
[14] suggests that classifiers, traditionally outputting logits, can also be interpreted as energy-based models. [37] further propose that energy functions more effectively identify out-of-distribution data compared to logits, assigning lower energy scores to observed data and higher scores to unobserved data. These findings indicate that energy scores provide valuable information about sampled images, aiding their recognition by pre-trained models.
Following [14] and [37], we define the energy function at an input x using the LogSumExp( ) of the classifier's logits. After applying the low-rank VP initialization, the energy function is defined as:
where denotes the energy score and refers to the logit of class .
Energy-based models [30] posit that the probability density function of a prompted image can be expressed as:
where is the probability density, is the energy function mapping images to scalar values, and is the normalizing constant (partition function).
Taking the logarithm of both sides of Equation (4), we obtain:
where log denotes the natural logarithm. Equation (5) indicates that logits for a prompted image can be expressed through the energy function and a normalization constant.
By computing the gradients of logits with respect to the prompted image, we define our image-specific dynamic VP adaptation as follows:
where is a learnable strength coefficient controlling the adaptation strength.
By integrating the image-specific VP adaptation with the low-rank initialized VP , ES-VP dynamically adjusts VPs according to the specific features of each image. The dynamically adapted VP image is formulated as:
Equation (7) allows image-specific VPs without requiring labels, additional parameters, or auxiliary networks, thus enhancing parameter efficiency and reducing overfitting risk. Additionally, it integrates flexibly with various pre-trained models, improving scalability compared to methods such as DAM-VP [23] and SMM [7], which rely on clustering or auxiliary networks. Our experiments (Section 5) further demonstrate the improved OOD performance using the energy function [14,37].
C. Jin et al.
3.4 Meta-Learning of Low-Rank Prior and Dynamic Adaptation
We propose a meta-learning framework that jointly optimizes (i) image-specific dynamic prompt adaptation in the inner loop and (ii) a global low-rank prompt prior in the outer loop. Through meta-learning, this paradigm establishes a mutually reinforcing relationship: a well-optimized low-rank prior facilitates precise dynamic adaptation, which conversely provides optimal feedback to continuously improve the prior. This synergy ensures fast convergence and yields highly effective per-image prompts without auxiliary networks or additional trainable modules. By avoiding the heavy parameterizations and complex designs of existing diverse-VP methods (e.g., DAM-VP), it also addresses their scalability bottlenecks while ensuring simplicity for real-world deployment.
Specifically, the optimization procedure of ES-VP adopts this meta-learning approach [3, 13, 15] through two nested stages:
Inner Loop (Dynamic Adaptation): For each image x in a sampled batch, given the current global low-rank VP prior , we compute the dynamic adaptation term using the energy-based gradient as defined in Equation (6). This generates the image-specific prompted input instantly, without requiring label supervision or optimizing auxiliary network parameters.
Outer Loop (Prior Optimization): We evaluate the downstream target loss using the dynamically adapted image-specific prompts. Subsequently, we update the global low-rank prompt prior parameters , the adaptation strength coefficient , and the output transformation M via gradient descent:
The pseudo-code detailing this procedure is provided in Algorithm 1 for clarity and reference. Upon completion of training, the optimal global low-rank prior and strength coefficient are determined. During inference, these meta-learned configurations are directly applied. For any unseen image, its dynamic VP adaptation is computed on the fly according to Equation (7), yielding a tailored visual prompt for downstream tasks.
4 Experiment
To evaluate the effectiveness and efficiency of ES-VP, we adopt the standard VP evaluation protocol, assessing models pre-trained on large-scale datasets across various visual domains. Consistent with prior studies such as AutoVP [50] and SMM [7], we examine the in-distribution performance of ES-VP on ten small-scale image classification datasets. To investigate out-of-distribution (OOD) performance, we further analyze models pre-trained on ImageNet-21K [10] and adapted with VPs on ImageNet-1K. Furthermore, we perform extensive empirical evaluations focusing on the following aspects: (1) demonstrating the superior in-distribution performance of ES-VP across multiple datasets and architectures; (2) assessing the OOD robustness of ES-VP on ImageNet variants; and (3) performing comprehensive ablation studies and detailed analyses.
Algorithm 1: Energy-Shaped Visual Prompting (ES-VP)
Input: Pre-trained model , Image Dataset , Initialize output transformation , Initialize learnable image-specific prompt coefficient , Initialize the global low-rank VP prior , where and ,
repeat (Outer Loop)
Sample a batch of data
for each do (Inner Loop)
Compute low-rank initialization prompted image
Compute energy-based dynamic adaptation
Formulate dynamically adapted prompted image
end for
Compute the meta-objective loss
Update global prior , strength , and using gradient
until Convergence
to investigate the effects of the energy-based adaptation method, the strength coefficient , and the overall efficiency of ES-VP.
4.1 Implementation Details
Networks. We employ five architectures for our experiments, all operating at a resolution of : (1) ResNet-18 and ResNet-50 [17], pre-trained on ImageNet-1K, each with a classifier head for 1000 classes; (2) ViT-B/32 [12], pre-trained on ImageNet-21K and fine-tuned on ImageNet-1K, also with a 1000-class classifier head; (3) Swin-B [38], pre-trained on ImageNet-21K, with a classifier head for 21,841 classes; (4) CLIP [43], a vision-language model employing a ViT-B/32 architecture as its vision encoder. The weights are publicly available through the official PyTorch Model Zoo and the Hugging Face Timm Library .
Datasets. For pre-training, we use the ImageNet-1K dataset [10], containing 1K classes and 1.3M images, and the ImageNet-21K dataset [10], which includes 21K classes and 14M images. We evaluate the in-distribution performance of ES-VP on ten small datasets: Tiny ImageNet [29], EuroSAT [18], OxfordPets [41], Food101 [5], DTD [9], Flowers102 [40], CIFAR10/100 [28], SVHN [39], and GT-SRB [21]. To assess the OOD robustness of ES-VP, we perform experiments by training on ImageNet-1K and evaluating on ImageNet-R [19], ImageNet-Sketch [51], ImageNet-A [20], and ImageNet-V2 [45].
Baselines. We select six representative SOTA methods as baselines for comparison: (1) ILM-VP [8], a Single-VP method that analyzes the effect of frequency-based label mapping (FLM) and introduces iterative label mapping (ILM) for improved performance; (2) AutoVP [50], a leading Single-VP method that automatically selects VP configurations, including prompt sizes and label mapping
https://pytorch.org/vision/stable/models.html
https://huggingface.co/models?library=timm
C. Jin et al.
(LM) strategies; (3) DAM-VP [23], a Diverse-VP method that clusters downstream datasets into smaller homogeneous subsets, each optimized separately with its own prompt; (4) SMM [7], another Diverse-VP method that uses a lightweight convolutional neural network (CNN) and patch-wise interpolation to generate image-specific three-channel masks instead of a shared, predefined mask; (5) LoR-VP [27], a SOTA Single-VP method that utilizes a global low-rank VP and (6) LP [24], which modifies the classifier head of the pre-trained model to adapt to downstream tasks, a common technique in transfer learning.
Training and Evaluation. Results for baseline methods, including ILM-VP, AutoVP, DAM-VP, SMM, and LoR-VP, are reproduced following the experimental configurations specified in their original papers. For ES-VP, we use LP as the default output transformation, resize all input images to , and set the rank in the low-rank initialization design to 4, resulting in only approximately 5K trainable parameters. Optimal hyperparameters for ES-VP are determined through a grid search. We set the learning rate to 0.001, the number of training epochs to 20, and initialize the strength coefficient at 0.05. The experiments are conducted on NVIDIA Quadro RTX6000 GPUs with 24GB of memory, and the results reported are averaged over three independent runs.
5 Main Results
In-distribution Performance. To evaluate the in-distribution generalization performance of ES-VP, we assess its effectiveness across ten downstream datasets, including natural and artificial objects, scenes, textures, and various original image sizes, following [50] and [7]. The quantitative results of using ImageNet-1K pre-trained ResNet-18 and ImageNet-21K pre-trained and ImageNet-1K fine-tuned ViT-B/32 are shown in Table 1, we observe that: ES-VP outperforms all baselines across all networks on ten datasets, achieving an average accuracy improvement of 4.5% over the Single-VP method AutoVP and 1.6% over the Diverse-VP method DAM-VP using ResNet-18. Notably, ES-VP accomplishes this while utilizing × 12 fewer VP parameters than AutoVP and × 340 fewer than DAM-VP. These results demonstrate the effectiveness and parameter efficiency of the dynamic VPs attained by the introduced energy method in ES-VP.
To visualize the training process of visual prompting and provide qualitative results, we show the test accuracy of each epoch during training using CLIP with ViT-B/32 as the vision encoder and ImageNet-1K pre-trained ResNet-50 on four datasets in Fig. 3. We can draw the following positive observations: ① ES-VP consistently achieves the best final accuracy across all model and dataset combinations; significantly, ES-VP achieves 8.0% higher accuracy than the Diverse-VP method DAM-VP using CLIP on DTD and 28.2% higher accuracy than the Diverse-VP method SMM on ResNet-50 and CIFAR100. ② ES-VP converges the fastest among all VP methods, achieving better performance under fewer training epochs, highlighting the training efficiency of ES-VP.
Table 1: Performance of ImageNet-1K pre-trained ResNet-18 and ImageNet-21K pre-trained ViT-B/32 on downstream datasets. Overview of the performance of ES-VP compared to five SOTA baseline methods. Results are averaged over three runs. ES-VP outperforms all baselines across models and datasets.
| Model | Method | Tiny-ImageNet | EuroSAT | OxfordPets | Food101 | DTD | Flowers102 | CIFAR10 | CIFAR100 | SVHN | GTSRB | Average |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ResNet-18 | LP [CVPR22] | 65.12 | 93.56 | 87.25 | 51.24 | 59.88 | 88.12 | 87.05 | 67.01 | 65.56 | 78.02 | 74.28 |
| ILM-VP [CVPR23] | 14.11 | 85.12 | 65.32 | 24.94 | 35.23 | 27.85 | 66.31 | 25.32 | 75.12 | 53.05 | 47.24 | |
| AutoVP [ICLR24] | 59.72 | 93.11 | 82.77 | 54.24 | 54.67 | 85.32 | 87.55 | 63.75 | 83.89 | 81.73 | 74.68 | |
| DAM-VP [CVPR23] | 67.15 | 94.45 | 87.13 | 54.01 | 61.29 | 89.51 | 87.88 | 68.82 | 84.35 | 81.52 | 77.61 | |
| SMM [ICML24] | 39.81 | 92.15 | 74.01 | 17.78 | 33.56 | 38.84 | 72.56 | 38.89 | 84.14 | 80.56 | 57.23 | |
| LoR-VP [ICLR25] | 68.28 | 92.54 | 83.31 | 54.78 | 61.21 | 87.22 | 88.64 | 69.88 | 83.14 | 81.36 | 77.04 | |
| ES-VP (Ours) | 68.89 | 94.42 | 88.63 | 55.67 | 66.62 | 89.35 | 89.63 | 71.15 | 84.84 | 82.58 | 79.18 | |
| ViT-B/32 | LP [CVPR22] | 83.88 | 96.06 | 92.03 | 82.64 | 70.12 | 98.23 | 96.54 | 86.01 | 85.31 | 87.77 | 87.86 |
| ILM-VP [CVPR23] | 32.38 | 88.24 | 78.90 | 48.28 | 42.64 | 64.22 | 85.23 | 40.02 | 80.85 | 67.89 | 62.87 | |
| AutoVP [ICLR24] | 82.39 | 95.65 | 92.12 | 81.81 | 70.65 | 98.35 | 95.42 | 85.86 | 85.01 | 87.12 | 87.44 | |
| DAM-VP [CVPR23] | 84.90 | 95.72 | 92.40 | 86.77 | 73.08 | 99.21 | 97.36 | 88.10 | 87.84 | 90.62 | 89.60 | |
| SMM [ICML24] | 79.72 | 93.37 | 83.91 | 64.68 | 45.42 | 79.31 | 97.35 | 82.67 | 89.55 | 80.71 | 79.67 | |
| LoR-VP [ICLR25] | 85.85 | 96.25 | 92.18 | 83.51 | 72.30 | 98.58 | 97.52 | 88.65 | 86.31 | 88.07 | 88.92 | |
| ES-VP (Ours) | 86.65 | 96.45 | 92.48 | 87.82 | 74.51 | 99.10 | 97.81 | 89.44 | 90.92 | 91.78 | 90.70 |

ILM-VP AUTO-VP DAM-VP CLIP-VP LP ES-VP(Ours)
Fig. 3: Performance of ImageNet-1K pre-trained ResNet-50 and CLIP Pre-trained Models on Downstream Datasets. Overview of the performance of ES-VP compared to five baseline methods. The final performance of each method is indicated by the markers. ES-VP consistently outperforms all baselines across various models and datasets with fewer training epochs.
Out-of-distribution Performance. A key advantage of ES-VP is the use of an energy-based method to generate dynamic VPs, which helps in identifying OOD data [14, 37]. To evaluate the OOD robustness and potential practical applicability of ES-VP, we perform experiments using ImageNet-21K pre-trained Swin-B trained further on ImageNet-1K. We subsequently assess the resulting model and VPs on four OOD datasets. The performance comparison between ES-VP and the 3 strongest baseline methods is presented in Table Table 2. Notably, ① ES-VP achieves the highest performance among all baselines on the extensive ImageNet-1K dataset, further validating its effectiveness on large-scale datasets. ② ES-VP consistently demonstrates superior OOD robustness and generalization capabilities across all four OOD datasets, showing an average accuracy improvement of over AutoVP and over DAM-VP.
C. Jin et al.
Table 2: Out-of-Distribution Generalization Performance. Evaluation of OOD generalization performance using ImageNet-21K pre-trained Swin-B trained on ImageNet-1K, tested across four OOD datasets.
| Method | Source | Target | |||
|---|---|---|---|---|---|
| ImageNet-1K | -R | -Sketch | -A | -V2 | |
| LP [CVPR22] | 83.47 | 51.24 | 39.96 | 27.38 | 71.73 |
| AutoVP [ICLR24] | 78.98 | 38.14 | 28.89 | 17.91 | 67.38 |
| DAM-VP [CVPR23] | 83.97 | 52.08 | 41.12 | 27.90 | 72.43 |
| LoR-VP [ICLR25] | 84.04 | 52.27 | 41.13 | 27.89 | 72.38 |
| ES-VP (Ours) | 84.17 | 53.22 | 42.08 | 28.41 | 74.05 |
Table 3: Ablation Study on Components of ES-VP. Results obtained using ImageNet-21K pre-trained ViT-B/32 and ImageNet-1K pre-trained ResNet-18 on the DTD dataset.
| Configuration | ViT-B/32 ResNet-18 | |
|---|---|---|
| Baseline | 70.12 | 59.88 |
| + Low-Rank Init. | 72.30 | 61.21 |
| + Dynamic Adaptation | 72.92 | 64.68 |
| + Both Components | 74.51 | 66.62 |
These results highlight the robustness of ES-VP and its potential advantages in complex, real-world applications.
6 Additional Investigation
Impact of Components in ES-VP. We conduct ablation studies on the two primary components of ES-VP: the low-rank prompt initialization and the energy-based dynamic adaptation. The experiments are performed using ImageNet-21K pre-trained ViT-B/32 and ImageNet-1K pre-trained ResNet-50, evaluated on the DTD dataset. Four distinct configurations are studied: (1) Without low-rank initialization and dynamic adaptation, investigating the effect of solely applying LP as the output transformation. (2) With low-rank initialization but without dynamic adaptation, evaluating the impact of only using low-rank initialized VP. (3) With dynamic adaptation but without low-rank initialization, examining the sole contribution of the energy-based adaptation. In this setting, , according to the final VP formulation in (9), the dynamically prompted image can be formulated as:
(4) With both low-rank initialization and dynamic adaptation, representing the complete ES-VP method. Experimental results presented in Table 3 allow the following observations: ① Dynamic adaptation and low-rank prompt initialization are orthogonal, as the highest performance is achieved when both components are combined. ② Dynamic adaptation consistently enhances performance, whether or not low-rank initialization is used. ③ Dynamic adaptation provides greater improvement than low-rank initialization alone; for instance, using ResNet-18, dynamic adaptation yields a accuracy improvement over setting (1), whereas low-rank initialization contributes a improvement.
Impact of Output Transformations. To analyze the influence of different commonly used output transformations on ES-VP, we evaluate ES-VP in combination with ILM [8] and FM [50], referred to as ES-VP w. ILM and ES-VP w.
Table 4: The Impact of Output Transformation. Performance comparison of ES-VP using ILM, FM, and LP as output transformations and baseline methods. ES-VP achieves the best performance across all settings.
| Method | Output Transformatin | Tiny-ImageNet | CIFAR100 | Average |
|---|---|---|---|---|
| LP [CVPR22] | LP | 83.88 | 86.01 | 84.95 |
| ILM-VP[CVPR23] | ILM | 32.38 | 40.02 | 36.20 |
| AutoVP[ICLR24] | FM | 82.39 | 85.86 | 84.13 |
| DAM-VP [CVPR23] | LP | 84.90 | 88.10 | 86.50 |
| SMM [ICML24] | ILM | 79.72 | 82.27 | 81.00 |
| ES-VP w. ILM | ILM | 85.57 | 82.44 | 84.01 |
| ES-VP w. FM | FM | 86.61 | 89.16 | 87.89 |
| ES-VP (Ours) | LP | 86.65 | 89.44 | 88.05 |
FM, respectively. The experimental results obtained using ImageNet-21K pre-trained ViT-B/32 evaluated on CIFAR100 are summarized in Table 4, from which we make the following observations: ① ES-VP achieves the highest performance when using LP as the output transformation across both datasets. ② Even with identical output transformations used by the baseline methods, ES-VP consistently outperforms these methods, highlighting the advantage of our dynamic VP adaptation.
Impact of the Energy-based Method on VP's Discriminative Power. To better understand how the energy-based dynamic VP adaptation in ES-VP affects discriminative performance, we analyze the predicted probabilities assigned to target labels. Specifically, we conduct experiments using ImageNet-1K pre-trained ResNet-18 evaluated on CIFAR100. After each training epoch, we compare the predicted probabilities obtained with and without the energy-based dynamic adaptation. The results are shown in Figure 4. We observe that employing energy-based dynamic adaptation notably increases the average predicted probability for correctly classified images and decreases it for incorrectly classified images. This clearly demonstrates that the energy-based adaptation enhances the discriminative capability of visual prompts in ES-VP.
Impact of the Strength Coefficient . We investigate how the initialization value of the strength coefficient affects performance using ImageNet-1K pre-trained ResNet-50 evaluated on CIFAR100. Results presented in Figure 5 indicate that the optimal initialization for is approximately 0.05 for the highest accuracy.
Efficiency of ES-VP. To assess the efficiency of ES-VP relative to the baseline methods, we evaluate its performance in terms of training epochs, training time, number of VP parameters, inference latency, and inference peak memory. Experiments are conducted using ImageNet-1K pre-trained ResNet-18 and ResNet-50 on the DTD dataset. The results presented in Table 5 highlight several key findings: ① ES-VP achieves superior performance while requiring the fewest training epochs, the shortest training time, and the fewest VP parameters. Notably, on ResNet-18, ES-VP surpasses the best-performing baseline,
C. Jin et al.


Fig. 4: Average predicted probabilities for correctly classified images (left) and incorrectly classified images (right) on CIFAR100 using ImageNet-1K pre-trained ResNet-18. Applying the energy-based dynamic VP adaptation significantly enhances discriminative capability.
Fig. 5: Effect of the initial value of the strength coefficient on accuracy. The dashed line represents the performance of ES-VP without dynamic VP adaptation. An of 0.05 achieves the best performance.
Table 5: Efficiency Comparison. Comparison of the training and inference efficiency of ES-VP compared to the baselines using ResNet-18/ResNet-50 on DTD.
| Method | Type | Model | Epochs | Time | #VP | Params | Latency | Peak Memory | Acc. |
|---|---|---|---|---|---|---|---|---|---|
| ILM-VP[CVPR23] | Single-VP | ResNet-18 | 200 | 1.2h | 147K | 1.1ms | 1.4GB | 35.2 | |
| ILM-VP[CVPR23] | Single-VP | ResNet-50 | 200 | 1.8h | 147K | 2.5ms | 2.2GB | 40.5 | |
| AutoVP[ICLR24] | Single-VP | ResNet-18 | 100 | 0.5h | 101K | 1.1ms | 1.4GB | 54.7 | |
| AutoVP[ICLR24] | Single-VP | ResNet-50 | 100 | 0.8h | 101K | 2.6ms | 2.2GB | 65.5 | |
| SMM[ICML24] | Diverse-VP | ResNet-18 | 200 | 1.2h | 177K | 1.5ms | 2.5GB | 33.6 | |
| SMM[ICML24] | Diverse-VP | ResNet-50 | 200 | 1.9h | 177K | 3.3ms | 3.5GB | 41.5 | |
| DAM-VP[CVPR23] | Diverse-VP | ResNet-18 | 50 | 1.3h | 5.2M | 1.7ms | 3.0GB | 61.3 | |
| DAM-VP[CVPR23] | Diverse-VP | ResNet-50 | 50 | 2.1h | 5.2M | 3.7ms | 3.9GB | 69.0 | |
| ES-VP | Diverse-VP | ResNet-18 | 20 | 0.2h | 5K | 1.7ms | 2.9GB | 66.6 | |
| ES-VP | Diverse-VP | ResNet-50 | 20 | 0.3h | 5K | 3.7ms | 3.7GB | 71.1 |
DAM-VP, by 5.3% while using fewer VP parameters. ② Although ES-VP exhibits inference latency and memory usage comparable to DAM-VP, its accuracy significantly exceeds that of all baselines. Importantly, unlike existing methods, ES-VP avoids the auxiliary networks required by SMM, as well as the extensive hyperparameter tuning and complex VP designs of DAM-VP, thereby enhancing practical scalability and deployment simplicity. Given the sizable accuracy gains, substantially faster training, and ease of deployment, the comparable inference cost to DAM-VP is well justified.
7 Conclusion
This paper introduces an efficient and effective adaptive energy-shaped VP method named ES-VP that utilizes low-rank prompt initialization with energy-based dynamic VP adaptation to generate image-specific VPs. Extensive experiments consistently demonstrate the superior generalization performance and parameter efficiency of ES-VP compared to SOTA Single-VP and Diverse-VP approaches. Additional investigations provide valuable insights into the effec-tiveness and training efficiency of energy-based dynamic VP adaptation. Importantly, ES-VP avoids auxiliary networks, extensive hyperparameter tuning, and multiple VP designs in existing methods, improving scalability in practice and simplicity for deployment.
C. Jin et al.
References
-
Aghajanyan, A., Gupta, S., Zettlemoyer, L.: Intrinsic dimensionality explains the effectiveness of language model fine-tuning. In: Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). pp. 7319–7328 (2021)
-
Allen-Zhu, Z., Li, Y., Song, Z., Wang, Y.: On the convergence rate of training recurrent neural networks. In: Advances in Neural Information Processing Systems (NeurIPS). pp. 10031–10041 (2019)
-
Andrychowicz, M., Denil, M., Gomez, S., Hoffman, M.W., Pfau, D., Schaul, T., Shillingford, B., De Freitas, N.: Learning to learn by gradient descent by gradient descent. Advances in neural information processing systems 29 (2016)
-
Bahng, H., Jahanian, A., Sankaranarayanan, S., Isola, P.: Exploring visual prompts for adapting large-scale models. arXiv preprint arXiv:2203.17274 (2022)
-
Bossard, L., Guillaumin, M., Van Gool, L.: Food-101-mining discriminative components with random forests. In: Computer Vision–ECCV 2014: 13th European Conference, Zurich, Switzerland, September 6-12, 2014, Proceedings, Part VI 13. pp. 446–461. Springer (2014)
-
Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J.D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., Amodei, D.: Language models are few-shot learners. In: Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., Lin, H. (eds.) Advances in Neural Information Processing Systems. vol. 33, pp. 1877–1901. Curran Associates, Inc. (2020), https://proceedings.neurips.cc/paper_files/paper/2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf
-
Cai, C., Ye, Z., Feng, L., Qi, J., Liu, F.: Sample-specific masks for visual reprogramming-based prompting. In: Forty-first International Conference on Machine Learning (2024)
-
Chen, A., Yao, Y., Chen, P.Y., Zhang, Y., Liu, S.: Understanding and improving visual prompting: A label-mapping perspective. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 19133–19143 (2023)
-
Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., Vedaldi, A.: Describing textures in the wild. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 3606–3613 (2014)
-
Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: 2009 IEEE conference on computer vision and pattern recognition. pp. 248–255. Ieee (2009)
-
Devlin, J.: Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805 (2018)
-
Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth words: Transformers for image recognition at scale. In: International Conference on Learning Representations (2020)
-
Finn, C., Abbeel, P., Levine, S.: Model-agnostic meta-learning for fast adaptation of deep networks. In: International conference on machine learning. pp. 1126–1135. PMLR (2017)
-
Grathwohl, W., Wang, K.C., Jacobsen, J.H., Duvenaud, D., Norouzi, M., Swersky, K.: Your classifier is secretly an energy based model and you should treat it like one. In: International Conference on Learning Representations (2019)
-
Guan, Y., Liu, Y., Zhou, K., Shen, Z., Hwang, J.N., Belongie, S., Li, L.: Is meta-learning out? rethinking unsupervised few-shot classification with limited entropy. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 4188–4197 (2025)
-
He, K., Gkioxari, G., Dollár, P., Girshick, R.: Mask r-cnn. In: Proceedings of the IEEE international conference on computer vision. pp. 2961–2969 (2017)
-
He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770–778 (2016)
-
Helber, P., Bischke, B., Dengel, A., Borth, D.: Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing 12(7), 2217–2226 (2019)
-
Hendrycks, D., Basart, S., Mu, N., Kadavath, S., Wang, F., Dorundo, E., Desai, R., Zhu, T., Parajuli, S., Guo, M., et al.: The many faces of robustness: A critical analysis of out-of-distribution generalization. In: Proceedings of the IEEE/CVF international conference on computer vision. pp. 8340–8349 (2021)
-
Hendrycks, D., Zhao, K., Basart, S., Steinhardt, J., Song, D.: Natural adversarial examples. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 15262–15271 (2021)
-
Houben, S., Stallkamp, J., Salmen, J., Schlipsing, M., Igel, C.: Detection of traffic signs in real-world images: The german traffic sign detection benchmark. In: The 2013 international joint conference on neural networks (IJCNN). pp. 1–8. Ieee (2013)
-
Hu, E.J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., Chen, W.: Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685 (2021)
-
Huang, Q., Dong, X., Chen, D., Zhang, W., Wang, F., Hua, G., Yu, N.: Diversity-aware meta visual prompting. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10878–10887 (2023)
-
Iofinova, E., Peste, A., Kurtz, M., Alistarh, D.: How well do sparse imagenet models transfer? In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 12266–12276 (2022)
-
Jin, C., Che, T., Peng, H., Li, Y., Metaxas, D.N., Pavone, M.: Learning from teaching regularization: Generalizable correlations should be easy to imitate. Advances in Neural Information Processing Systems 37, 966–994 (2024)
-
Jin, C., Huang, T., Zhang, Y., Pechenizkiy, M., Liu, S., Liu, S., Chen, T.: Visual prompting upgrades neural network sparsification: A data-model perspective. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 39, pp. 4111–4119 (2025)
-
Jin, C., Li, Y., Zhao, M., Zhao, S., Wang, Z., He, X., Han, L., Che, T., Metaxas, D.N.: Lor-VP: Low-rank visual prompting for efficient vision model adaptation. In: The Thirteenth International Conference on Learning Representations (2025), https://openreview.net/forum?id=5btFIv2PNb
-
Krizhevsky, A., et al.: Learning multiple layers of features from tiny images (2009)
-
Le, Y., Yang, X.: Tiny imagenet visual recognition challenge
-
LeCun, Y., Chopra, S., Hadsell, R., Ranzato, M., Huang, F., et al.: A tutorial on energy-based learning. Predicting structured data 1(0) (2006)
C. Jin et al.
-
Li, L., Jia, S., Hwang, J.N.: Multiple human motion understanding. In: Proceedings of the AAAI Conference on Artificial Intelligence. vol. 40, pp. 6297–6305 (2026)
-
Li, L., Jia, S., Wang, J., Jiang, Z., Zhou, F., Dai, J., Zhang, T., Wu, Z., Hwang, J.N.: Human Motion Instruction Tuning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) (2025)
-
Li, X.L., Liang, P.: Prefix-tuning: Optimizing continuous prompts for generation. In: Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers). pp. 4582–4597. Association for Computational Linguistics, Online (2021). https://doi.org/10.18653/v1/2021.acl-long.353, https://aclanthology.org/2021.acl-long.353
-
Liu, H., Tam, D., Muqeeth, M., Mohta, J., Huang, T., Bansal, M., Raffel, C.A.: Few-shot parameter-efficient fine-tuning is better and cheaper than in-context learning. Advances in Neural Information Processing Systems 35, 1950–1965 (2022)
-
Liu, H., Cai, C., Zhao, X., Zhu, H., Huang, S., Zhang, X., Chen, T., Hwang, J.N., Huaping, Z., Li, L.: Bcl: Bayesian in-context learning framework for information extraction. In: Findings of the Association for Computational Linguistics: ACL 2026. pp. 31172–31189 (2026)
-
Liu, P., Yuan, W., Fu, J., Jiang, Z., Hayashi, H., Neubig, G.: Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys 55(9), 1–35 (2023)
-
Liu, W., Wang, X., Owens, J., Li, Y.: Energy-based out-of-distribution detection. Advances in neural information processing systems 33, 21464–21475 (2020)
-
Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin transformer: Hierarchical vision transformer using shifted windows. In: Proceedings of the IEEE/CVF international conference on computer vision. pp. 10012–10022 (2021)
-
Netzer, Y., Wang, T., Coates, A., Bissacco, A., Wu, B., Ng, A.Y., et al.: Reading digits in natural images with unsupervised feature learning. In: NIPS workshop on deep learning and unsupervised feature learning. vol. 2011, p. 4. Granada (2011)
-
Nilsback, M.E., Zisserman, A.: Automated flower classification over a large number of classes. In: 2008 Sixth Indian conference on computer vision, graphics & image processing. pp. 722–729. IEEE (2008)
-
Parkhi, O.M., Vedaldi, A., Zisserman, A., Jawahar, C.: Cats and dogs. In: 2012 IEEE conference on computer vision and pattern recognition. pp. 3498–3505. IEEE (2012)
-
Pfeiffer, J., Rücklé, A., Poth, C., Kamath, A., Vulić, I., Ruder, S., Cho, K., Gurevych, I.: Adapterhub: A framework for adapting transformers. In: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations. pp. 46–54 (2020)
-
Radford, A., Kim, J.W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al.: Learning transferable visual models from natural language supervision. In: International conference on machine learning. pp. 8748–8763. PMLR (2021)
-
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al.: Language models are unsupervised multitask learners. OpenAI blog 1(8), 9 (2019)
-
Recht, B., Roelofs, R., Schmidt, L., Shankar, V.: Do imagenet classifiers generalize to imagenet? In: International conference on machine learning. pp. 5389–5400. PMLR (2019)
-
Ren, S., He, K., Girshick, R., Sun, J.: Faster r-cnn: Towards real-time object detection with region proposal networks. IEEE transactions on pattern analysis and machine intelligence 39(6), 1137–1149 (2016)
-
Ridnik, T., Ben-Baruch, E., Noy, A., Zelnik-Manor, L.: Imagenet-21k pretraining for the masses. In: Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1)
-
Shin, T., Razeghi, Y., Logan IV, R.L., Wallace, E., Singh, S.: AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts. In: Webber, B., Cohn, T., He, Y., Liu, Y. (eds.) Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). pp. 4222–4235. Association for Computational Linguistics, Online (Nov 2020). https://doi.org/10.18653/v1/2020.emnlp-main.346, https://aclanthology.org/2020.emnlp-main.346
-
Tsai, Y.Y., Chen, P.Y., Ho, T.Y.: Transfer learning without knowing: Reprogramming black-box machine learning models with scarce data and limited resources. In: International Conference on Machine Learning (ICML). PMLR (2020), https://proceedings.mlr.press/v119/tsai20a.html
-
Tsao, H.A., Hsiung, L., Chen, P.Y., Liu, S., Ho, T.Y.: AutoVP: An Automated Visual Prompting Framework and Benchmark. In: The Twelfth International Conference on Learning Representations (2024)
-
Wang, H., Ge, S., Lipton, Z., Xing, E.P.: Learning robust global representations by penalizing local predictive power. Advances in Neural Information Processing Systems 32 (2019)
-
Yang, H., Lin, J., Yang, A., Wang, P., Zhou, C.: Prompt tuning for unified multimodal pretrained models. In: Findings of the Association for Computational Linguistics: ACL 2023. pp. 402–416. Association for Computational Linguistics, Toronto, Canada (Jul 2023). https://doi.org/10.18653/v1/2023.findings-acl.27, https://aclanthology.org/2023.findings-acl.27
-
Yosinski, J., Clune, J., Bengio, Y., Lipson, H.: How transferable are features in deep neural networks? Advances in neural information processing systems 27 (2014)
-
Zhang, C., Bengio, S., Hardt, M., Recht, B., Vinyals, O.: Understanding deep learning (still) requires rethinking generalization. Communications of the ACM 64(3), 107–115 (2021)