Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learning
Authors: Xiang Chen
Lei Li
Ningyu Zhang
Xiaozhuan Liang
Shumin Deng
Chuanqi Tan
Fei Huang
Luo Si
Huajun Chen
Venue: NeurIPS 2022 Accept (2022)
Keywords: language model
retrieval
prompt-tuning
memorization

Abstract: Prompt learning approaches have made waves in natural language processing by inducing better few-shot performance while they still follow a parametric-based learning paradigm; the oblivion and rote memorization problems in learning may encounter unstable generalization issues. Specifically, vanilla prompt learning may struggle to utilize atypical instances by rote during fully-supervised training or overfit shallow patterns with low-shot data. To alleviate such limitations, we develop RetroPrompt with the motivation of decoupling knowledge from memorization to help the model strike a balance between generalization and memorization. In contrast with vanilla prompt learning, RetroPrompt constructs an open-book knowledge-store from training instances and implements a retrieval mechanism during the process of input, training and inference, thus equipping the model with the ability to retrieve related contexts from the training corpus as cues for enhancement. Extensive experiments demonstrate that RetroPrompt can obtain better performance in both few-shot and zero-shot settings. Besides, we further illustrate that our proposed RetroPrompt can yield better generalization abilities with new datasets. Detailed analysis of memorization indeed reveals RetroPrompt can reduce the reliance of language models on memorization; thus, improving generalization for downstream tasks. Code is available in https://github.com/zjunlp/PromptKG/tree/main/research/RetroPrompt.

Decoupling Knowledge from Memorization: Retrieval-augmented Prompt Learning
Xiang Chen 12 Lei 1 Ningyu Zhang 1.21, Xiaozhuan Liang!. 1.2, Shumin Deng 1.2,
Chuanqi Tan Fei Huang", Luo Si², Huajun Chen
Zhejiang University & AZFT Joint Lab for Knowledge Engine, China
Hangzhou Innovation Center, Zhejiang University, China
AAlibaba Group, China
{ (xiang_chen, leili21, zhangningyu, liangxiaozhuan, 23 sm, huajunsir) (zaiirr)jjeec.e @zju.edu.cn, {chuanqi.tcq, f.huang, luo.si si} @alibaba-inc.com
Abstract
Prompt learning approaches have made waves in natural language processing by inducing better few-shot performance while they still follow parametric-baset learning paradigm; the oblivion and rote memorization problems in learning may encounter unstable generalization issues. Specifically, vanilla prompt learning may struggle to utilize atypical instances by rote during fully-supervised training or over- fit shallow patterns with low-shot data. To alleviate such limitations, we develop RETROPROME with the motivation of decoupling knowledge from memorization to help the model strike balance between generalization and memorization. contrast with vanilla prompt learning, RETROPROMPT constructs open-book knowledge-store from training instances and implements retrieval mechanism during the process of imput, training and inference, thus equipping the model with the ability to retrieve related contexts from the training corpus as cues for enhance- ment. Extensive experiments demonstrate that RETROPROMPT performance in both few-shot and zero-shot settings. Besides, we further illustrate that our proposed RETROPROMPT can yield better generalization abilities with new datasets. Detailed analysis of memorization indeed reveals RETROPROMPT can reduce the reliance of language models on memorization; thus, improving generalization for downstream task.
obtain better
Introduction
Large parametric language models 7 22
have achieved dramatic empirical success in natural language processing (NLP). Notably, pre-trained language models (PLMs) have learned substantial amount of in-depth knowledge from data, and have archived tremendous promise in few-shot/zero-shot learning ability with the natural language prompts [12] 50, (77) However, Recent
studies 37 39 59 observe that prompt learning with PLMs usually generalizes unstably in an
extremely low-resource setting or emerging domains. One potential reason is that, it is non-trivial for parametric models to learn rare or hard patterns well with rote memorization, thus, resulting in inefficient generalizable performance.
Intuitively, we regard the whole training current training- test procedure of prompt learning (based on batch data training) can be viewed as
book and the test phase the examination, the
Equal contribution.
Corresponding Author. Code available
RetroF rompt
36th Conference on Neural Information Processing Systems (NcurIPS 2022).

---

aage-by-page memorization and closed-bon book examination 42 During training, vanilla prompt learning may struggle memorize atypical instances in fully-sueervised setting or overfit shallow patterns with low-shot data 62 9
Specifically, recent studies [0] [1] have proposed a long- tail theory, which notes that when the training set has long-tail distribution and contain small "sub- polpplatptiios" with atypical instances, then PLMs indeed predict on the test data through rote memorizing these atypical instances rather than learning the common patterns [62 56).
The limitations of rote memorization remind us of the human learning process of "learn by analogy" and the proverb that "the palest ink is better than the best memory". Note that humans can perform associative learning to recall relevant skills in deep memories for reinforeing each other, thus, owning the extraordinary abilities to solve few-shot and zero-shot tasks. Motivated by these, we endeavor to improve the generalization ability of prompt learning with retrieval and association. Our intuition is that the difficulty of resolving the above limitations can be substantially alleviated if we can decouple the knowledge from memorization by constructing an open-hook knowledge-ste from the training data; thus, referring to related knowledge could provide a strong enhancement signal to help the model strike a balance between generalization and memorization.
Specifically, we introduce a novel retrieval- augmented framework based on prompt learning (ETROPPROPP)) as shown Figure 1 The open-book knowledge store (K, V). defined as the set of key: prompt- based example embeddings and value: cor- responding label words constructed from the training data, are served as additional references for the model to decouple knowl- edge from pure memorization to some ex- tent. Specifically, to integrate retrieved Figure I: Decoupling knowledge from memorization. knowledge into the input, Firstly, we de-
Book!
Momorication Generalization
Rook!
Demomiration
RNN Guided Traising
Decoupling Knowledge
Open bhok
negative
KNN Incorporated Prediction
sign to incorporate neural demonstrations into the input sequences as in-context augmentation, where the demonstration is retrieved from the knowledge-store Then, apply non non-parametric algorithm KNN over the input query and knowledge store, and regard ANN results as an indication of casy vs. hard instances. Moreover, automatically force the model emphasize the hard instances identified by KNN by assigning scaling during training. Lastly, the &NN results are further employed at the output of the PLM head participate in masked prediction. The model conducts inference through linearly interpolating the non-parametric nearest neighbor distribution with the output of prompt learning, which regards the Top-k nearest reference instances as cues from (K., V7).
The considerable performance gains on nine tasks few-shot and zero-shot settings demonstrate that systemic retrieval mechanism helps the model generalize better with scarce data. Experiments in the supey-suee setting with long-tail distribution illustrate that our RETROPROMPT can deal with atypical instances more robustly. We further adopt self-influence 27 our memorization scoring function to analyze the memorization process between fine-tuning, prompt learning and our RETROPROMPT. The final analysis results show that 1) the training samples having the highest memorization scores are mostly atypical, 2) RETROPROMPT generalize better than fine-tuning and convention prompt-tuning with decoupling knowledge from memorization to alleviate the rote of PLMs. In a nutshell, our work may open up new avenues to improve the generalization of prompting PLMs by decoupling knowledge from memorization.
2 Preliminaries of Prompt Learning
Assuming that M, T respectively denotes the PLM and the template function for prompt tuning. Formally, the text classification task takes a query sentence classify it into the label y E y. While prompt learning converts the task into a MLM problem with cloze-style objectives. Specifically, the template function T inserts text pieces into x as t = =<x)) where á refers to the input of M with [MASK] token. For instances, when we have to classify the text x ='The movie makes absolutely no sense." into label NEGATIVE (labeled as 0) or POSITIVE (labeled as 1), we wrap it into
(Zo.Z1. Zi.... F.,) as input. Then,
a [CLS] ] x It was [MASK] [SEP]
(I)

---

Profetioo
Apangaaien
Norndiaiic
Seairity
Naree
NEGATIVE
tomile
Opens-oook
Vortlloo
82
at
korrible
Knowloder
lomiill
groat
Key
2NN Incarperatee ated Prodiciion
Counth (Paaan
Retriese ANN
ruppa
ferrible
Gunded Trainine
prosph-tood HMM
grour
Querry
Updatd
Head
reltesh Ø
Transfommer Layers
Transformer Layers
stale P
Natriove Nerual Dernonuration
Demotstration
[CLS] [The The movie scase. It [HASK] [SRP]]
[CLo]]he TThe mone. scnse. MAGE [KASK]] 18BP)
Original input -1 Template -|
Original inpul - |- Template -
aegievall-ugmmenned prompt learning
b. Creation and refresh of open-book knowledge
Figure 2: Overview of RETROPROMPT. Note that e(.) denotes word embedding function in the PLM M, while "M", "t" and "g" in E(+) specifically refers "[MASK]". "terrible" and "great".
The verbalizer f: y + V is defined as a mapping from the label space y to those words in the vocabulary, which constructs the label word set V. The base component of M produces the sequence representation over á, and we choose the hidden vector at the [MASK] position as the contextual representation h2 Rd. where d is the dimension of hidden states. Then the MLM head of M can operate on h& to calculate each word v's probability in the vocabulary being filled in [MASK] PM [MMSK] v r( We let Vy to represent the subset of V which is connected with unique label Vy = V. Finally, the probability distribution over the label is calculated as:
P(y|z)=a (PM (M E V/y),
where g refers to the function converting the probability of label words the probability of classes.
3 RETROPROMPTT Retrieval-augmenter Prompt Learning
We introduce a simple and general retrieval-augmentedd framework for prompt learning, named RETROPROMPT, whose basis the dense retriever ($3.1) with open-book knowledge-store to decouple knowledge from memorization. As shown in Figure RETROPROMPT consists of three components: retrieval of neural demonstration for enhancing input (33.2). the &NN guided training ($3.3) and the &NN-based probability for cloze-style prediction ($3.4).
3.1 Dense Retriever
Open-book Knowledge-store The first step of our proposed framework is to build knowledge- store for retrieval that can decouple from memorization and captures the semantics of the instance from the training set C. Specifically, we leverage the encoder to embed instance representation over the C to construct the knowledge-store. Given the i-th example (c,, y:) in the training data key-value pair (hay, v2), in which é; = T(c.), he, E Rdd is the embedding of
C, we obtain the [MASK] token in the last layer of the PLM, and v; f(yi) denotes the label word of the i-th example. Compared with KNN-LM (26] that constructing with sliding generative corpus and tokens, knowledge-store is more suitable for prompt learning. We store all pairs (he, v) in a key-value datastore (XC, V) where he serves as key and v as value as follows:
(K,, V) = {ha, v:) (c,, E C)
(3)
The knowledge-store maye be flexible to edit, add or delete any instances and can be asynchronously updated during the training procedure. Note that our knowledge-stoee is constructed from few-shot trainsets in the corresponding few-shot settings rather than the whole available training data.
Efficient Searching Considering that the size of the training data C can be enormous, we must ensure an efficient retrieval process. As shown in the above creation of open-book knowledge-store,

---

we can build the matrix D E Rlc as the index of training examples. Given query set Q, we first encode each query example with template mapping function T-) get a set of prompt-based query vectors hig for retrieval augmentation on the fly. Then, we utilize query vectors to search for the closest examples over the index D via maximum inner product search (MIPS). For the retrieval process, we choose FAISS [2] to query the open-book knowledge-store efficiently. FAISS is an excellent open-sourced toolkit for fast nearest neighbor retrieval.
Asynchronous Refresh of the Knowledge-store Since the neural demonstration may lead to the variable contextual representation of instance as the parameters of the PLM are continually updated, we thus propose to "refresh" the index of retrieval by asynchronously re-embedding and re-indexing all embeddings in an open-book knowledge-ston every j training epochs In $ 4.6 we empirically demonstrate that this procedure results in performance improvement.
3.2 Retrieval of Neural Demonstration
To enhance the PLMs with the ability to learn by analogy through the knowledge-store, we further propose neural demonstrations that can be concatenated with input instance at the embedding layer to improve the generalization ability of our RETROPROMPT. For the 1-th query instance qt we first utilize prompt-based representation hgg to query the cached representations of open-book knowledge-
store. Then we retrieve m nearest neighbors {fc]") Cm }. ...,. (c|t) ...., Cm }} ( of qe for each (1)
class, where the superscript L denotes the total number of the classes and the c, is retrieved the i-th nearest neighbor in the 1-th class, After the model retrieves the Top-m candidates for each class,
(1) their corresponding representation ftg, and label word (!) from knowledge-store will be incorporated (1) into the encoder to act as demonstration learning. Since the hgg is already vector, we intuitively
aggregate the m neighbor vectors for each class according to their similarity and incorporate the demonstration into the input representation of & after the word embedding layer of the M as follows:
I e(t) +1
Σ a E 1e
o 01 Σ oi
I (L)
(4)
2 00
iE(lom)
sE(1mm)
where e(-) represents the word embedding layer of M, ① denotes the concatenation of input se- quences, a: (1) is the softmax score for the i-th retrieval belonging I-th class label to denote their relevance with q, and I is the sequence features for inputting the next layer of PL.. As shown in the above equation, we encode demonstration representation with the weighted sum of the retrieval representation. Thus, retrieval scores are directly used in the final representation, making the frame- work differentiable. To this end, we denote this style of demonstration as neural demonstration, significantly different from prior work of discrete demonstration [12].
Neural vs. Discrete Demonstration Compared with prior discrete demonstrations described in [12 35
49 28,, retrieving weighted neural demonstrations from the knowledge-store to augment prompt learning has advantages in the following three major aspects: (1) neural demonstrations could be more tolerant of the model's 's maximum input length than discrete demonstrations, while the discrete demonstration is usually not suitable for multi-class classification tasks due to the limitation of input length, such as relation extraction, etc. (2) the model needs to deal with large retrieval tokens for discrete demonstration, making it time-consuming and computationally intensive to perform cross-attention operations due to the quadratic attention complexity. In contrast, dealing with much shorter instance representations as neural demonstrations unleashes the potential of cross-attention and accelerates the inference. (3) when sampling examples based on the similarity between instances, our cloze-style contextual representation more informative and consistent than the contextual representation from [CLS] ] of Sentence-BEr BERT [7] (adopted in LM-BFF).
3.3 Retrieve ANN for Guiding Training
Eager learners (e.g., PLMs) are optimized to learn a global function that maps from the text to semantic label space. Lazy learners such as k-nearest neighbor classifiers, on the contrary, aims to
'Specifically, refresh the knowledge-store for each epoch in experiments.

---

approximating the neighborhoods around those test examples 22. Since KNN can easily predict for each encountered query instance based on pre-trained representation without an extra classifier, is intuitively to leverage the kNNNs classification results as the prior external knowledge to guide the PLMM' parameters attending to hard examples (hard samples usually refer to atypical samples) during the training process (also referred as &NN-train for the abbreviation). Particularly, our intuition is to differentiate between easy and hard examples according to the prediction of KNN, Given the f-th query instance q:, we leverage the fgg querying the open-book knowledge-store (K,, V) to retrieve the k-nearest neighbors N of qt according to a similarity function d(.,)) :), where :((:-) typically adopt the inner product similarity. Then, compute the distribution over neighbors according to the softmax of their similarities and aggregate probability mass for each label word across its occurrences in the retrieved targets:
PANK (y q:)
Σ 1y=v. exp (d (ha. ha;))
(5)
(eL-B)JEN
Given the probability PANN of the query instance q: being predicted as the gold class (also as the probability value of the gold class in the PaNN), we propose to retrieve the KNN for guiding the training process of prompt learning. The kNN guider reweights the cross-entropy loss Log by adjusting the relative loss for the correctly-llassffie or misclassified instances identified by ANN, respectively. Specifically, we apply the negative oog-likeldhoo as the modulating factor FPANN)) The final loss L is defined as:
F(ANNN) = - log (PENN), C= (1 + (FFNNN))) LoE,
(6)
where 3 denotes scalar determine the proportion of each loss term. Note that PaNN is computed using the leave-one-out distribution on the training set due to the fact that each example in the training set cannot retrieve itself. The motivation of modulating factor is inspired by Focal-loss (34), while we focus on exploit leveraging k-NN's results for calibrating the training of LMs.
3.4 NNN based probability for Cloze-style Prediction
Apart from the neural demonstration on the input side and kNN guided training process (also referred as &NN-test for the abbreviation), we further present &NN based probability for Cloze-style prediction on the inference process, providing the PLM ability retrieve nearest neighbors for decisions rather
than making predictions only based on memorized parameters. Given the non-parametric k nearest
neighbor distribution PeNN of the query instance qe being predicted as y. we follow [13] 26 16]
to reformulate the Ply q:) by interpolating the PANN with the already-trained base PLM's MLM prediction PM using parameter À to produce the final probability of the label:
P(y q.) = AP q:) + (1 - A)g (PM( [MASK] elT()))))
Different from ANN-LM [26] that mainly retrieve tokens to augment the language modeling, we focus on leveraging prompt-base -bsed kNN's distribution for reference at test time, which can unlock the model prediction process as an open-book examination for prompt learning.
4
Experiments
4.1 Datasets and Baselines
Datasets We evaluate RETROPROMPT several types of natural language understanding tasks, including single sentence classification tasks (SST-2 [54), MR 43), and CR [19) and sentence pair classification tasks (MNLI (58), QNLI [46], and Q To further evaluate the effectiveness of the proposed approach with multi-class classification, we also conduct experiments on the information extraction tasks, including NERD [ SemEval 2010 Task 8 (SemEval) 17.. and TACRED 61]. The detailed statistics of the datasets are shown Appendix A.
Baselines We compare with LM-BFF [12] for single sentence and sentence pair classification tasks and adopt SOTA prompt learning model KnowPrompt (6] as the baseline for information extraction tasks. Note that the discrete demonstration method cannot be applied to multi-class classification tasks due to the input length limitations; thus, we leave out the experimental table about the results of KnPr (D-demo). We also compare our RETROPROMPT with the coowledgeennaanee prompt learning
httpps:/ ://ww/..wwww//// quora.
5

---

Table 1: Results across 9 NLU datasets in the few-shot and zero-shot setting. We report mean (and standard deviation) results over five different few-shot splits. "D-demo" refers to discrete demonstration, and "KnPr" is the abbreviation of KnowPrompt. LOTClass [4]] is the SOTA model in unsupervised text classification with self-training. f donates the model uses extra knowledge and means they train the PLM on the whole unlabeled trainset, while we and the other baselines only leverage the vanilla PLM to test without training. The average scores with * denote that we reuse the results of the "non-demo" version of the related model to fill in the default values.
Stagle Sentence
Seutenee
Information Extraction
Model
SST-2
MNLI (202)
QNLi
QQP (F1)
Model
FewN
SemEvaal (002)
TACRED
Avg.
(ace)
(800)
(9co)
(002)
(802)
(F1)
FT
os
75.8 (13)
45.8
60.2 as3)
FT
52.7
66.1 a1))
2..
60.6
LM-BFF (man)
am
90.3 :1:1
64.3
64.6e:
654
KnPt
6m.3
80,9 cm
33.2
71.4
16
L.-RFF (Dedemo)
91
66.6
90.2.1
64.8.
60.2
68.3
KuPr (Dadomo)
72.2
KPT
903
86.8
88.8
61.5
71.6
KPT
65.9
78.8
32.8
70,9
Ours
$1.5
60.
66.4 :111
35
54.
42.8
02.7
ct
0.
LM BET (man)
90.7 ws
89.9 11:1
21.0
61.1 km
48.0.c)
Knft
(2
58.1
28.8
62.8
LM-BFF (D-demo)
90.2 1.5
a5.5
89.7 1M
56.1
KnPt (D-demo)
65.1'
KPT
882
(3.4
87.2
53.7
59.2 g.n
54.9
KPTT
28.8
57.2 (3))
27.5 (22)
03.3
Ours
91.5
87.4
91.4
67.6..
62.2
66.1 (40
Ours
61.9
59,2
32.1
67.6
1.OTClas
71.8
81.7
50.1
50.4
36.5
55.0
LOTCaau
11.5
2.5
41.1
FT
29.1
50.0
49.8
34.4
49.5
31,5
PT
10.0
6.2
0.5
31.2
LM- BET (man)
83.5
80.3
78.4
49.7
50.5
49.7
KnPt
15.9
10.3
2.3
46.7
LM-BPF (D>demo)
82.9
30.7
$1.4
52.2
53.5
46.0
KnPr (D-demo)
47.0"
KPT
78.4
81.9
71.4
37.1
55.3
47.5
KPT 1
24.6
11.6
0.8
45.7
Ours
86.8
79.7
53.7
56.2
56.7
41.3
12.2
2,8
52.5
method KPT 20 since KPT leverages the external knowledge base for enhancing prompt learning while we focus on utilizing internal trainsets as a knowledge-stone You can refer to Appendix B for the detailed introduction of baseline methods.
4.2 Evaluation protocols and details
The experiments are implemented on NVIDIA V100 and utilize Pytorch 44 as the base library. We adopt RoBERTanage (38 the PLM and employ AdamW as the optimizer for all experiments. To mitigate the influence of diverse templates, we conduct baselines and RETROPROMPT with the same templates for each dataset. We list the specific experimental settings and tuning retrieve parameters in Appendix C and D. As for sew-shot and zero-shot experiments, we leverage different settings, respectively.
Few-shot Setting, We follow the few-shot setting LM-BFF to conduct 4-shot and 16-shot experiments and evaluate the average performance with a fixed set of seeds, Sweed, across several differ- ent sampled Durai for each task. Note that our knowledge-store is constructed with the few-shot training set in this setting.
97.5
FT
KPT Oun
96.0
LMBBFiskeo Kassponppi
Performnnca
93.0-
Zero-shot Setting 6 We leverage vanilla RoBERTauage for all base- lines (except LOTClass (41) to directly inference on the test set. To take advantage of retrieval mechanism, RETROPROMPH follows LOTClass [41] to utilize unlabeled trainsets for retrieval. Specifi- cally, we take the vanilla RoBERTaaage to tag the pseudo labels on unlabeled trainset and create the open-book knowledge-stooe -etor-ettrree with the unlabeled trainsets and pseudo labels. Lastly, RETROPROMPT make predictions on the test set based on the constructed datastore without tuning any of the model parameters.
91.5
88.5
87.0
SS1:2
QNLI
SEMEVAL
Figure 3:
Performance on fully-supervised datasets.
4.3 Experimental Results
Few-shot Results. As shown in Table I we find RETROPROMPT consistently outperforms baseline method LM-BFF and KnowPrompt, both in 4-shot and 16-shot experiments. Especially for informa- tion extraction tasks with multiple classes, discrete demonstrations cannot be applied to the input due to the limited input sequence length, while our neural demonstration can also work and achieves
NNte that it is not strict zero-shot sense.

---

improvement on these multi-class datasets. Moreover, RETROPROMPT obtain better performance compared with KPT. Compared with KPT with external knowledge, we only focus on referencing the internal few-shot trainsets without visiting the external knowledge base. Besides, we observe that RETROPROMPT has a relatively lower standard deviation than the baselines. The reason may lie that the retrieval mechanism can compensate for instabilities in parametric predictions.
Zero-shot Results. From Table [ also ob- serve that RETROPROMPT achieves improvements in the zero-shot setting. Another notable point that RETROPROMPT performs even better than KPT in the zero-shot setting, revealing that exploring own data to decouple knowledge from memorization has more potential than leveraging external knowledge. More- over, we achieve superior performance to LOTClass even though we utilize the vanilla RoBERTan Stange with- out any training.
Table 2: Results of model generalization to domains.
Model
Source 16-4hot MR
Targel Domain
SST-2
CR
FT
76.9
71.4
64.7
LM-BFF (mann
86.9
LM-BFF (D (D-demo)
86.6
89.3
87.5
KPT
86.8
86.8
86.7
RETROPROMPT
16-shot QQP
MRPC
RTE
Fully-supervised Results. As shown in Figure the experiments in fully-supervised settings with long-tail distribution illustrate that RETROPROMPT achieves improvement compared with baselines. This indicates that our retrieval mechanism extends the LM's ability to learn hard examples in the fully- supervised datasets.
FT LM-BFF (man)
60.7
43.7
48.0
65.4
20.9
65.5
LM-BFF (D-demo)
68.2
38.8
66.2
KPT
71.6
42,3
65.8
RETROPROMPT
74,0
49.4
67.3
4.4
Model Generalization to New Domains
The scarce data may bring the overfitting problem for the lots of memory parameters of PLMs, even though prompt learning. Thus, we conduct cross-domain experiments validate the generalization of our RETROPROMPT. Specifically, we utilize the model trained on the source datasets and directly test the other target datasets. From Table 2 can find that method consistently outperforms baselines. This finding illustrates that RETROPROMPT achieves great model generalization to new domains.
4.5 Analysis of Memorization
necessary and interesting to further explore the memorization mechanism to help us better understand the utility of retrieval for memorization in NLP.
Definition of Memorization Measurement. Inspired by the idea of [10 in the computer vision area, we define memorization measures as to how the classification varies when a training instance z
deleted from the trainset. We follow [27 62 to define and derive the memorization score for
training instance as follows:
Saetute del d.p(yla; 0
dog.-s =
=-V --Vo(lyl:; 0)T
- VoP(y) HH VVo(V ())(( 0).
dc
dg
<=
<=0
(8)
where fz.-z denotes the parameters trained with the instance z deightee by E. i refers the parameters of the model trained with all instances and H3 n. Σ ViLCzz 0). Thus Saelate refers to the amount of change of P (c;; 0) when the instance z is down-weighted by
Top-memorizer Instances: Typical or Atypical? Since the SST-2 dataset provides the annotations of phrase-level sentiment polarity labels, adopt SST-2 to analyze the memorization by judging the atypical of an instance by checking the percentage of positive phrases. We achieve such statistics from SST-2 and observe that typical positive instance has relatively high percentage of positive phrases, and a typical negative instance should have a relatively low percentage of positive phrases. Based the above observation, we apply the memorization score defined in Eq. to select Top- 10% and Bottom- 10% memorized instances from the trainset and collect the average percentage positive phrases in these instances.
As shown in Table 3 we can conclude following findings: (1) The PLM tends to give atypical samples deeper memory attention. Specifically, no matter MFFFFF or our method, the top-
7

---

Table 3:
The upper part shows the average percentage of positive phrases different memory
groups of positive/negative instances. The lower part denotes the mean values of memorization score on the SST-2 dataset.
Mem Group
Negative
Postive
FT
BFF
OURS
BFF
OURS
Top- 10%
34.29
32.78
30.23
68.75
69.71
75.67
ALL
23.40
86.39
Bottom-
17.63
16.25
95.92
95.08
FT
LM-BFF
OURS
MFM SCORE
4.997
0.121
0.032
10% memorized negative instances have higher percentage of positive phrases than the average percentage of positive phrases of all negative instances. 2) LM-BFF has lower memorization scores on hard samples than the-ttunng. We think it owns to prompt learning can help PLMs recall what they learned from pre-training without strengthening memory for downstream data. 3) RETROPROMPT further has lower average memorization scores than fine-tuning and LM-BFF, which illustrates that our method less memory dependent. This result may be attributed to decoupling knowledge from memorization through retrieval to alleviating the rote of PLMs.
Case Analysis. As shown in Table 6 we manu- ally list the bottom-ranked and top-ranked training instances of SST-2 according to our model. It re- veals that the top-ranked memorized instances seem to show universal opinions indirectly. Thus, we in- spect them as atypical/hard for sentiment classifica- tion. While those instances with memorization scores are straightforward to show their opinion for sentiment classification, representing the typical in- stance. Note that F F(PENN) is defined to represent the difficulty the sample discriminated by kNN dis- tribution. And the Table 6 shows that F F(PNNN) indeed reflect atypicality of examples, which vali- dates the effectiveness of the &NN guided training.
Table Detailed ablation experiments in few-shot settings. "N-demo" donates the neu- ral demonstration, and "refresh" refers to the asynchronous refresh of the knowledge-tore.
Model
16-shot
SST-2
CR
MNLI
QQP
TACRED
40.7
w/o ANN-test
93.2
91.2
70.4
73,0
38.2
ANN
71.3
36.5
w/o N-demo
92.4
91.0
70.1
72.7
37.9
refresh
70.7
73.6
39.9
4.6 Ablation Study
Component Ablation. As shown in Table the performance of component ablation experiments with four variants has a clear drop, which validates the power of our retrieval component. We also find that neural demonstration and kNN-train have more improvement in the few-shot setting than kNN-test. Note that &NN-test similar to &NN-LM [26 [6] and the results reveals that simply incorporate KNN in the test process of prompt learning has little influence in few-shot setting.
Key Representation and ANN Acquisition. We study the effect of using different representations of the key in the knowledge-store. We experiment with two types of repre- sentations: (1) prompt-based representation, which is the default setting, and (2) [CLS] based representation of current LM. We also experiment with types of calculation of kNN distribution: (1) representation based similarity score (refer as rep-similar), which the default setting, and (2)
Table 5: Performance on 16-shot CR and TACRED with different represen- tations of key and calculate function of &NN distribution.
Key Repres.
ANN Acq.
CR
TAC.
Prompt [CLS]
Rep-similar
91.9
40.7
BM25 based score, which calculates the correlation score between the query and each key examples with BM25 [48] algorithm. Results in Table[5]show that using prompt-based representations for key and representation based similarity
Rep-similar
37.2
Prompt
BM25
89.5
38.8
[CLS]
BM25
88.7
36.1
scores for ANN leads to the best performance. It suggests that prompt learn better representations for context similarity and the representation similarity based I:NN distribution better than BM25 based scores.
8

---

Table 6: Case examples of Top-3 and Bottom-3 memorized instance of ours from trainset of SST-2.
Negative
Positive
Content
Mem
F F(pes))
Content
Mem F(PENs)
Although god is great addressed interesting mateers identity
heritage, hard shake the foeling that it was intend be different kind of film.
b-movie you can through, enjoy certain level and then forget.
0.066
1.17
0.020
0.18
A film that will be best appreciated by those willing to endure its extremely languorous rhythms, waiting for happiness is ultimutely thoughtful without having much dramatic impact.
A standard police--riinted oriented drarna that, were for deniro's purticipation, would have likely wound up int original.
0.011
1.48
0.010
0.43
A hit and miss affair, consistently amusing not as outrageous funny as may have intended as imaginative as one might have hoped.
What's 's invigorating about that doesn't give a damn.
0.010
2.74
0.003
0.06
A fun family movie that's suitable for ages- movie that will make you laugh, cry realize, never your dreams."
It's luathsome movie, it really is and it makes absolutely no sense.
0.00
0.00
helieve in
0.00
0.00
that rare combination of bad writing. bad direction and bad acting the trifecta of hadness.
0.00
0.00
It's cool event for the whole family.
0.00
0.00
Good fun, good action, good acting, good dialogue, good pace, good cinematography.
This thing is virtually unwatchable.
0.00
0.00
0.00
0.00
5 Related Work
Retrieval-enhanced PLMs. Our pipeline is partly inspired by discrete demonstration methods
29 that retrieves few training examples in natural language prompt, while we propose neural demonstration for enhancing the input to alleviate the limitations of input length.
such as 12 35
28
Another line researches of retrieval augmentation [14 23 32 49 3 retrieve useful information from a external knowledge corpus (e.g., Wikipedia) for particular task (e.g., an open-domain question). Unlike these works, we focus on retrieving examples from the internal training data. Besides, semi- parametric methods 26
42 have risen to leverage k-nearest neighbor classifier, classic paraaaarettic algorithm that makes the prediction based on representation similarities, to enhance pre-trained language models in various tasks However, unlike these models using nearest neighbors only for augmenting the process of prediction, we aim to develop a comprehensive retrieval mechanism for input, training and test process.
16 25 24
Prompt learning for PLMs. With the birth of GPT-3 4. prompt learning [36] has recently arisen to fill the gap between masked LM objective of PLMs and downstream fine-tuning objective. Prompt learning has achieves very impressive performance on various tasks, such as text classification [3]5,).
named entity recognition 5 40
relation extraction
15
6
event extraction
[8 60). machine
translation
(55) and language generation [52] especially under the setting of few-shot learning.
Moreover, continuous prompts have also been proposed [33 30 37 to reduce prompt engineering, which directly appends series of learnable continuous embeddings as prompts into the input sequence. Our work is orthogonal to previous prompt learning approaches, which aim to optimize prompts, while we focus on the systematic study of retrieving related examples from training data to enhance prompt learning.
Conclusion and Future Work
We propose RETROPROMPT that decouples knowledge from memorization by introducing retrieval augmentation to further improve the generalization ability of prompt learning on the input side and the whole process of model training and prediction. RETROPROMPT, is straightforward yet effective retrieval method that combines both neural demonstrations, &NN guider for training and prediction. Our extensive results show that it outperforms other cemonstration-enhaneee prompt methods and knowledge- weieedeeeenaaneedd prompt methods in few-shot, zero-shot and fully-supervised settings. Analyzing the essence of memorization validates the effectiveness of decoupling knowledge from memorization. Interesting future directions include: 1) apply to other tasks, such QA and NLG, 2) explore the noise data mining for unsupervised learning, 3) further improve the retrieve efficiency for large datasets, etc.

---

Acknowledgments
We want to express gratitude to the anonymous reviewers for their kind comments. This work was supported by National Natural Science Foundation of China (No.62206246. 91846204 and U19B2027), Zhejiang Provincial Natural Science Foundation China (No. LGG22F03001I), Ningbo Natural Science Foundation (2021J190), and Yongjiang Talent Introduction Programme (2021A-156-G).
References
[1] Uri Alon, Frank F. Xu, Junxian He, Sudipta Sengupta, Dan Roth, and Graham Neubig. Neuro- symbolic language modeling with nutomaton-aaugenteer retrieval, 2022.
[2] Gianluca Bontempi, Hugues Bersini, and Mauro Birattari.
The local paradigm for modeling and control: from neuro-fuzzy to lazy learning. Fuzzy sets and systems, 121(1):59-72, 2001.
[3] Sehastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George van den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, Diego de Las Casas, Aurelia Guy, Jacob Menick, Roman Ring, Tom Hennigan, Saffron Huang, Loren Maggiore, Chris Jones, Albin Cassirer, Andy Brock, Michela Paganini, Geoffrey Irving, Oriol Vinyals, Simon Osindero, Karen Simonyan, Jack W. Rae, Erich Elsen, and Laurent Sifre. Improving language models by retrieving from trillions of tokens. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvári, Gang Niu, and Sivan Sabato, editors, International Conference on Machine Learning. ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA, volume 162 of Proceedings of Machine Learning Research, pages 2206- PMLR, 2022.
[4] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Vosse Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Proceedings of NeurlPS 2020, 2020.
[5] Xiang Chen, Ningyu Zhang, Lei Li, Xin Xie, Shumin Deng, Chuanqi Tan, Fei Huang, Luo Si, and Huajun Chen. Lightner: lightweight generative framework with prompt-guided attention for low-resource NER. CoRR, abs/2109.00720) 2021.
[6] Xiang Chen, Ningyu Zhang, Xin Xie, Shumin Deng, Yunzhi Yao, Chuanqi Tan, Fei Huang, Luo Si, and Huajun Chen. Knowprompt: Knowledge-aware prompt-tuning with synergistic optimization for relation extraction. CoRR, abs/2104.07650, 2021.
[7] Jacob Devlin, Ming- Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume (Long and Short Papers), pages 4171-4188 Association for Computational Linguistics, 2019.
[8] Ning Ding, Guangwei Xu, Yulin Chen, Xiaobin Wang. Xu Han, Pengjun Xie, Haitao Zheng, and Zhiyuan Liu. Few-nerd: A few-shot named entity recognition dataset. In Chengqing Zong, Fei Xia, Wenjie Li, and Roberto Navigli, editors, Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 1 1th International Joint Conference on Natural Language Processing, ACL/IJCNLP 2021, (Volume Long Papers), Virtual Event, August 1-6, 2021, pages
Association for Computational Linguistics, 2021.
[9] Aparna Elangovan, Jiayuan He, and Karin Verspoor. Memorization vs. generalization Quanti- fying data leakage in NLP performance evaluation. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, pages 1 32351335, Online, April 2021. Association for Computational Linguistics.
10

---

[10] Vitaly Feldman. Does learning require memorization? short tale about a long tail. In Konstantin Makarychev, Yury Makarychev, Madhur Tulsiani. Gautam Kamath, and Julia Chuzhoy, editors. P Proccedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, STOC 2020, Chicago, HI, USA, June 22-26, 2020, pages 954-959 ACM, 2020.
[11] Vitaly Feldman and Chiyuan Zhang. What neural networks memorize and why: Discovering the long tail via influence estimation. In Hugo Larochelle, Marc' Aurelio Ranzato, Raia Hadsell, Maria-Florins Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
[12] Tianyu Gao, Adam Fisch, and Danqi Chen. Making pre-trained language models better few-shot learners. In Proceedings of ACL. 2021.
[13] Edouard Grave, Moustapha Cissé, and Armand Joulin. Unbounded cache model for online language modeling with open vocabulary. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 6042-6052, 2017.
[14] Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming- Wei Chang. REALM: retrieval-augmennted language model pre-training. CoRR, abs/2002.08909, 2020.
[15] Xu Han, Weilin Zhao, Ning Ding, Zhiyuan Liu, and Maosong Sun. PTR: prompt tuning with rules for text classification. CoRR, abs/2105.11259, 2021.
[16] Junxian He, Graham Neubig, and Taylor Berg- Bang-Kirkpatrick. Efficient nearest neighbor language models. In Proc. of EMNLP, 2021.
[17] Iris Hendrickx, Su Nam Kim, Zornitsa Kozareva, Preslav Nakov, Diarmuid Ó Séaghdha, Sebastian Pad6, Marco Pennacchiotti, Lorenza Romano, and Stan Szpakowicz. 2001 task 8: Multi-way classification of semantic relations between pairs of nominals. In Proceedings of SemEval. pages 33-38, 2010.
[18] I Hsu, Kuan-Hao Huang, Elizabeth Boschee, Scott Miller, Prem Natarajan, Kai-Wei Chang, Nanyun Peng, al. Event extraction as natural language generation. arXiv preprint arXivv2108. 12724, 2021.
[19] Minqing Hu and Bing Liu. Mining and summarizing customer reviews. In Won Kim, Ron Kohavi, Johannes Gehrke, and William DuMouchel, editors, Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Seattle, Wash- ington, USA, August 22-25, 2004, pages 168-177. ACM, 2004.
[20] Shengding Hu, Ning Ding, Huadong Wang, Zhiyuan Liu, Juanzi Li, and Maosong Sun. Knowl- edgeable prompt-tuning: Incorporating knowledge into prompt verbalizer for text classification. CoRR, abs/2108.022 02035, 2021.
[21] Jeff Johnson, Matthijs Douze, and Hervé Jégou. fillion-scale similarity search with gpus. IEEE Trans. Big Data, 733:5335-547 2021.
[22] Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. Trans. Assoc. Comput. Linguistics, 8:64-77, 2020.
[23] Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick S. H. Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. Dense passage retrieval for open-domain question answering. In Bonnie Webber, Trevor Cohn, Yulan He, and Yang Liu, editors, Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing. EMNLP 2020, Online, November 16-20, 2020, pages 6769-6781. Association for Computational Linguisties, 2020.
[24] Nora Kassner and Hinrich Schütze. Bert-knn: Adding a knn search component to pretrained language models for better QA. In Findings of EMNLP, 2020.
11

---

[25] Urvashi Khandelwal, Angela Fan, Dan Jurafsky, Luke Zettlemoyer. and Mike Lewis. Nearest neighbor machine translation. In 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net, 2021.
[26] Urvashi Khandelwal, Omer Levy, Dan Jurafsky, Luke Zettlemoyer. and Mike Lewis. Gen- eralization through memorization: Nearest neighbor language models. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
[27] Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International Conference on Machine Learning, 2017.
[28] Sawan Kumar and Partha Talukdar. Reordering examples helps during priming- -hasin few-shot learning. In Findings of the Association for Computational Linguistics: ACI-IJCNLP 2021, pages 4507-4518, Online, 2021. Association for Computational Linguisties.
[29] Dong-Ho Lee, Mahak Agarwal, Akshen Kadakia, Jay Pujara, and Xiang Ren. Good examples make faster learner: Simple demonstration-based learning for low-resource NER. CoRR, abs/2110 10..0444, 2021.
[30] Brian Lester, Rami AI-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. arXiv preprint arXiv:2 wrxiv:2/04.086// (0400861,1.. 2021.
[31] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: denoising seguence-t-sequeene pre- training for natural language generation, translation, and comprehension. Proceedings of ACL 2020, 2020.
[32] Patrick S. H. Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, Sebastian Riedel, and Douwe Kiela. Retrieval-augmeettd generation for knowledge-nnensiie NLP tasks. In Hugo Larochelle, Marc' Aurelio Ranzato. Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurlPS 2020, December 6-12, 2020, virtual, 2020.
[33] Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of ACI/IJNNP 2021, 2021.
[34] Tsung- Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. In IEEE Trans. Puttern Anal. Mach. Intell., volume 42, pages 318-327, 2020.
[35] Jiachang Liu, Dinghan Shen, Yizhe Zhang, Bill Dolan, Lawrence Carin, and Weizhu Chen. What makes good in-context examples for gpt-3? CoRR, abs/2101 006804, 2021.
[36] Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, prompt, and predict: systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021.
[37] Xiao Liu, Yanan Zheng, Zhengxiao Du, Ming Ding, Yujie Qian, Zhilin Yang, and Jie Tang. GPT understands, too. CoRR, abs/2103. 10385, 2021.
[38] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized BERT pretraining approach. CoRR, abs/1907. 1692, 2019.
[39] Yao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel, and Pontus Stenetorp. Fantastically ordered prompts and where to find them: Overcoming few-shot prompt order sensitivity. CoRR, abs/2104.08786, 2021.
[40] Ruotian Ma, Xin Zhou, Tao Gui, Yiding Tan, Qi Zhang, and Xuanjing Huang. Template-free prompt tuning for sho-shot NER. CoRR, abs/2109. 13532, 2021.
12

---

The [41] Yu Meng, Yunyi Zhang, Jiaxin Huang, Chenyan Xiong, Heng Ji, Chao Zhang, and Jiawei Han. Text classification using label names only: A language model self self training approach. In Proceedings of EMNLP, 2020.
[42] Yuxian Meng, Shi Zong, Xiaoya Li, Xiaofei Sun, Tianwei Zhang, Fei Wu, and Jiwei Li. GNN-LM: language modeling based on global contexts via GNN. CoRR, abs/2110.08843, 2021.
[43] Bo Pang and Lillian Lee. Sceing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In Kevin Knight, Hwee Tou Ng. and Kemal Oflazer, editors, ACL 2005, 43rd Annual Meeting the Association for Computational Linguistics, Proceedings of the Conference, 25-30 June 2005, University of Michigan, USA, pages 115-124. The Association for Computer Linguisties, 2005.
[44] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang. Zachary Viiito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelz- imer, Florence d' Alché-Buce Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference Neural Information Processing Systems 2019, NeurlPS 2019, December 8- 14, 2019, Vancouver, BC, Canada, pages 8024 8035, 2019.
[45] Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training, OpenAl, 2018.
[46] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100, 000+ questions for machine comprehension of text. In Jian Su, Xavier Carreras, and Kevin Duh, editors, Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, EMNLP 2016, Austin, Texas, USA, November 1-4, 2016, pages Association for Computational Linguistics, 2016.
[47] Nils Reimers and Iryna Gurevych. Sentence-bert Sentence embeddings using siamese bert- networks. In Kentaro Inui, Jing Jiang, Vincent Ng, and Xiaojun Wan, editors, Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th Interna- tional Joint Conference on Natural Language Processing, EMNLP-IJCNI 2019, Hong Kong, China, November 3-7, 2019, pages 3980-3990. Association for Computational Linguisties. 2019.
[48] Stephen F. Robertson and Hugo Zaragoza. The probabilistic relevance framework: BM25 and beyond. Found. Trends Inf. Retr, 3(4):333-389, 2009.
[49] Ohad Rubin, Jonathan Herzig, and Jonathan Berant. Learning to retrieve prompts for in-context learning. CoRR, abs/2112.08623 2021.
[50] Victor Sanh, Albert Webson, Colin Raffel, Stephen H. Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, Manan Dey, M. Saiful Bari, Canwen Xu, Urmish Thakker, Shanya Sharma, Eliza Szezechla, Taewoon Kim, Gunjan Chh- ablani, Nihal V. Nayak, Debajyoti Datta, Jonathan Chang, Mike Tian-Jian Jiang, Han Wang, Matteo Manica, Sheng Shen, Zheng Xin Yong, Harshit Pandey, Rachel Bawden, Thomas Wang. Trishala Neeraj, Jos Rozen, Abheesht Sharma, Andrea Santilli, Thibault Févry. Jason Alan Fries, Ryan Techan, Stella Biderman, Leo Gao, Tali Bers, Thomas Wolf, and Alexander M. Rush. Multitask prompted training enables shoo task generalization. CoRR, abs/2110.08207. 2021.
[51] Timo Schick, Helmut Schmid, and Hinrich Schütze. Automatically identifying words that can serve as labels for few-shot text classification. In Proceedings of COLING, December 2020.
[52] Timo Schick and Hinrich Schütze. Few-shot text generation with pattern-exploiting training. arXiv preprint
2020.
13

---

[53] Taylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace, and Sameer Singh. Auto- prompt: Eliciting knowledge from language models with automatically generated prompts. In Proceedings of EMNLP 2020, 2020.
[54] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher Manning, Andrew sen-
Ng. and Christopher Potts. Recursive deep models for semantic compositionality timent treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing, EMNLP 2013, 18-21 October 2013, Grand Hyatt Seattle, Seattle, Wash- ington, USA, A meeting of SIGDAT, a Special Interest Group of the ACL, pages 1631-1642. ACL, 2013.
[55] Zhixing Tan, Xiangwen Zhang, Shuo Wang, and Yang Liu. MSP: multi-stage prompting for making pre-trained language models better translators. CoRR, abs/21 10.06699, 2021.
[56] Michael Tänzer, Sebastian Ruder, and Marek Rei. Memorisation versus generalisation in pre-trained language models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages
2022.
[57] Jason Wei, Maarten Bosma, Vincent Y. Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M. Dai, and Quoc V. Le. Finetuned language models are zero-shot learners. CoRR, abs/2109.01652, 2021.
[58] Adina Williams, Nikita Nangia, and Samuel R. Bowman. A broad-coverage challenge corpus for sentence understanding through inference. In Marilyn A. Walker, Heng Ji, and Amanda Stent, editors, Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HI.T 2018, New Orleans, Louisiana, USA, June 1-6, 2018, Volume (Long Papers), pages 1112-1122. Association for Computational Linguistics, 2018
[59] Sen Yang, Yunchen Zhang, Leyang Cui, and Yue Zhang. Do prompts solve NLP tasks using natural language? CoRR, abs/2203.0090)) 2022.
[60] Hongbin Ye, Ningyu Zhang, Zhen Bi, Shumin Deng, Chuanqi Tan, Hui Chen, Fei Huang, and Huajun Chen. Learning to ask for data-efficient event argument extraction. arXiv preprint arXiv:2110.00479, 2021.
[61] Yuhao Zhang, Victor Zhong, Danqi Chen, Gabor Angeli, and Christopher D. Manning, Position- aware attention and supervised data improve slot filling. In Proceedings of EMNLP 2017, 2017.
[62] Xiaosen Zheng and Jing Jiang. An empirical study of memorization in NLP. CoRR, 1bs/2203.12171, 2022.
Checklist
1. For all authors...
(a) Do the main claims made in the abstract and introduction accurately reflect the paper's
contributions and scope? [Yes]
(b) Did you describe the limitations of your work? [Yes] See Appendix.
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See
Appendix.
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
2. If you are including theoretical results...
(a) Did you state the full set of assumptions all theoretical results? [N/A]
(b) Did you include complete proofs of all theoretical results? [N/A]
3. If you experiments...
14

---

(a) Did you include the code, data, and instructions needed to reproduce the main experi- mental results (either in the supplemental material as URL)? [Yes] We include the source code and data in our supplemental material submission, and we outline the data generation procedure, the evaluation protocol, the training regime, and everything else necessary for reproduction either in the main body of the paper or in the appendix.
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Subsection 4.2 and Appendix.
(c) Did you report error bars (e.g.. with respect to the random seed after running experi- ments multiple times)? [Yes] We list the standard deviation for few-shot setting. (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, cloud provider)? [Yes] We introduce type of resources in Section
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators? [Yes]
(b) Did you mention the license of the assets? [No] The code and the data are proprietary.
(c) Did you include any new assets either the supplemental material or as URL? [No]
(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [No] The code and the data are proprietary.
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No]
5. If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, applicable? [N/A]
(b) Did you describe any potential participant risks, with links Institutional Review Board (IRB) approvals, if applicable? [N/A]
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
15


Reviews:
[{"review_id": "vR142V3oUUm", "reviewer": "Reviewer_SEU9", "summary": "This paper proposes a new semi-parametric approach for few-shot learning, where the prediction is made based on the combination of softmax probability from the language model (LM) and probability from retrieval over a knowledge store (in this paper, training data, either unlabeled or labeled). The paper proposes a few model components to make this approach work – the LM trained to be a good retriever (along with asynchronous update of the index), neural demonstrations (using nearest neighbors of the query from the knowledge store), and a modified objective (called guiding training in the paper). Experiments are done in a few-shot setup (where a few labeled examples leads to a knowledge store) and in a zero-shot setup (where an unlabeled training data is a knowledge store, and there is no parameter updates), and show strong results on 9 different NLP datasets (classification and information extraction) over competitive zero- and few-shot baselines.\n", "questions": "* kNN-based models are known to be effective when the size of the datastore is large. In this context, it is not intuitive to me how the model benefits from the kNN approach in a few-shot setup, where the datastore only consists of 4 or 16 examples.\n* Is my understanding correct that, in a zero-shot setup, since there is no training phrase, the only difference from kNN-LM in terms of the model is the use of neural demonstration? Based on Table 1, the proposed model has significantly more improvements in a zero-shot rather than a few-shot? Are all gains here coming from neural demonstrations?\n* Questions about Table 4:\n    * w/o kNN-test: in this case, since the data store is not actually used, are gains mostly coming from better LM?\n    * w/o kNN-train: in this case, is it identical to kNN-LM except there are neural demonstrations? (I know the knowledge store still looks different, but am curious in terms of modeling.) And is my understanding correct that this is identical to the main model in a zero-shot setup?\n* Equation (6): It is not entirely clear to me how this objective achieves the problem mentioned in the section, and if this objective is mathematically sound. (e.g. why does it have to be the form of the multiplication between two log probability values?)\n* Zero-shot setting: It seems debatable whether the use of training data (even if labels are not used) can be called zero-shot, although I understand authors followed the setup from previous work. Maybe it’s good to add a footnote noting that this is not zero-shot in a stricter sense?", "limitations": "The paper does not include limitations of work. I suggest authors to indicate limitations of the proposed model (e.g., when the proposed model may not work) as well as broader risk in applying large LMs in downstream tasks.", "rating": 5, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "### Strengths\n\n* The idea of applying retrieval over a knowledge store for language model prompting is of interest in the community and is a timely topic.\n* This paper is one of the first that applies the kNN-LM approach for downstream tasks, as far as I know.\n* Empirical results are strong, outperforming a range of competitive baselines.\n* Experiments also include extensive ablations, showing the impact of each model component.\n\n\n### Weaknesses\n\n* The idea is strongly based on the kNN-LM model (Khandelwal et al. 2021). In fact, the overall idea of combining softmax probability and probability from retrieval is entirely taken from kNN-LM, and how the model works at inference time is identical with kNN-LM, if I understand correctly. Although this paper is cited, it is cited only briefly (only cited twice, in Section 3.4 and Section 5). It looks to me that the paper should extensively discuss kNN-LM and describe the differences. (To clarify, I do believe there are substantial differences. They are just not discussed in the paper.)\n* The model seems named after RETRO (Borgeaud et al. 2021), but the paper does not cite nor discuss the RETRO paper. In fact, I do not think the connection between this paper and RETRO is very tight – they’re only loosely related in the sense that both do retrieval, but what they retrieve, where they retrieve from, how they incorporate retrieval to LM, and what problems they are solving are all different. It is indeed not very intuitive to me why the model is named after RETRO, given that it is significantly more related to kNN-LM.\n* It is not entirely clear to me what exactly are giving improvements, e.g., how the model gains from retrieval when the data store is extremely small (e.g., with 4 examples), how the zero-shot model achieves significant gains even with no training (which I believe is the main contribution of the paper), how the model still outperforms most competitive baselines (in Table 1) even without kNN-test that does not actually incorporate retrieval at test time, etc. I discussed them in more detail in the “Questions/comments” section.\n\n(I am giving a borderline score due to the weaknesses mentioned here, but am happy to increase the score if they are resolved during the author rebuttal period.)\n\nBorgeaud et al. 2021: https://arxiv.org/abs/2112.04426", "was_revised": false, "final_justification": "", "rebuttal": "", "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": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"ethics_review_area": ""}, "extra_text": {}}, {"review_id": "vQC_sYC9NYj", "reviewer": "Reviewer_YLj1", "summary": "This paper proposes an idea to retrieve from few-shot examples to prevent the prompt tuning process to bias toward learning from atypical examples. The combination of three techniques - knn-guided training, neural demonstration, and the knn-guided test-time prediction leads to a strong empirical performance across a broad set of tasks. Analysis shows that the proposed method effectively mitigates memorization. ", "questions": "- For neural demonstration, I assume that the concatenation happens on the dimension of tokens? I suggest stating it more clearly in the paper.\n- For section 4.4, did you just use 16 examples from the source dataset and not fine-tune on the target dataset at all?\n", "limitations": "Yes, the authors discuss about efficiency overhead of the proposed method in appendix.", "rating": 6, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "### Strengths\n- The proposed method shows very strong empirical results compared to strong baselines\n- It shows that even in the few-shot setting, retrieval-based approaches would be helpful for stabilizing and improving results without introducing additional parameters, and it could lead to useful application in a broader context.\n\n### Weaknesses\n- Details are missing, especially about the baseline and it weakens the compelling results. 1) KPT is a method to expand the verbalizers, what verbalizers did you get? I don't understand why the results would be worse than LM-BFF as it seems to be LM-BFF + additional verbalizers? 2) For LM-BFF, how did you get the scores with demonstrations in a zero-shot setting? \n- Some design choices are not well justified or ablated: 1) Why specifically use FocalLoss? How does it compare to a linear combination of the original cross-entropy loss and a KNN loss similar to KNN-LM and it would be closer to the retrieval setup during test time? 2) Why does neural demonstration happen at the embedding layer? \n", "was_revised": false, "final_justification": "", "rebuttal": "", "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": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"ethics_review_area": ""}, "extra_text": {}}, {"review_id": "doQ8GeJEXHV", "reviewer": "Reviewer_puCA", "summary": "This paper introduces RetroPrompt, which constructs an open-book knowledge store from training instances and implements a retrieval mechanism during the process of input, training, and inference, thus equipping the model with the ability to retrieve related contexts from the training corpus as cues for enhancement.\n", "questions": "See the comments in weakness. Especially points 2 and 3.\n", "limitations": "Discussion of limitations is lacking.", "rating": 5, "confidence": 4, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "Strength:\n\n1. The experiments are extensive and convincing.\n2. The idea of using kNN as a grounding demonstration is technically sound and plausible.\n3. The choices of datasets and tasks are diverse.\n\nWeakness\n\n1. The idea of using nearest neighbors to train (kNN LM), to inference (FiD), and the general idea of using retrieval modules on memories (Google’s REALM, and Meta’s RAG), have been proposed and well studied. It’s unclear to me what is the novelty of this work. It seems like a combination of different models in different stages. And none of the models mentioned above are included as baselines.\n\n2. What’s the performance of your method on open-ended knowledge-intensive tasks. As the tasks chosen in this work are mainly short-text tasks that can be answered with closed-from short texts (mainly overlapped with LM-BFF). Other tasks such as MSMARCO and Wizard of Wkipedia normally require more complicated reasoning rather than simple keyword memorization.\n\n3. It is important to include some information retrieval systems as baselines, since if you integrate the retrieval system into every stage of LM, what’s the benefit of using an LM for unreliable prediction? I would like to see some analysis in the comparison with some IR-based methods, such as DPR, BM25, etc (+ necessary post-processing modules), if applicable.\n\n4. The writing can be improved, especially some informal expressions.\n\n5. No discussion of limitations", "was_revised": false, "final_justification": "", "rebuttal": "", "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": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"ethics_review_area": ""}, "extra_text": {}}, {"review_id": "dVX_lBc8sw5", "reviewer": "Reviewer_HTfi", "summary": "They propose a method for better zero-shot and few-shot prompt learning called RETROPROMPT. To decoupling knowledge from memorization, they introduce knowledge-store which contains key-value as a [masked] label representation and its corresponding label word for the target data set. Using kNN on this neural knowledge-store, guided training and open-book inference can be implemented. By achieving best performances on 9 NLU tasks, the proposed method is shown to be effective.", "questions": "For the full fine-tuning, does the proposed model suffer from tremendous memory usage?", "limitations": "- Knowledge-store might be managed for full fine-tuning on large training dataset\n- As metioned in the conclusion, this paper only deals with NLU tasks with encoder models. ", "rating": 7, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "[Strengths]\n- Well written.\n- The paper propose technically sound and smart idea for balancing between generalization and memorization.\n- Various experiements prove the effectiveness of the proposed RETROPROMPT for zero-/few-shot learning.\n\n[Weaknesses]\n- Experiments on full fine-tuning for all 9 datasets would be better for understanding the proposed work (only 3 results out of 9 datasets are included in the paper).\n- The proposed model may suffer from enormous memory usage, especially for the full fine-tuning.", "was_revised": false, "final_justification": "", "rebuttal": "", "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": "", "reasons_to_reject": "", "questions_to_authors": "", "main_review": "", "summary_of_the_paper": "", "summary_of_the_review": "", "strength_and_weaknesses": "", "limitations_and_societal_impact": "", "review_text": "", "extra_scores": {"ethics_review_area": ""}, "extra_text": {}}]

Author rebuttal:

Decision: Accept