Flatness-Aware Prompt Selection Improves Accuracy and Sample Efficiency
Authors: Lingfeng Shen
Weiting Tan
Boyuan Zheng
Daniel Khashabi
Venue: EMNLP 2023 Findings (2023)
Keywords: prompt selection
flatness of prompt

Abstract: With growing capabilities of large language models, prompting them has become the dominant way to access them. 
This has motivated the development of strategies for automatically selecting effective language prompts. 
In this paper, we introduce **pFlat** (prompt flatness), a new metric to quantify the expected utility of a language prompt. This metric is 
inspired by *flatness* regularization in statistical learning that quantifies the robustness of the model towards its parameter perturbations.  We provide theoretical foundations for this metric and its relationship with other prompt selection metrics, providing a comprehensive understanding of existing methods. 
Empirically, we show that
combining **pFlat** with existing metrics
improves
both performance and sample efficiency. 
Our metric outperforms the previous prompt selection metrics with an average increase of 10% in Pearson correlation across 6 classification benchmarks, and the prompt selected by our metric gains 5% higher accuracy than previous metrics across the benchmarks.

Flatness-Aware Prompt Selection Improves Accuracy and Sample Efficiency
Lingfeng Shen v
Weiting Tan Boyuan Zheng
Daniel Khashabi
Center for Language and Speech Processing and Computer Science Department
Johns Hopkins University, Baltimore MD f1shen30, wtan12, bzheng12, danielk]@jhn edu
Abstract
P. "Does that information support the claim?"
P. p, "Iss the assertion accurate in light of such information?
With the growing capabilities of large language models, prompting them has become the dom- inant way to access them. This has motivated the development of strategies for automatically selecting effective language prompts. In this paper, we introduce PFLAT (prompt flatness), new metric to quantify the expected utility of a language prompt. This metric inspired by flatness regularization in statistical learning that quantifies the robustness of the model to- wards its parameter perturbations. We provide theoretical foundations for this metric and its relationship with other prompt selection met- rics, providing comprehensive understand- ing of existing methods. Empirically, show that combining PFLAT with existing metries improves both performance and sample effi- ciency. Our metric outperforms the previous prompt selection metrics with an average in- crease of 10% in Pearson correlation across classification benchmarks, and the prompt se- lected by our metric gains 5% higher accuracy than previous metrics across the benchmarks.
Loss 1ip.0)
Thp,
X shorp minimmun
Dat minimum
V
model parameters
pretrained weights 0g
We show that prompt flatness is an effective indicator of a prompt's performance on an LLM. For ex- ample, if two prompts P1, Pa incurs the same loss LLM parameterized by Og. i.e., L(P1, 0a) = [(ps, fo), we find that the one with a flatter loss landscape of LLM parameters (p1, in this visualization) is better.
Figure I:
This phenomenon results in unexpectedly high level of variability, (Jiang al., 2020; Perez al., 2021; Elazar al., 2021).
1 Introduction
In response such difficulties, recent works propose metrics for automatic prompt selection. Notably, Sorensen et (2022) introduces Mutual Information (MI) to quantify the shared informa- tion between prediction and inputs. Further, Chen et al. (2022) introduces Sensitivity (SEN) to quan- tify model receptiveness to textual perturbations of the input prompts. Despite such metrics' empirical effectiveness, the underlying principles that enable them are not well understood.
Manually "'engineering" prompts for large lan- guage models (LLMs) have been shown lead tremendous performance gains and have been a subject intense study recent years (Schick and Schütze, 2021a: Reynolds and McDonell, 2021: Mishra et al., 2022). However, the task of prompt engineering can be challenging due to the difficulty in determining the effectiveness of prompt solely based on its raw text form. Consequently, this pro- cess is typically carried out manually, which can be laborious and time-intensive. In particular, LLMs may produce vastly different predictive distribu- tions for two seemingly comparable prompts, de- spite their semantic similarity (Mishra et al., 2022).
This motivates the following questions: (RQ1) What makes the existing methods for prompt se- lection effective? (RQ2) How are these existing methods connected? (RQ3) Are there any new metrics complementary to the existing ones?
V Equal contribution.
To address the questions above, we study exist- ing methods from an optimization perspective. The
'The code is accessible here: httpe://github.com com/ hhadowkiller33/41 flatnes..

---

objective C(p, Do) quantifies the performance of an LLM (parameterized by 0n) on labeled data D and a prompt p appended to the dataset inputs. Prompt selection in effect an optimization on (pp D, 8b) as a function of different choices of p. The challenge is that, in practice, there are few labeled data D (Perez et al., 2021), which would make (.) unreliable measure for selecting ef- fective prompts. We show that the existing prompt selection metrics (MI and SEN) (Sorensen al., 2022: Chen al., 2022) approximate the objec- tive function L, and therefore, act as its surrogates. This addresses (RQ1) 1 and (RQ2) above.
2.1 Background and Setup
Notation. We cast prompt selection into an op- timization problem. We are provided with pre- trained language model f with parameters 0 C IR" which maps each input natural language instance to fo(œ) [0, 1]] distribution over the la- bel set V. We are also given input-output pairs D ((x,, y)}. where y is one-hot label.
Prompt selection. Given language model f, seek minimize the following empirical risk, also called prompt loss in this paper.
Additionally, to address (RQ3) we borrow ideas from statistical learning on talness-aware optimiza- tion (Hochreiter and Schmidhuber, 1994; Keskar al., 2017). We introduce Prompt Flatness (PFLAT), a metric that quantifies L sensitivity to small perturbations in LLMs parameters, when con- ditioned on a prompt (see Figure for intuitions). Our results indicate that prompts with higher flat- ness generally lead to better accuracy.
2,0,
1 D
Σ (Z,y)ED
((o(poo)))))
where o x is the string combination of a prompt to input x, and é is an appropriate loss such as cross-entropy that quantifies the gap between gold label y and predicted distribution fe(p x).
In the classic machine learning literature, it is customary to minimize empirical risk C(p. D, 0) with respect the parameters of the underlying model However, the recent developments LLMs (Radford et al., 2019; Brown et al., 2020) have resulted in an alternative that involves opti- mization concerning the choice of prompt p:
Our formal derivations also show that PFLAT is distinct from and complementary to prior metrics such as MI and SEN. Our empirical results ($3) on six classification benchmarks and four different model sizes also confirm our theoretical intuition. For example, combining PFLAT and MI improves the downstream performance by 6% accuracy over the prompts selected by MI only. Similarly, com- bining PFLAT and SEN improves the downstream performance by 9% accuracy over prompt selected by SEN only. Additionally, using PATL substan- tially improves sample efficiency, an important fea- ture of low-resource scenarios.
i = arg min D,.).
(1)
pEP
given a collection of natural language prompts P that are "engincered" by domain experts (Schick and Schüitze, 202 b,; Mishra et al., 2022)
2.2 Prompt Selection via Flatness
In summary, contributions are: (a) We pro- pose formal optimization framework that unifies several existing prompt selection metrics such as MI and SEN. (b) Enabled by our formalism, we introduce PFLAT, a metric for selecting prompts that is more robust to LLMS' parametric perturba- tions. (c) We conduct comprehensive experiments and the results demonstrate the effectiveness of our method for prompt selection.
Our work draws inspiration from classic machinc learning, where studies have demonstrated that us- ing loss flatness in model selection leads to im- proved performance and generalization (Foret et al., 2020; Baldassi et al., 2020; Zheng et al., 2021; Stutz et al., 2021; Andriushchenko and Flam- marion, 2022). In this prior literature, the optimiza- tion is performed with respect model parameters 0. Conversely, in the modern NLP literature, the pa- rameters of LLMss are set once they are pre-trained, and further optimization achieved through input prompts As a result, remains to be seen whether the findings from classic machine learning litera- ture will translate to prompting LLMs.
2 Prompt Selection via Flatness
We start by introducing the necessary background and the notational convention ($2.1), then introduce our proposed metric, PFLAT ($2.2), followed by a discussion its relation to other existing prompt selection metrics ($2.3).
Robust prompt selection objective. We start with the formal definition of flatness. Specifically,

---

the goal is select parameters that are robust to parameter perturbations:
input instances only (no labels). Intuitively, higher PFLAT means higher sensitivity towards perturba- tion in model parameter, indicating that the given input prompt, instances, and the model parame- ters have formed a sharper minimum. The formal connection between PFLAT and F is deferred to Appendix B.
[(p,D, 0,
max ((, D, c),
(2)
cl|
p arg min C(,,
pEP
where is small perturbation added model pa- rameters 0. The inner optimization quantifies the worst-case loss upon small perturbation of the model parameter from its default value, where the perturbations are contained within small algebraic ball, |||| < r. The overall objective is a minimax optimization (Zheng et al., 2021; Stutz et al., 2021; Baldassi et al., 2020) i.c., selecting the best prompt P with the smallest worst loss under small perturba- tions. Note that this is strict generalization of the standard prompt selection objective in Equation 1.
Although the precise computation of PFLAT de- mands numerous Gaussian samples, practically, ap- proximating it with few samples suffice for rea- sonable PFL.ATestimate. We'll demonstrate this in the experiments ($4).
Putting it together. Incorporating our PFL.TT metric (Equation 6) in robust prompt selection ob- jective (Equation 4) we get the following:
E(p, D,0) (. D,0), (7)
Flatness definition. Since Equation 2 is a non- trivial saddle-poin optimization problem, previous work (Zhao et al., 2022; Zhang et al., 2023b) has approximated it with the gradient norm of loss func- tion:
where a is scalar hyperparameter. In our exper- iments, select the prompt with the smallest L and show that such prompts have better quality than those selected only by MI or SEN. For emphasis. this equation shows that for robust prompt selec- tion according to Σ, it not enough use PFLAT alone. It should be used in conjunction to L or its approximations (discussed in the next section). We show this point empirically in Section 3. The only reason that our metric is not fully zero-shot is that the peramm-a a has to be selected according to few examples of held-out set.
C(p, D.0) = D,,) oFF(,, F(p, 0) e |VoL(p, D,
(4)
where F(p, D, 0) is the accurate analytical defini- tion of flatness the loss function [(.). Intuitively, it quantifies how resilient it is against small pertur- bations in parameter space 0.
The calculation of F requires (1) gradient com- putation of the loss L and (2) ground-truth labels which may not be available. To circumvent these challenges, we introduce an approximation of F.
2.3 Relation to Prior Prompt Metrics
We show that prompt selection through existing methods such as MI (Sorensen et al., 2022) and SEN (Chen et al., 2022) is approximately equivalent to minimizing prompt loss [(p, D, 0), as shown in Equation 5. Therefore, they can be viewed surrogates to C(-). Formally, we provide the gap between prompt loss and its surrogates (e.g.. MI and SEN) which is determined by the difference (e.g., KL divergence) between a model's predic- tions and the ground-truth labels.
An efficient surrogate for flatness. Here pro- vide approximate definition of flatness (F in Equation 5) that does not depend on instance la- bels. Our new metric, PFLAT quantifies the amount changes in LLM confidence values upon pertur- bations in its parameters:
PFLAT(P, Dx.00 0)
1
Σ
Eci,c g(())) ((())-((e))] (6)
[Dxl
Mutual Information. Sorensen et al. (2022) pro- pose to pick prompts that maximize the mutual information between model input and the predic- tion.
where g(c) ((fopozz), fo fo (pox)) are sampled from Gaussian distribution (O, o²) with its variance o² determining the perturbation magnitude. Furthermore, Dx = {x} refers to the
and 62
Mutual information MI(p. D,0) is a surrogate loss for prompt loss L(p, D.6) 8) with a
Proposition 1.

---

gap quantitatively defined as follows:
and Tice, 2000). We choose four different GPT-2: base, medium, um, large, and sizes.?
Al(p,,,0) -(p,-D,
Held-out set for a hyperparameter. For each dataset, we create small dev-set by randomly selecting 8 labeled sentences per class to tune the value of a.
=c =
Σ
[D]
(2.y)ED
where c a constant e H( p)) that does not depend on prompt KL refers to KL diver- gence.
Implementation. We prepare 20 human-written instructions by the authors (included in Ap- pendix F) appended by random demonstrations for each task. The number of demonstrations is set as 5, which matches the settings in Sorensen et al. (2022) for fair comparison. We use MI, SEN, PFLAT, and their combinations for comparison. The results are averaged on three random seeds. We esti- mate PFLAT (Bquation 6) via random Gaussian perturbations of LLM parameters with variance o² set to 1e-4. Later, we offer an assessment of the influence of this estimation ($4.4).
Sensitivity. Give a prompt p. Chen et al. (2022) utilizes the sensitivity of model prediction towards the textual perturbation in p.
Proposition 2. Sensitivity SEN(p, D.0) is sur- rogate loss for prompt loss L(p, D, f) with gap defined as follows:
SEN D, C(p.D.0)
Σ Ey (fo(ro))))) (2.))ED
[D]
Evaluation metrics. We use two metric families: Correlation with accuracy: The first category mea- sures the alignment between prompt selection met- rics (including our proposed metric) and the down- stream accuracy of each prompt. This evaluation contrasts the relative quality of prompts based on their accuracy with their prompt-selection accu- racy. Specifically, for each prompt, compute the prompt selection metric score (MI, MI + PFLAT, which uses only task inputs) and the prompt's ac- curacy on the test set. Given a collection such paired numbers, we compute their correlation. A high correlation indicates that this prompt-selection metric can serve as a "surrogate" (proxy) for select- ing the most accurate prompt, bypassing the direct maximization of accuracy which often demands extra held-out labeled data.
where p' and f0r refer to the perturbed prompt and 0-1 loss, and Eg is an expectation (average) over different choices of perturbed prompts p'
The detailed analyses are deferred to Ap- pendix A. These derivations show that selecting prompts based on MI and Sen is upproximately se- lecting the prompts with the smallest prompt loss, which shows their connections and explains why they effective for prompt selection.
Complementarity to PFLAT. A corollary of Proposition 1,2 is that prompt-selection metrics such MI (Sorensen et al., 2022) and SEN (Chen al., 2022) are surrogates for prompt loss, which are complementary to PFLAT, for the purpose of ro- bust prompt selection (Equation 2). To see this, is enough to go back to Equation 7, which shows how robust prompt selection decomposes into PFLAT and L. Finally, as we see, L is approximated by SEN and MI, which concludes the argument.
Ranking evaluation: Since correlations are sensi- tive and brittle to outliers (Anscombe, 1973), we further use different metrics for best-perfo prompt retrieval. Specifically, we use NDCG @ (Järvelin, 2000). NDCG@3, and Rate. NDCG is common metric for ranking quality in informa- tion retrieval. Here, we take prompts' performance as their quality score for NDCG. We denote the prompt selected by metric (c.g., highest MI or low- est SEN) as 9, and Rate is defined as follows:
3 Experiments
We conduct extensive experiments assess the effectiveness prompt selection metrics.
Experimental setup. We experiment with vari- ety of classification benchmarks: AGNews (Zhang et al., 2015), CB (De Marneffe et al., 2019), DBpe- dia (Zhang et al., 2015). SST-2 (Socheres et al., 2013), RTE (Dagan et al., 2005), and TREC (Voorhees
Performance(p))
Rate Performance(p.)
(8)
"The models are accessible at https://hugglngTeer co/ gpt2.

---

FLAT
Mi-pFLAT
25.125.6
28.1
25
25
26.2
22.5
21.7
Corelatio
Speaman Correlation
1..0
20
15
13.9
10.8
10
10
2.6
3.4
SEN
Metric
5
4.5
Metric
50N-3FLATT
Mi+pTLAT
AGNews
CB
DBpedia
SST2
RTE
TREC
AVG
AGNews
CB
DBpedia SST2
RTE
TREC
AVG
vs. (NI, SOFUTT
v.s. (MI SEN)
30
2047A
25
20
23-3
Speaman Correaaiion
18.1
Corre
20
15
22.
10
10
Metric
Metric
SEN-DFLATT
AG News
CB
DBpedia
SST2
RTE
TREC
AVG
AGNeWs
CB
DBpedia SST2
RTE
TREC
AVG
Dataset
Dataset:
Figure 2: Results of correlation evaluation across six datasets and their average (AVG). First row: SEN
SEN+PFLAT and MI vs MI+PFILAT show that flatness brings consistent improvements over existing metrics. Bottom left: From PFLAT vs MI+PFIATT, flatness does not perform well when applied alone, as expected. Bottom right: MI+SEN MIcomparison shows that combining SEN and MI brings limited improvement.
where Po refers to the prompt that achieves the best performance on the task. Intuitively, Rate reflects the performance of the selected prompt compared to the best prompt, and it is real-valued number between 0 and 1. A larger Rate corresponds to better selected prompt
loss, prompt flatness on itself is insufficient re- flect prompt quality. Such results also stress the importance of combining prompt loss and flatness.
Further Analysis
Flatness complementary MI and SEN. The correlation results are in Figure 2 (detailed num- bers in Appendix C). Figure (first row) shows that correlations are higher for MI+PFLAT and SEN++FLAT than for metrics without PFLAT. In other words, combining existing (MI or SEN) with flatness results in more effective prompt selection metric that correlates better with test accuracy.
4.1 Continuous Prompt Selection
In addition to text form (discrete) prompt, we also test out the effectiveness of flatness for continu- ous prompt optimization (also known 'prefix- tuning'). Like the earlier result, introducing flat- ness prefix-tuning also improves model perfor- mance.
We find similar results in the ranking evaluation illustrated Figure (full results Appendix D). benchmarks, metrics incorporating flatness generally surpass those without it, highlighting the importance of utilizing prompt flatness in the prompt selection process.
Method
SST-2
AGNews
SNLI
w/o Flatness
92.5 (0.1)
86.4 (0.2)
72.5 (0.2)
w/ Flatness
93.1 (0.1)
87.3 (0.1)
73.3 (0.2)
Table 1: Performance for prefix tuning with flatness and w/o flatness in mean (standard-deviation) form. observed that leveraging flatness in continuous prompt tuning brings improvements to performance. Stronger numbers for each dataset are marked bold.
Flatness alone does not help. As shown in Fig- ure 2, SEN+PFLAAT, MI+PFLAT or MI generally outperforms PFLAT, these results show the impor- tance combining prompt loss. Without prompt

---

100
GPToase's Performance (M) MI-PFLAT)
GPT-bare's Performance SEN+
96.8
92.6
92.7
92.4
92.8
93.5
90.8
90
87.8
86.8
86.6
86.5
85.6
86.7
85.7
63.9
83.1
Rate
80
75
75
70
70
65
MI
65
SEN SEN-PFLAT
MI+pFLAT
60
60
SST2
RTE
TREC
AGNeWs
DBpedia
AVG
SST2
RTE
TREC
AGNows
CB
DBpedia
AVG
Dataset
Dataset
Figure 3: Rate(reflecting the ability to select better prompts) computed for prompt selection across six datasets and their average performance, using GPT2-base model. We can see that combining flatness with existing metrics (MI+PFLAT or SEN+PFLAT) is consistently better than not using PLLAT.
fffrent GPT model's Rate Performance MI+TFLA
Different GPT model's Rate Performence ISEN SCN++PLATT
100
97.4
94.7
92.8
86.8
97.3
38.5
85.4
85.9
87.8
Rale
bate
75
70
65
65
MP-FLLAT
SEN+pFLAT
60
60
GPT2-medium GPT2-large
GPT2-xl
GPT2-medium GPT2-large Dataset
GPT2-xl
Dataset
Figure 4: Rate (reflecting the ability to select better prompts) evaluation computed prompt selection across four model sizes, evaluated on the AGNews dataset. Combining prompt loss and flatness (MI+PFLAT or SEN+PFLAT) is consistently better than MI/Sen alone across different model types. More detailed results are deferred to Appendix D.
Experimental setup. We following prefix-tuning setup of Li and Liang (2021) and consider three text classification benchmarks in our experiments: SST-2 (Socher et al., 2013), AGNews (Zhang et al., 2015), and SNLI (Bowman et al., 2015). We use the GPT2-medium as the model and set pre- fix length to 10 tokens for all prefix-tuning experi- ments. We train 30 epochs for SST-2 and 25 epochs for AGNews and SNLI, as suggested in Yang and Liu (2021).
Results. As shown in Table 1, prefix-tuning with flatness achieves better performance than without flatness. Such results show that flatter continu- ous prompts bring better performance, which matches our conclusions on discrete prompts.
4.2 Influence of Model Size
We investigate the effects of model size in our methods. As shown in Figure 4, as the model size increases the gap between the two metrics (e.g., MI vs MI+PFLAT) measured in terms of Rate generally increases, indicating an increasing gain from adding PFLATT to existing prompt selection for larger models.
Implementation of flatness-aware prefix-tuning. To introduce flatness into prefix tuning, we leverage sharpness-aware optimizer SAM (Foret al., 2020) for model optimization. We use Adam (Kingma and Ba, 2015) as our optimizer in the counterpart without flatness. Specifically, both cases use the same learning rate 5e-5.
4.3 Impact on Sample Efficiency
If there is enough labeled data, a reasonable ap- proach for prompt selection is based on the ac-

---

curacy of the prompt on a labeled development set (we name this baseline method "acc"). Thus, a natural question concerning practicality arises: how does our method compare to prompt selection based on the accuracy of limited labeled exam- ples? To perform the comparison, we select N labeled data from the AGNews dataset and evalu- ate Rate (Equation 8) for both "acc" baseline and method (MI/SEN PFL.T))
As noted earlier, we compute prompt flatness by sampling from standard Gaussian distribution (0, d²). Since the computational cost of this estimate is proportional to the sample size N, the choice of is crucial for our efficiency. Figure 7 shows the results of an experiment showing the trade-off between N and estimation quality, The results indicate that N x 5 is sufficient to provide reliable estimates for PFL.AT.
Based on the results in Figure 5, we observe that with little data available, our methods select a far better prompt than the "acc" baseline, allowing performance gains in low-data scenarios. This can be attributed to the fact that when the dataset is small, there may be significant distribution shift between the development and test sets. However, our methods, MI/Sen/PFLAT, provide signals be- yond labeled data and thus more resilient to such distribution shifts. Unsurprisingly, when data size grows, the gap between our method and the "dev" baseline decreases since the distribution shift issue is mitigated by increasing the size of the dev set. In conclusion, our metrics are more advantageous than development set accuracy for prompt selection in low-resource scenarios.
Likewise, we investigate the impact of o² on the estimate. The results in Figure (a, b) indicate that the optimal perturbation size around 1e-4. When the perturbation size increases after 1e-4, the estimation error also increases.
5 Related Work
Prompt selection and engineering. Perfor- mance of LLMs is highly sensitive to their prompt prefix, including the ordering of demon- strations (Lu et al., 2022) or framing of the in- structions (Mishra et al., 2022). This has moti- vated work prompt selection, such the ones dis- cussed in this work (Chen al., 2022; Sorensen et al., 2022). Beyond quantifying prompts' ef- fectiveness, the literature has explored alternative ways address LLMs' brittleness, such as chain- th-thosghss prompting (Kojima et al., 2022), LLM self-consistency (Wang et al., 2022a) and complex- ity (Fu et al., 2022). Our optimization-ban work does not cover these classes of prompt engi- necring, which we hope future work will address.
Dev-set Acc-based Selection methods on AGNews
95
frame-
90
Rahe
A Algorithmic prompt generation. Several prior works focus on generating effective prompts to solve a given task via an LLM. Examples are RLPrompt (Deng et al., 2022), GrIPs (Prasad et al., 2023), and Tempera (Zhang et al., 2023a). While these works primarily focused generating prompts with high performance for commpt-tumingg our goal is to identify effective prompts for pool of candidate prompts that is beneficial for in-context learning. In particular, within the context of Ap- pendix E, a comparative analysis conducted to examine the in-context learning performance of prompts generated by these approaches. The re- sults reveal that prompts deemed suitable for fine- tuning exhibit sub-optimal performance in terms of in-context learning.
M1+DFLAT DELAT
ACC
75
0
20
40
60
80
100
120
Sample size
Figure 5: For development sets with varying sizes n = 16, 32. 512, the devset-ace based method (green line) selects prompts based on the accuracy of prompts n devset samples. On the other hand, our metric (MI+PFLAT and SEN+PFLAT) also use sam- ples and achieve better performance under low-resource scenarios (n < 500).
4.4 Estimation of PFLAT
In our implementation of PFLAT (Equation 7), there are two factors that affect PFLAT: the sam- pling number N and the perturbation size o², We explore their effects in this part.
Besides, the ability generate prompts in- evitably involves model tuning via setups like Re- inforcement Learning which incurs an additional computational cost. More importantly, the qual-

---

(a)
(b)
Performance of SEN + PFLAT as perturbation size varies
Performance of MI PFLAT as perturbation size varies
I-
AGNews
97
AGNews
96
SST-2
SST-2
96
95
TREC
TREC
95
CB
94
Rate
Rate
94
DBPedia
93
93
92
91
91
90
90
89
10:5
10
10-3
10
10-3
10
Perturbation size
Perturbation size
Figure 6: (a) Rate of SEN+PFLAT as perturbation size varies. The optimal e is around 1e-5, as enlarges, the performance of SEN+PFLAT continues degrade. (b) Rate of MI+PFLAT as perturbation size varies. The trend in MI+PFLAT is similar to (b).
challenging to transfer insights from prompts that work well for one task to another.
Mi+PFLAT SEN+PFLAT
ACC
Flatness-aware language modeling Previous works (Liu et al., 2023; Mehta et al., 2021) showed that flatness-aware optimization can enhance the generalization of LLM during pre-training, even if the training loss is the same. Na et al (Na et al., 2022) demonstrated that flatness-awan training in- creases the compression rate. Wang et al(Wang al.. 2022b) showed the advantages of flatness in training encoder-only models.
89
87
86
84-
83
Number of sampling times Figure 7: The trade-off between performance and sam- pling number N in PFLAT's computation procedure. We can observe that the proper N is around 5.
Model calibration and robustness analysis. Model calibration focuses on adjusting LLMs' predictions to reflect human uncertainty (Holtz- man et al., 2021; Zhao et al., 2021; Jiang et al., 2022). Calibration is related to our work as a well- calibrated LLM's confidence could be used for prompt selection. However, calibration algorithms have remained domain/task-speciiii so far, restrict- ing their applicability the problem discussed in this paper.
ity of the generated prompts depends on the task's domain. When confronted with Out-of-Domain (OOD) tasks, these approaches tend to generate nonsensical prompts.
Continuous prompts. Beyond language (dis- crete) prompts, we show that our results also apply to continuous prompts. contrast to manually creating discrete prompts, one can optimize contin- uous prompts in embedding space, yielding better results (Lester et al., 2021; Li and Liang, 2021; Zhang et al., 2022; Gu et al., 2022; Lang al., 2022; He et al., 2022). Despite higher accuracy, continuous prompt optimization only applica- ble LLMs that are publicly accessible. Besides, there is no evidence that continuous prompts are interpretable (Khashabi et al., 2022), making
Conclusion
We developed a theoretical framework for prompt selection techniques that merges prompt loss and flatness, enabling the integration of previous stud- ies to clucidate their distinctions and efficacy. Through extensive experimentation, we demon- strated the effectiveness of our proposed flatness- based metric when used in conjunction with ex- isting ones. Our research offers valuable insights and directions for future investigations effective

---

prompt engineering.
Yanda Chen, Chen Zhao, Zhou Yu, Kathleen McKeown. and He He. 2022. On the relation between sensitivity and accuracy in in-context learning. arXiv preprint MrXiv:2209.07661
Limitation
The limitations of this study can be outlined as fol- lows: (1) Our paper assesses the methods based on classification tasks, but they can potentially be applied to generation tasks in the future. (2) Our framework presumes that the provided collection of candidate prompts is all coherent and fluent for the intended task, despite the possibilityy of yielding varying results. (3) Our approach is not entirely zero-shot, since it still requires a small labeled de- velopment set for adjusting the a parameter.
Ido Dagan, Oren Glickman, and Bernardo Magnini. 2005. The pascal recognising textual entailment chal- lenge. In Machine Learning Challenges Workshop.
Marie-Catherie De Marneffe, Mandy Simons, and Ju- dith Tonhauser. 2019. The Commitmenntankk Inves- tigating projection in naturally occurring discourse. In proceedings of Sinn und Bedeutung.
Mingkai Deng, Jianyu Wang, Cheng-Ping Hsieh, Yihan Wang, Han Guo, Tianmin Shu, Meng Song. Eric P Xing, and Zhiting Hu. 2022. RIPrompt: optimizing discrete text prompts with reinforcement learning.
Ethical Considerations
To the best of our knowledge, the paper does not pose any immediate ethical concerns.
Yanai Elazar, Nora Kassner, Shauli Ravfogel, Abhilasha Ravichander, Eduard H. Hovy, Hinrich Schütze, and Yoav Goldberg, 2021. Measuring and improving consistency pretrained language models. Trans. Assoc. Comput, Linguistics, 9:1012-1031.
Acknowledgments
We thank the students in the Center for Language and Speech Technologies (CLSP) for their insight- ful feedback. The authors would like to thank anonymous reviewers for their constructive feed- back. This project is supported by generous gifts from Johns Hopkins University, Allen Institute for AI, and Amazon. GPU machines for conducting experiments were provided by ARCH Rockfish cluster hhttps://wwe arch. jhu. edu).
Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur, 2020. Sharpness-aware mini- mization for efficiently improving generalization. In International Conference on Learning Reprexenta- tions (ICLR).
Yao Fu, Hao-Chun Peng, Ashish Sabharwal, Peter Clark, and Tushar Khot. 2022. Complexity-ban -based prompt- ing for multi-step reasoning, International Confer- ence on Learning Representations (ICLR).
Yuxian Gu, Xu Han, Zhiyuan Liu, and Minlie Huang. 2022. Ppt: Pre-trained prompt tuning for few-shot learning. In Annual Meeting of the Association for Computational Linguistics (ACL).
References
Maksym Andriushchenko and Nicolas Flammarion.
2022. Towards understanding sharpness-aware mini- mization. In International Conference Machine Learning (ICML).
Yun He, Steven Zheng, Yi Tay, Jai Gupta, Yu Du, Vamsi Aribandi, Zhe Zhao, YaGuang Li, Zhao Chen, Don- ald Metzler, al. 2022. HyperPrompt: prompt-based conditiiiion of transformers. In International Conference on Machine Learning (ICML), pages 8678-8690.
Francis Anscombe. 1973. Graphs in statistical analy- sis. The american statistician, 27(1):17-21.
Carlo Baldassi. Fabrizio Pittorino, and Riccardo Zecchina. 2020. Shaping the learning landscape in neural networks around wide flat minima. Pro- ceedings of the National Academy of Sciences, 117(1):111-170
Sepp Hochreiter and Jürgen Schmidhuber. 1994, Sim- plifying neural nets by discovering flat minima. In Advances in Neural Information Processing Systems (NeurlPS).
Samuel Bowman, Gabor Angeli, Christopher Potts, and Christopher D Manning. 2015. A large annotated corpus for learning natural language inference. In Conference on Empirical Methods in Natural Lan- guage Processing (EMNLP).
Ari Holtzman, Peter West, Vered Schwartz, Yejin Choi, and Luke Zettlemoyer. 2021. Surface form competi- tion: Why the highest probability answer isn't 't always right. Conference on Empirical Methods Natural Language Processing (EMNLP).
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in Neural Information Processing Systems (NeurIPS), 33.
Kalervo Järvelin. 2000. IR evaluation methods for re- trieving highly relevant documents. In Conference of the Association for Computing Machinery Special In- terest Group in Information Retrieval (SIGIR), pages 41-48. ACM.

---

Zheng Ping Jiang, Anqi Liu, and Benjamin Van Durme, 2022. Calibrating zero-shot cross poosullinuual (un-) struc- tured predictions. In Conference Empirical Meth- ods Natural Language PregeePrrree Processing (EMNLP).
Swaroop Mishra, Daniel Khashabi, Chitta Baral, Yejin Choi, and Hannaneh Hajishirzi. 2022. Reframing instructional prompts to gptk's language. In Annual Meeting of the Association for Computational Lin- guistics (ACL) Findings.
Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. 2020. How can we know what language models know. Trans. Assoc. Comput. Linguistics, 8:423-438
Clara Na, Sanket Vaibhav Mchta, and Emma Strubell. 2022. Train flat, then compress: Sharpness-awarr minimization learns more compressible models. In Findings of the Association for Computational Lin- guistis: EMNLP 2022, pages 4909-4936
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge No- cedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. 2017. On large-batch training for deep learning: Gen- eralization gap and sharp minima. In International Conference on Learning Representations (ICLR).
Ethan Perez, Douwe Kiela, and Kyunghyun Cho. 2021.
True few-shot learning with language models. In Advances in Neural Information Processing Systems (NeurlPS).
Daniel Khashabi, Xinxi Lyu, Sewon Min, Lianhui Qin, Kyle Richardson, Sean Welleck, Hannaneh Ha- jishirzi, Tushar Khot, Ashish Sabharwal, Sameer Singh, and Yejin Choi. 2022. Prompt Waywardness: The curious case of discretized interpretation of con- tinuous prompts. In Conference of the North Amer- ican Chapter of the Association for Computational Linguistics (NAACL).
Archiki Prasad, Peter Hase, Xiang Zhou, and Mohit Bansal. 2023. Grips: Gradient-free, edit-based in- struction search for prompting large language models. Conference of the European Chapter of the Associa- tion for Computational Linguistics (EACL).
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. 2019. Language models are unsupervised multitask learners. OpenAl blog.
Diederik P.
Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. abs/1412.6980.
Takeshi Kojima, Shixiang Shane Gu. Machel Reid, Yu- taka Matsuo, and Yusuke Iwasawa. 2022. Large lan- guage models are zero-shot reasoners. In Advances in Neural Information Processing Systems (NeurlPS).
Laria Reynolds and Kyle McDonell. 2021. Prompt programming for large language models: Beyond the few-shot paradigm. In Conference on Human Factors in Computing Systems (CHI).
Hunter Lang, Monica N Agrawal, Yoon Kim, and David Sontag. 2022. Co-training improves prompt-based learning for large language models. In International Conference Machine Learning (ICML).
Timo Schick and Hinrich Schütze. 202 Exploiting cloze-questions for few-shot text classification and natural lan sanuage inference. In Conference of the Eu- ropean Chapter of the Association for Computational Linguistics (EACL.), pages 255-269.
Brian Lester, Rami Al-Rfou, and Noah Constant. 2021. The power of scale for parameter-efficient prompt tuning. In Conference on Empirical Methods in Nat- ural Language Processing (EMNLP).
Timo Schick and Hinrich Schütze. 202 Few-shot text generation with pattem-exploiting training. Con- ference on Empiricul Methods in Natural Language Processing (EMNLP).
Xiang Lisa Li and Percy Liang. 2021. Prefix-tuning: Optimizing continuous prompts for generation. In Annual Meeting of the Association for Computational Linguistics (ACL).
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher Manning, Andrew Y Ng, and Christopher Potts. 2013. Recursive deep models for semantic compositionality over sentiment treebank. In Conference on Empirical Methods in Natural Lan- guage Processing (EMNLP), pages 1631-1642.
Hong Liu, Sang Michael Xie, Zhiyuan Li, and Tengyu Ma. 2023. Same pre-training loss, hetter downstream: Implicit bias matters for language models. In Inter- national Conference Machine Learning, pages 22188 22188-22214 22214. PMLR.
Taylor Sorensen, Joshua Robinson, Christopher Ryt- ting. Alexander Shaw, Kyle Rogers, Alexia Delorey, Mahmoud Khalil, Nancy Fulda, and David Wingate. 2022. An anformation-theoretie approach to prompt engineering without ground truth labels. In Annual Meeting of the Association for Computational Lin- guistics (ACI.), pages 81 819-862.
Yao Lu, Max Bartolo, Alastair Moore, Schastian Riedel, and Pontus Stenetorp. 2022. Fantastically ordered prompts and where to find them: Overcoming few- shot prompt order sensitivity. In Annual Meeting of the Association for Computational Linguistics (ACL).
Sanket Vaibhav Mehta, Darshan Patil, Sarath Chandar, and Emma Strubell. 2021. An empirical investigation of the role of pre-training in lifelong learning. arXiv preprint arXi::2112.091
David Stutz, Matthias Hein, and Bernt Schiele. 2021. Relating adversarially robust generalization to flat minima. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 7807-7817.

---

Ellen M Voorhees and Dawn M Tice. 2000. Building a question answering test collection. In Conference of the Association for Computing Machinery Special Interest Group in Information Retrieval (SIGIR).
Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed Chi, and Denny Zhou. 2022a. Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.
Zheng Wang, Juncheng Li, Shuhui Qu, Florian Metze, and Emma Strubell. 2022b. Squat: Sharpness-and quantization-aware training for bert. arXiv preprint arXiv:2210.07171.
Zonghan Yang and Yang Liu. 2021. robust prefix- tuning for text classification. In International Con- ference Learning Representations (ICLR).
Ningyu Zhang. Luoqiu Li, Xiang Chen, Shumin Deng. Zhen Bi, Chuanqi Tan, Fei Huang, and Huajun Chen. 2022. Differentiable prompt makes pre-trained lan- guage models better few-shot learners. International Conference on Learning Representations (ICLR).
Tianjun Zhang, Xuezhi Wang. Denny Zhou, Dale Schu- urmans, and Joseph E Gonzalez. 2023a. TEMPERA: Test-time prompt editing via reinforcement learning. International Conference on Learning Representa- tions (ICLR).
Xiang Zhang, Junbo Zhao, and Yann LeCun. 2015. Character-level convolutional networks for text clas- sification. In Advances in Neural Information Pro- cessing Systems (NeurIPS).
Xingxuan Zhang. Renzhe Xu, Han Yu, Hao Zou, and Peng Cui. 2023b. Gradient regularizer seeks flat minima and improves generalization.
Yang Zhao, Hao Zhang, and Xiuyuan Hu. 2022. Penal- izing gradient norm for efficiently improving general- ization in deep learning. International Conference on Machine Learning (ICML).
Zihao 7hao, Fric Wallace, Shi Feng, Dan Klein, and Sameer Singh. 2021. Calibrate before use: Im- proving few-shot performance of language models. In International Conference on Machine Learning (ICML). pages 12697-12706.
Yaowei Zheng, Richong Zhang, and Yongyi Mao. 2021. Regularizing neural networks via adversarial model perturbation. In IEEE Conference on Computer Vi- sion and Pattern Recognition (CVPR), pages 8156- 8165.

---

Supplementary Material
Appendix
Contents
Appendix
Formal connection between optimizing Sen/MI and are minimization surrogates on prompt loss
Appendix
Formal conncction between PFI.AT and flatness
Appendix
Extra results the correlation evaluation
Appendix D
Extra results on the retrieval evaluation
Appendix
ICL performance comparison between prompt selected by our method and other prompt generation methods.
Appendix
The instruction used our paper on each benchmark.
A
Sen and MI are approximations (surrogates) of prompt loss
In this section, we demonstrate that Sen (Sorensen et al., 2022) and MI (Chen et al., 2022) of prompt p on dataset D are essentially surrogates for the prompt loss L on D.
Mutual Information Sorensen et al. (2022) hypothesizes that prompt p; with higher mutual infor- mation (MI) will align a language model to a task better. In prompt selection, MI select the prompt p - argmax, {I (fo(D }); and MI can estimated as:
MI(D, p) (fo(D, = -HO) - (fo(D,p)
(9)
where H refers to entropy, and each term is estimated in expectation using N draws Dx:
1
H()) H
Σ
fo(xop)
(10)
FEDx
H H fo(D
Σ mEDx
[(f
According to the Weak Law of Large Numbers (and assume that test samples E D are independently drawn from an unknown distribution PD), it is easy to obtain that
lim IP ((H(())) - H(E) 2 =0 =0
(11)
Where E refers to the expectation EuEP, o p: 0), and it is fixed distribution once f and Pp are determined. As shown by Equation 11, H)) converges a constant as the test sample number increases. Now we focus on the second term MI (D, p). as shown in Equation 9, We also re-write it as follows:
H ( fo(D p))
Σ zEDx
H(fo(rop)
D
Σ
D
xCDx
-K x 11y))
= D,),
Σ (l((o(rop))l)) ZCDx
D
where loe refers to cross entsoyy and KL is the KL divergence. The equation above illustrates a relation between the second term M and prompt loss. The gap between MI and prompt loss is the average KI.

---

divergence. Overall, MI can be formulated as follows:
MI(D,p) H(E) E(p,
(12)
(l((o(ro
(13)
ØEDx
Equation 12 shows that maximizing mutual information is equivalent to minimizing prompt loss to certain degree, indicating that MI serves as surrogate for prompt loss.
Sensitivity Sensitivity (Sen) reflects how much the model output changes given small perturbations of the input. Sen first creates a perturbed prompt set P given prompt p, by changing demo order a and adding perturbation to the prompt instruction We direct readers to the original paper (Chen et al., 2022) for details of how such prompt sets can be created. Sensitivity on one single test sample x is formally denoted as follows:
SEN(E,
Σ Ei(so(oop) (
(14)
PCP
Naturally, we can extend this sample-level metric to the dataset level. Given samples D, the SEN of prompt p is defined as follows:
SEN(D, N
Σ
SEN(x,
(15)
zEDx
We can re-write the formula for Sen as follows:
SEN(D,
Σ
SEN(E,P)
TEDx
Σ
Ey Byon(foleopp)
D
xCDx
1
C(p, D,0)
Σ mEDx
Ef
[D]
Note that C(p, D) is 0-1 loss instead of cross-entropy loss as shown MI's derivation. The equation above shows that SEN can be regarded as a surrogate for the prompt loss L. Therefore, minimizing SEN is partially equal to minimizing prompt loss, explaining why low-sensitivity prompt achieves better performance, as empirically verified by Chen et al. (2022).
Generally, the gap between prompt loss L and two surrogates (MI and SEN) is determined by the distance (i.e., KL divergence) between the model's prediction fe(æ o p) distribution and ground-truti truth label. When fo())) is identical round-truth label, MT and SEN become perfect surrogates for prompt loss L.
B On the approximation gap of flatness and F
This section details the approximation gap of flatness PFLAT towards F. Firstly, recall the definition of PFLAT and F.
PFLAT(P, D.0)
Σ
[
DEDX
{(fo(p ( fo (p
(16)
Σ
[l(oflp (poe()
D
ED
Also, we re-write F(p,D. D) as follows:
Flp, VoC(p,D,0)1
(17)
voll
(18)

---

Thus, the approximation gap can be obtained through Equation 16 and Equation 17. When the model's confidence is identical to ground tround-truth labels, PFLAT is precise approximator of F.

---

C
Results correlation
Here are the full results correlation comparisons in our paper, as shown in Table
AGNews
CB
DBpedia
SST-2
RTE
Model
Methods
Pr
Spr
Spr
Pr
Spr
Pr
Spr
Spr
MI
21.9
22.5
4.5
25.1
19.2
16.8
20.6
Sen
8.6
7.6
14.3
13.4
-10.6
-14.2
5.6
3.4
-9.9
-13.9
GPT2-base
PFLAT
21.4
19.8
-9.1
-8.1
21.3
22.0
18.3
20.2
20.2
MI4Sen
22.0
16.4
17.1
18.1
26.0
23.7
20.1
21.2
24.9
23.8
MI+PFLAT
26.3
25.7
20.5
20.7
24.1
25.6
23.4
21.7
15.4
17.5
Sen+PFLAT
28.6
29.3
28.1
26.7
29.4
28.1
23.6
24.5
27.2
25.3
MI
27.5
26.4
26.7
23.0
28.9
26.9
27.1
25.0
22.5
16.2
Sen
-11.2
3.5
-4.5
-7.7
-8.6
-10.8
10.1
5.4
-8.4
-10.3
PFLAT
23.8
26.0
22.5
23.4
23.8
23.3
GPT2-medium
MI+Sen
24.7
22.8
20.4
23.7
27.0
27.7
26.5
11.2
MI+PFLAT
29.0
30.1
20.5
31.9
27.0
28.7
Sen+PFLAT
28.1
29.0
23.6
26.6
33.1
31.8
32.3
32.7
24.0
MI
23.4
21.0
20.9
20.9
24.2
27.2
20.2
21.3
22.8
18.6
Sen
11.0
5.6
-6.0
-4.3
-5.9
-8.9
-6.7
5.8
11.0
22.1
GPT2-large
PFLAT
20.0
20.7
19.4
22.4
21.7
22.5
20.1
18.3
22.1
20.2
MI+Sen
25.0
21.3
24.1
24.6
23.0
27.0
25.3
24.0
19.4
21.5
MI+PFLAT
25.4
26.7
25.4
29.3
26.3
27.6
30.1
28.9
35.3
30.9
Scn+PFLAT
29.5
28.8
28.0
28.5
24.9
28.4
31.3
30.4
19.3
20.9
MI
22.7
24.3
18.9
20.1
24.7
22.0
15.3
16.8
14.7
21.2
Sen
5.6
9.9
-3.8
-5.0
-8.4
-13.8
10.1
2.4
-4.3
-10.1
PFLAT
10.6
6.2
20.1
18.1
23.7
23.4
14.2
12.0
24.2
26.9
GPT2-xl
MI+Sen
20.5
19.2
18.2
21.0
21.9
22.0
20.1
19.7
18.0
20.4
MI+PFLAT
21.4
20.5
22.3
19.8
25.1
26.9
22.3
20.9
16.4
18.1
Sen+PFLAT
25.3
21.8
24.3
25.7
25.3
22.3
24.1
20.0
25.3
25.5
Table 2: Pearson (Pr) and Spearman (Spr) correlation between prompts' performance and the metrics of various method. Overall, flatness- based metrics obtain higher correlations. Red means the best performance.

---

D Results Prompt Retrieval
Here are the full results prompt retrieval performance our paper, as shown in Table 3 and Table 4.
SST-2
RTE
TREC
Model
Methods
N@
N@3
N@
N@3
Rate
N@1
N@3
Rate
55.0
56.1
53.6
83.9
MI-PFLAT
56.6
59.4
90.8
48.2
49.4
92.1
55.8
56.7
91.2
GPT2-basc
Sen
52.2
53.6
83.1
55.5
51.3
86.5
53.8
55.0
83.4
Sen+PFL.AT
49.2
59.9
92.7
69.1
57.8
92.4
54.7
56.0
93.3
MI
43.2
48.7
81.9
43.5
48.7
85.9
52.9
57.6
86.0
MI+PFI.AT
51.6
52.2
91.8
56.6
56.2
92.8
58.0
60.1
94.0
GPT2-medium
Sen
45.1
49.0
82.7
44.6
55.2
88.7
54.0
56.0
86.4
Sen+PFL.T
54.1
57.9
90.3
57.1
57.9
93.3
57.4
57.9
95.2
MI
47.5
44.9
81.0
36.6
40.6
90.2
56.1
54.6
88.7
MI+PFLAT
51.2
56.8
90.4
64.1
42.3
96.0
58.1
54.2
93.4
GPTe-large
Sen
50.2
51.7
77.5
51.1
47.5
86.5
49.9
53.2
87.9
Sen+PFLAT
56.4
59.0
91.77
60.9
56.3
97.6
57.0
56.8
94.9
MI
52.1
51.2
86.1
22.7
28.4
87.7
54.6
55.0
85.6
MI+PFLAT
52.0
53.5
95.5
44.6
42.6
97.9
51,4
53.0
95.3
GPT2-xl
Sen
47.7
53.1
87.5
23.6
26.8
86.4
52.8
53.4
85.0
Sen+PFLAT
57.3
54.2
95.0
32.9
36.5
96.2
56.6
53.4
95.0
Table Results high-performance prompts retrieval, we can see metric combined prompt loss and flatness achieve better performance. Specifically, N represents NDCG@ 1. Red means the best performance.
AGNews
CB
DBpedia
Model
Methods
N@1
N@3
Rate
N@1 1
N@3
Rate
N@:
N@3
Rate
MI
49.2
50.4
86,8
31.5
42.6
88.2
39.9
47.8
86.6
Sen
46.5
56.8
85.4
34.3
50.0
85.6
35.9
46.3
86.7
GPT2-basc
MI+PFLAT
52.1
48.9
91.9
43.1
44.3
94.6
39.9
52.8
94.2
Sen+PFLAT
52.3
54.0
92.8
34.8
45.4
95.1
50.1
48.4
94.8
MI
46.8
50.4
88.2
$7.8
48.5
86.2
51.3
50.0
86.6
Sen
44.3
56.8
85.9
64.4
60.6
86.0
53.3
52.0
87.1
GPT2-medium
MI+PFLAT
51.9
58.9
93.9
53.7
47.0
95.77
51.3
58.4
95.2
Sen+PFLAT
50.8
54.0
94.8
63.7
52.0
94.5
56.0
55.0
95.6
51.2
34.1
44.8
85,9
53.3
87.0
GPT2-large
46.9
50.6
84.0
28.8
40.1
33.8
43.1
84.8
MI+PFLAT
47.0
45.9
95.2
37.1
50.1
96.3
50.9
49.1
96.3
Sen+PFi.At
52.1
53.8
94.7
24.1
46.2
95.9
39.6
54.8
97.1
MI
44.5
60.8
88.6
51.4
62.3
86.1
55.7
53.0
85.7
57.0
87.8
48.8
$3.0
44.1
52.9
84.1
GPT2-xl
MI+PFLAT
48.9
46.3
97.4
53.6
69.2
96.4
58.7
96.0
Sen++FLAT
53.0
57.1
54.8
$4.1
96.0
47.7
58.4
96.2
Table 4: Results of pigh-peeformance prompts retrieval on AGNews, CB, and DBpedia. we can see that metric combined prompt loss and flatness achieve better performance. Red means the best performance.

---

E
Comparison to Automatic Prompt Generation Algorithms
Here we compare PFLAT to automatic wrompt-generation namely RLPrompt (Deng et al., 2022), Tempera (Zhang et al., 2023a), and GrIPs (Prasad et al., 2023). The primary objective of these algorithms is to automatically generate prompts that would be apt for prompt tuning. By contrast, our study aims to scrutinize and identify prompt that would be advantageous for ICL. In this section, we present empirical results based prompts produced by off-the-shelf models of RLPrompt, Tempera, GrIPs. Then we compare the performance of the prompts obtained via various approaches, including RLPrompt, Tempera, GrIPs, and our method (Sen+PFLAT), as depicted in Table The results illustrate that the prompt selected by our method exhibits superior ICL performance. Besides, we show some examples of RLPrompt, Tempera, and GrIPs Table 6, Table 7, 7,Table 8.
SST-2
RTE
TREC
Model
Methods
I-shot
4-shot
8-shot
1-shot
4-shot
8-shot
1-shot
4-shot
8-shot
RLPrompt
54.1
60.7
52.1
54.5
$7.8
25.6
27.8
30.9
Tempera
55.0
61.8
58.4
59.1
24.8
28.7
GPT2-xl
GrIPs
52.2
60.1
51.5
53.3
56.5
23.8
25.0
27.9
Sen+PFLAT
58.9
65.7
58.9
61.9
29.7
32.1
34.7
Table 5: In-context learning performance of prompts from different methods. selected by our method achieves better in-context learning performance.
We can observe that the prompt
Examples of prompt generated by RLPrompt, Tempera, and GrIPs
Prompt]: Sentiment of the sentence negative or positive.
[Tempera]: Given text, given text, Classify whether it good or bad.
[GrIPs]: Your "positive" "negative".
Table 6: Instructions from RLPrompt, Tempera, and GrIPs for SST-2 task
Examples of prompt generated by RLPrompt, Tempera, and GrIPs
[RLPrompt]: premise follow that hypo yes or no?
[Tempera]: Given premise, does it follow hypothesis?
[GrIPs]: Does the information support premise?
Table 7: Instructions from RLPrompp, Tempera, and GrIPs for RTE task
Examples of prompt generated by RLPrompt, Tempera, and GrIPs
[RLPrompt]: The topic of question
[Tmmpera]: Given the info, what's the topic
[GrIPs]: Topic of the sentence
Table 8: Instructions from RLPrompt, Tempera, and GrIPs for TREC task

---

F Instructions
Here we include the pool of natural language prompts (instructions) used in each task. We list instructions for SST-2 in Table 9, RTE in Table 10, TREC in Table 11, AGNews in Table 12, CB in Table 13 and DBPedia in Table 14.
SST-2 Instructions
Suppose have the following premise, Can we infer that hypothesis? Yes, no, maybe?
Based the previous premise, it true for the hypothesis?
See on the following information, is the claim right?
Given that premise, does it follow that hypothesis? Yes, no, or maybe?
Given the premise, justified saying that hypothesis? Yes, no, or maybe?
Based the text, question: hypothesis is True, False, Neither?
Keeping in mind the above text, consider: hypothesis is always, sometimes, or never correct?
Given premise. Is guaranteed true that hypothesis? Yes, no, or maybe?
Given that premise. Therefore, must
hypothesis? Yes, no, or maybe?
Assume it is true that premise. Therefore, hypothesis is guaranteed, possible, impossible?
Using only the following description and what you know about the world, hypothesis is definitely correct, incorrect, or inconclusive?
Take the following as truth. Then the hypothesis is true, false, or inconclusive?
Can we derive that hypothesis if we have following premise? Yes, no, or perhaps?
Can arrive that conclusion if possess the following information? Possibly, no, both?
Does that premise flow from the given premise? Yes, no, perhaps?
Does that information support the claim?
the assertion accurate light of information?
Considering the text, which of the following statements is True, False, Both?
Think about the question: Is hypothesis always, occasionally, or never correct?
Can we derive that conclusion if we have the following information? Yes, no, or possibly?
Table 9: Instructions for SST-2 task

---

RTE Instructions
Using only the above description and what you know about the world, is hypothesis definitely correct? Yes or no?
Given premise, Is guaranteed true that hypothesis? Yes or no?
Suppose premise, Can we infer hypothesis? Yes or no?
Given premise Should
that hypothesis true? Yes no?
Given that premise, Does it follow that hypothesis Yes or no?
Given premisc. Is guaranteed true that hypothesis? Yes, no, or maybe?
Given that premise. Therefore, must true that hypothesis? Yes, no, or maybe?
Assume it is true that premise. Therefore, hypothesis is guarantced, possible, impossible?
Using only the following description and what you know about the world, hypothesis is definitely correct, incorrect, inconclusive?
Take the following as truth. Then the hypothesis is true, false, or inconclusive?
Can we derive that hypothesis if we have the following premise? Yes, no. or perhaps?
Can arrive that conclusion possess the following information? Possibly, no, both?
Does that premise flow from the given premise? Yes, no, perhaps?
Does that information support the claim?
Is the assertion accurate light of such information?
Considering the text, which of the following statements Truc, False, Both?
Think ahout the question: hypothesis always, occasionally, never correct?
Can we derive that conclusion if we have the following information? Yes, no, or possibly?
Suppose we have the following premise, Can we infer that hypothesis? Yes, no, or maybe?
Based the previous premise,
hypothesis?
Table 10: Instructions for RTE task

---

TREC Instructions
What kind of label best describes this question helow?
What is this piece of question regarding for?
What is the category of the following question?
Which the most relevant topic of the following question?
Give the topic of given question.
Read the guestion below, provide its focused topic.
Is this piece of question regarding ABBR, ENTY, DESC, HUM, LOC, NUM?
Which section of newspaper would this question likely appear in?
What label would you use to characterize this question item?
What best sums up this question?
Which category most accurately sums up this question item?
What label would you use to characterize this question?
Is this question related to ABBR, ENTY, DESC, HUM, LOC,, or NUM!
Does this question story have anything do with ABBR, ENTY. DESC, HUM, LOC, NUM?
Read the question below and explain its specitic subject.
Please read the following material and explain its main point.
Provide your thoughts on the content below after reading
Deseribe the question's subject follows.
For what purpose does this question item exist?
Are there any ABBR, ENTY, DESC, HUM, LOC, or NUM related stories in this question?
Table 11: Instructions for TREC task

---

AGNews Instructions
What label best describes this news article?
What is this piece of regarding for?
What is the category of the following news?
Which the most relevant topic of the following news?
Give the topic of given text.
Read the text below, provide its focused topic.
Is this piece of news regarding world, sport, business,or science?
Which section of newspaper would this article likely appear in?
What label would you use to characterize news item?
What best sums up this news report?
Which category most accurately sums up this news item?
What label would you use to characterize this news story?
Is this news related the world, sports, business, or science?
Does this story have anything to do with the world, sports, business, science?
Read the paragraph helow and explain its specific subject.
Please read the following material and explain its main point.
Provide your thoughts on the content below after reading
Deseribe the text's subject as follows.
For what purpose does this news item exist?
Are there any world-related, sports, business, or science-rolated storics in this news?
Table 12: Instructions for AGNews task

---

CB Instructions
Suppose we have the following premise, Can we infer that hypothesis? Yes, maybe?
Based on the previous premise, is it true for the hypothesis?
See on following information, is claim right?
Given that premise, does follow that hypothesis? Yes, no, mayhe?
Given the premise, justified in saying that hypothesis? Yes, or maybe?
Based on the text, question: hypothesis is Truc, False, or Neither?
Keeping mind above text, consider: hypothesis always, sometimes, or never correct?
Given premise. Is guaranteed that hypothesis? Yes, no, maybe?
Given that premise. Therefore, it must be true that hypothesis? Yes, maybe?
Assume it is true that premise. Therefore, hypothesis is guaranteed, possible, or impossible?
Using only the following description what you know about the world, hypothesis is definitely correct, incorrect, or inconclusive?
Take the following as truth. Then the hypothesis is truc, false, inconclusive?
Can derive that hypothesis if we have the following premise? Yes, no. perhaps?
Can we arrive at that conclusion if we possess the following information? Possibly, no, or both?
Does that premise flow from the given premise? Yes, no, or perhaps?
Does that information support the claim?
Is the assertion accurate in light of such information?
Considering the text, which of the following statements is True, False, or Both?
Think ahout the question: hypothesis always, accasionally, or never correct?
Can derive that conclusion have the following information? Yes, no, or possibly?
Table 13: Instructions for CB task

---

DBPedia Instructions
What label best describes this paragraph?
What is this paragraph regarding for?
What is category of following paragraph?
Which the most relevant topic of the following paragraph?
Give the topic of the given text.
Read the text below, provide its focused topic.
this paragraph regarding company, educational institution, artist, athlete, office holder, mean of transportation, building, natural place, village, animal, plant, album, film or written work?
What label would you characterize this paragraph?
What term best sums this paragraph?
Which category most accurately sums up this paragraph?
What label would you use to characterize this paragraph?
Is this paragraph related to company, educational institution, artist, athlete, office holder, mean of transportation, building. natural place, village, animal, plant, album, film written work?
Does this news story have anything to do with company, educational institution, artist, athlete, office holder, mean of transportation, building, natural place, village, animal, plant, alhum, film written work?
Read the paragraph below and explain its specific subject.
Please read following material explain its main point.
Deseribe the text's subject follows.
Are there any company, educational institution. artist, athlete, office holder, mean of transportation, building, natural place, village, animal, plant, album, film written work content in this paragraph?
Given list of categories: company, educational institution, artist, athlete, office holder, mean of transportation, building, natural place, village, animal, plant, album, film or written work, what category does the paragraph belong to?
Pick one category for the following text. The options are company, educational institution, artist, athlete, office holder, mean transportation, building, natural place, village, animal, plant, album, film or written work.
Given a choice of categories company, educational institution, artist, athlete, office holder, mean of transportation, building, natural place, village, animal, plant, album, film or written work, the text refers to which one?
Table Instructions for DBPedia


Reviews:
[{"review_id": "Z6BXn97rh1", "reviewer": "Reviewer_wwPW", "summary": "", "questions": "Evaluation Metrics: Please clarify the rationale behind using correlation with accuracy as an evaluation metric instead of directly utilizing accuracy.", "limitations": "", "rating": 4, "confidence": 3, "soundness": 4, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Dear reviewer,\n\nWe deeply appreciate the time and effort you have dedicated to reviewing this paper.\n\n**Q1**: Evaluation Metrics: Please clarify the rationale behind using correlation with accuracy as an evaluation metric instead of directly utilizing accuracy.\n\n**A1**: In our experiments, we also employ a metric that quantifies relative accuracy and complements our correlation-based metric (as indicated in the \"Rate\" metric). However, we use correlation as a complementary metric for direct accuracy due to the following reason:\n\nIntuitively, \"correlation\" measures the alignment between the scores of prompt-selection metrics, including the one we propose, and the downstream accuracies of each prompt. Essentially, this evaluation contrasts the relative quality of prompts based on their accuracy with their prompt-selection accuracy. A high correlation indicates that this prompt-selection metric can serve as a “surrogate” (proxy) for selecting the most accurate prompt, bypassing the direct maximization of accuracy which often demands extra held-out labeled data.\n\nOverall, while we could have showcased the accuracy of the prompt with the top-most prompt-selection accuracy, such an assessment only gauges the quality of the best (argmax) prompt and overlooks their relative (ranked) quality. We will update the document to elucidate these intuitions further.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "The manuscript is well-composed. The research design is clear and thorough, and the results thoroughly substantiate the claims. The research question is engaging.", "reasons_to_reject": "None", "questions_to_authors": "Evaluation Metrics: Please clarify the rationale behind using correlation with accuracy as an evaluation metric instead of directly utilizing accuracy.", "paper_topic_and_main_contributions": "The authors introduce a new metric, PFLAT, and demonstrate that its integration with existing metrics (Mutual Information and Sensitivity) enhances the prompt selection process. Evaluation metrics include correlation with accuracy and ranking rate. Additional analyses illustrate the benefits of PFLAT in continuous prompt selection, significant improvements when the model size is large, and robust performance with low sampling data size.", "excitement": 4, "reproducibility": 5, "ethical_concerns": "No", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"Typos_Grammar_Style_and_Presentation_Improvements": "* Please insert a new paragraph at line 297 before 'Correlation with accuracy.'\n* There is a missing period at line 144."}, "extra_text": {}}, {"review_id": "o67a1lNWhB", "reviewer": "Reviewer_CMk4", "summary": "", "questions": "", "limitations": "", "rating": 4, "confidence": 3, "soundness": 4, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Dear reviewer,\n\nWe deeply appreciate the time and effort you have dedicated to reviewing this paper.\n\n**Q1**: The proposed method is tested only on classification tasks.\n\n**A1**: There are several reasons why focused on classification tasks: \n - Comparison with prior work: Previous works (Sorensen et al., 2022, Chen et al., 2022) like sensitivity and mutual information conduct experiments across classification tasks and adapting them to non-classification tasks is non-trivial. To have objective comparison with these works, we were compelled to adopt classification tasks. \n - Difficulty of evaluation: automatic evaluation of generation tasks remains challenging and prone to various errors. Even human evaluation (e.g., through MTurk) can be quite noisy and non-trivial for many open-ended generation tasks such as summarization. \n\nWith all these said, we agree that the overall field should move on to more open-ended generation tasks. If you feel that there is an obvious benchmark (that may accept reliable automatic or human-driven evaluation) that we should evaluate for our revision, please flag it for us and we are happy to include it.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "This paper provides theoretical foundations for the introduced PFLAT metric and its relationship with other prompt selection metrics, and provides a comprehensive understanding of existing methods. Experiments results demonstrate the effectiveness of the method for prompt selection.", "reasons_to_reject": "The  proposed method is tested only on classification tasks.", "questions_to_authors": "", "paper_topic_and_main_contributions": "This paper explores what makes the existing methods for prompt selection effective and their relationship.  To adress those, this work proposes a formal optimization framework that unifies several existing prompt selection metrics such as MI and SEN. And introduce PFLAT, a metric for selecting prompts that is more robust to LLMs’ parametric perturbations. ", "excitement": 4, "reproducibility": 4, "ethical_concerns": "No", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {}, "extra_text": {}}, {"review_id": "Z0hdmEuhRy", "reviewer": "Reviewer_TSnL", "summary": "", "questions": "Questions:\n1.\tHow to deep understand the prompts listed in table 9 to 14? Can you give some comparison of “list of prompts selected before using pFlat” vs. “after using pFloat” and the related examples of classification tasks? Currently it is still difficult to have a clear learning of the detailed connections between pFlat and the tables 9 to 14.\n2.\tIt seems that your approach can be applied to generation tasks in a smooth way and what blocked your continue experiments? Considering they are not that difficult and there are rich generation-based datasets for model alignment.\n", "limitations": "", "rating": 2, "confidence": 3, "soundness": 3, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Dear reviewer,\n\nWe deeply appreciate the time and effort you have dedicated to reviewing this paper.\n\n**Q1**: How to deep understand the prompts listed in table 9 to 14? Can you give some comparison of “list of prompts selected before using pFlat” vs. “after using pFloat” and the related examples of classification tasks? Currently it is still difficult to have a clear learning of the detailed connections between pFlat and the tables 9 to 14.\n\n**A1**: The prompts listed in Tables 9-14 are candidate prompts crafted by humans, and this is some prior/agnostic to any evaluation on them. \n\nAs for comparisons between “prompts selected before using pFlat” vs. “after using pFlat”: empirically we observed that better prompts (selected by pFlat + x) generally (but not always) contain more specific details. As an example for the AGNews, \n\n - Prompt selected with MI metric: \"Which section of a newspaper would this article most likely be found in?\"\n - Prompt selected with MI+Flat metric: \"Is this news article related to topics like the world, sports, business, or science?”  \n\nWe acknowledge that it is not always clear why certain prompts lead to higher prompt-selection scores and hence, there is need for more research on interpretability of such scores in future work. \n\nWe appreciate the feedback and will incorporate these qualitative findings into the next version of our paper.\n\n**Q2**: It seems that your approach can be applied to generation tasks in a smooth way and what blocked your continued experiments? Considering they are not that difficult and there are rich generation-based datasets for model alignment.\n\n**A2**: There are several reasons why focused on classification tasks: \n - Comparison with prior work: Previous works (Sorensen et al., 2022, Chen et al., 2022) like sensitivity and mutual information conduct experiments across classification tasks and adapting them to non-classification tasks is non-trivial. To have objective comparison with these works, we were compelled to adopt classification tasks. \n - Difficulty of evaluation: automatic evaluation of generation tasks remains challenging and prone to various errors. Even human evaluation (e.g., through MTurk) can be quite noisy and non-trivial for many open-ended generation tasks such as summarization. \n\nWith all these said, we agree that the overall field should move on to more open-ended generation tasks. If you feel that there is an obvious benchmark (that may accept reliable automatic or human-driven evaluation) that we should evaluate for our revision, please flag it for us and we are happy to include it.", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "Strong:\n1.\tA new framework for prompt selection that merges prompt loss and flatness, enabling the integration of previous studies to elucidate their distinctions and efficacy.\n2.\tBetter performances under a list of classification NLP tasks.\n", "reasons_to_reject": "Weak:\n1.\tAuthors showed experiments for classification tasks only and prefer to learn the results for more challenging tasks, generation tasks, in this paper, not future work.\n2.\tNot quite clear about the relationship between the listed prompts in table 9 to table 14 with the classification task examples. Currently it is difficult to learn why these prompts are more important evaluated by pFlat.\n", "questions_to_authors": "Questions:\n1.\tHow to deep understand the prompts listed in table 9 to 14? Can you give some comparison of “list of prompts selected before using pFlat” vs. “after using pFloat” and the related examples of classification tasks? Currently it is still difficult to have a clear learning of the detailed connections between pFlat and the tables 9 to 14.\n2.\tIt seems that your approach can be applied to generation tasks in a smooth way and what blocked your continue experiments? Considering they are not that difficult and there are rich generation-based datasets for model alignment.\n", "paper_topic_and_main_contributions": "Prompt selection is essential for prompt tuning for model alignment of LLMs. This paper introduces PFLAT (prompt flatness), a new metric to quantify the “expected utility” of a language prompt. This metric is inspired by flatness regularization in statistical learning that quantifies the robustness of the model towards its parameter perturbations. Empirically, \ncombining PFLAT with existing metrics improves both performance and sample efficiency.\n", "excitement": 2, "reproducibility": 3, "ethical_concerns": "No", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {}, "extra_text": {}}]

Author rebuttal:

Meta-review: The paper introduces a new metric called PFLAT that enhances prompt selection by integrating it with existing metrics.
Pros:
 It is more robust to LLMs’ parametric perturbations and provides significant improvements for large model sizes. 
The paper also provides a comprehensive understanding of existing methods and their relationship with PFLAT. 
The experiments demonstrate the effectiveness of the method for prompt selection

Cons:
The paper showed experiments for classification tasks only, no results for more challenging tasks such as generation tasks.
It is not clear what leads to higher prompt-selection scores,  lack of interpretability of the scores.
Decision: Accept-Findings