Instruction Tuning with Retrieval-based Examples Ranking for Aspect-based Sentiment Analysis (2024)

Abstract: Aspect-based sentiment analysis (ABSA) identifies sentiment information related to specific aspects and provides deeper market insights to businesses and organizations. With the emergence of large language models (LMs), recent studies have proposed using fixed examples for instruction tuning to reformulate ABSA as a generation task. However, the performance is sensitive to the selection of in-context examples; several retrieval methods are based on surface similarity and are independent of the LM generative objective. This study proposes an instruction learning method with retrieval-based example ranking for ABSA tasks. For each target sample, an LM was applied as a scorer to estimate the likelihood of the output given the input and a candidate example as the prompt, and training examples were labeled as positive or negative by ranking the scores. An alternating training schema is proposed to train both the retriever and LM. Instructional prompts can be constructed using high-quality examples. The LM is used for both scoring and inference, improving the generation efficiency without incurring additional computational costs or training difficulties. Extensive experiments on three ABSA subtasks verified the effectiveness of the proposed method, demonstrating its superiority over various strong baseline models. Code and data are released at https://github.com/zgMin/IT-RER-ABSA.

heading: 1 Introduction
text: Aspect-based sentiment analysis (ABSA) (Zhang and Liu, 2017) is a fine-grained text sentiment analysis technique that identifies sentiment information related to specific aspects, and provides deeper market insights for businesses and organizations. ABSA consists of three subtasks: aspect term extraction (ATE), aspect term sentiment classification (ATSC), and aspect sentiment pair extraction (ASPE). ATE identifies the aspects mentioned in
∗Corresponding author.
the text, and ATSC determines the sentiment polarity associated with each aspect. Furthermore, ASPE jointly performs ATE and ASPE to extract sentiment tuples, including aspect terms and their associated sentiments.
For ABSA tasks, most previous methods have used transformer-based language models (LMs) in either a pipeline or end-to-end framework (Chen and Qian, 2020; Luo et al., 2020; Mao et al., 2021; Marcacini and Silva, 2021; Yang and Li, 2021). By adding task-specific layers to the top of the model, these models are typically initialized from the pretrained checkpoint and then finetuned on the downstream samples. Recently, generative models (Hosseini-Asl et al., 2022; Yan et al., 2021; Zhang et al., 2021) have emerged to reformulate ABSA tasks as generation tasks to produce a sequence with a special pattern, for example, restaurant#positive and food#negative. Based on the instruction-tuning paradigm (Mishra et al., 2022), several studies (Scaria et al., 2023; Varia et al., 2022) have further improved the generative approach using several predefined instruction prompts (Scaria et al., 2023). Instruction tuning allows generative models to tune themselves on a few input-output examples.
The quality of the output generated by the instruction-tuning model is highly dependent on the quality of in-context examples. Well-crafted instructions can help the model generate more accurate and relevant outputs(Luo et al., 2024), whereas poorly crafted instructions can lead to incoherent or irrelevant results. Nevertheless, previous studies typically adopted a fixed strategy to use two or more unchanged examples to generate the instruction template. If the examples are unrepresentative of the target task, the model may be unable to learn effectively.
For a target sample, for example, The falafel was slightly overcooked and dry, but the chicken was satisfactory, the example The price was too
4777
high, but the cab was amazing can be appropriate. They share a similar syntactic structure, which can contribute to imitation and generation. However, such an example is unsuitable for another sample, for example, The staff displays arrogance, and the prices are considerably high for Brooklyn standards. Because the opinion of high in the example may finally impact the judgment of the aspect price of the target. Furthermore, the sample We enjoyed our visit and utilized buses and cabs for transportation seems to have little relevance to the example above. However, the aspect cab may be incorrectly considered an aspect term based on the prompt of the word cab in the example.
Empirical studies have demonstrated the use of an additional language model as a scorer to produce off-the-shelf sentence embeddings, for example, BM25 (Robertson and Zaragoza, 2009), EPR (Rubin et al., 2021) and LLM-R (Wang et al., 2023), for similarity calculations to retrieve examples from the training set. Several works explored training a prompt retriever to select examples by measuring surface similarity (Li et al., 2022; Liu et al., 2022; Zhang et al., 2022). These methods have two limitations: (i) the similarity calculation typically measures the distance in the latent space, which is independent of the generation target in instruction learning, and (ii) additional encoders are necessary to obtain the representation used for similarity calculations, which also incurs additional computational costs and training difficulties.
This study proposes an instruction-tuning method with retrieval-based example ranking for ABSA tasks, comprising a retriever and inference LM. The LM is a T5 model (Raffel et al., 2019) with an encoder-decoder structure and several instruction-tuned versions (Chung et al., 2022; Wang et al., 2022). The retriever returns the most appropriate examples to form the instruction template. Meanwhile, the LM scores the examples for the retriever and generates the final results.
To achieve the training of LM and retriever simultaneously, an alternating training schema is proposed. For each target sample, the candidates can be divided into positive and negative examples according to the log-likelihood provided by the LM. Then, contrastive learning is applied to force the sample to be near positive examples but distant from negative examples. After composing highquality instructions, the LM can be finetuned using a generative objective.
Unlike the previously proposed similarity calculation, the retriever evaluates the importance of candidate examples based on the log-likelihood of the LM. This retrieval goal is consistent with the generative objective of the LM. In addition, the LM is used for both scoring and inference, improving the generation performance with tolerable additional computational costs or training difficulties.
Extensive experiments were conducted on ATE, ATSC, and ASPE tasks to verify the effectiveness of the proposed method. The results show that the proposed model substantially improves the performance compared with several strong baselines.
The remainder of this paper is organized as follows. Section 2 briefly reviews the related studies. Section 3 describes the proposed retrieval-based example mining method for instruction learning in ABSA. Section 4 summarizes the experiment settings and empirical results. Finally, Section 5 concludes the paper.

heading: 2 Related Work

heading: 2.1 Aspect-Based Sentiment Analysis
text: Aspect-based sentiment analysis (Zhang and Liu, 2017) aims to analyze sentiment polarities toward the specific aspects of a given text. In ABSA, text is decomposed into several aspects, and sentiment polarity, which is typically positive, neutral, or negative, is analyzed for each aspect. This approach provides fine-grained, in-depth sentiment insights, enabling businesses and organizations to better understand market and consumer perspectives.
Most approaches have focused on using encoder structures to accomplish aspect extraction and sentiment identification, such as improved text encoding using attention mechanisms (Marcacini and Silva, 2021; Yuan et al., 2020, 2022), multitask learning (Chen and Qian, 2020), and approaches based on machine reading comprehension (Mao et al., 2021). Some studies (Yan et al., 2021; Zhang et al., 2021) introduced decoders to unify ABSA’s previous extraction and classification tasks into generative tasks. Recently, instruction prompts have been introduced into generative methods (Varia et al., 2022), achieve a solid few-shot performance by making the model perform the correct action with an apparent task description. Furthermore, fixed examples were added to the instructions to supplement the task description with more accurate information, yielding significant performance improvements in the ABSA subtasks (Scaria et al.,
2023). However, the adaptability of the fixed examples to different review texts is difficult to guarantee. Liu et al. (2022) demonstrate that selecting contextual examples significantly affects the downstream performance. The intricate relationship between selected examples and diverse review contexts underscores the need for a nuanced approach to ensure robust and effective adaptation in various scenarios.

heading: 2.2 Prompt Retrieval
text: With the development of deep learning techniques, dense retrieval (Karpukhin et al., 2020) has become a widely used information retrieval method that utilizes dense vectors to semantically match queries and documents in the latent space. Compared with sparse retrieval methods, dense retrieval exploits the powerful modeling capabilities of pretrained language models (PLMs) and may overcome the linguistic mismatch problem. Therefore, dense retrieval has become popular in current retrieval technology.
In context learning, retrieval enhancement aims to improve the performance of LMs in downstream tasks by retrieving information-rich examples (Li et al., 2023; Luo et al., 2023). In previous studies, unsupervised sentence encoders have often encoded training examples and retrieved their nearest neighbors for each test instance (Liu et al., 2022). In some studies (Das et al., 2021), a supervised prompt retriever was trained to answer questions on a knowledge base. This retriever relies on the surface similarity to perform queries when it re-
ceives supervised training tailored to knowledgebased queries. However, these methods tap only into text associations, ignoring how the language model understands these texts.
To address this problem, some researchers (Rubin et al., 2021; Wang et al., 2023) have proposed using the LM to score examples to train retrievers. Unfortunately, these methods are limited because they are only applicable to frozen large language models. This constraint underscores the need for more versatile methodologies that can extend beyond the confines of frozen LMs to enhance the flexibility and generalizability of retriever training strategies.

heading: 3 Retrieval-Based Instruction Tuning
text: Figure 1 shows the overall framework of the proposed instruction-tuning method with retrievalbased example ranking for ABSA. The training process comprises two phases: example retrieval and task inference. For example retrieval, a retriever is used to select several candidates for a given sample. The inference LM was then used to measure the likelihood of ranking the target and candidates as scores. To train the retriever, we selected the top-k candidates as positive samples and the others as negative samples. Subsequently, contrastive learning is performed to propagate the gradients and update the retriever. For task inference, the retriever returns the most suitable examples and forms input instructions according to a predefined template. The negative log-likelihood of the generative results will train the LM.

heading: 3.1 Instruction Template
text: Figure 2 shows the instruction prompt template, which comprises a task definition, examples, and input text. In particular, a task <DEF> is available for different subtasks. For a given input text <xs>, examples <E> = {(x̂i, ŷi)}ki=1 are selected for instruction tuning, and the output conforms to the formats of the different subtasks. Thus, the instruction template for xs can be formally denoted as Tmpl(DEF, {x̂i, ŷi}ki=1, xs).
Figure 3 shows the instruction prompts generated using the ATE, ATSC, and ASPE templates. For ATSC, the aspect term is spliced together with the review text as input through the fixed prompt The aspect is, as shown in the underlined portion of Figure 3.

heading: 3.2 Example Retrieval
text: Candidate Generation. Training set D consists of several input-output pairs, i.e. D = {(xi, yi)}ni=1, where x is the text, and y is the label. For a target sample (xs, ys), retriever R returns the top-m candidates from the training set,
C = R((xs, ys), D) = {(x̂j , ŷj)}mj=1 (1) Sample (xs, ys) should be excluded from the retrieval results.
The LM adopted the encoder-decoder architecture of T5, which scores each candidate independently. The scoring function is the log-likelihood of output ys, which is consistent with the autoregressive decoding objective of the LM, and is denoted as
∆i = log p(ys|DEF, x̂i, ŷi, xs)
=
L∑
l=1
logp(yls | DEF, x̂i, ŷi, xs, y<ls ) (2)
where p(ys|DEF, x̂i, ŷi, xs) is the conditional probability of y given task definition <DEF>, input xs, and i-th candidate (x̂i, ŷi).
The candidate set is sorted in descending order according to the score ∆i. The top-k candidates form the set of positive samples C+, whereas the bottom-k candidates form the set of negative samples C−. Contrastive learning is then applied to train the retriever, allowing the retrieved results to be scored as high as possible.
To reduce the computational cost of the scoring function, only a portion of the training set with ratio r is extracted to select the positive and negative examples for the training of the retriever. Retriever Training. A contrastive learning objective trains the retriever. The input is (Input: <x̂i > Output: <ŷi>) for the candidates ci = (x̂i, ŷi) , and (Input: <xs>) for the target sample. Besides, we followed Sentence-T5 (Ni et al., 2022) to average the encoder output as the representation for the candidates and target sample,
hi = Mean(Enc(x̂i, ŷi)) (3)
hs = Mean(Enc(xs)) (4)
where hi and hs are the hidden representations of the i-th candidate and target sample, respectively. The distance for contrastive learning measures their inner products, and is denoted as
Sim(xs, ci) = h⊤s hi (5)
For the target sample, one positive example c+i is randomly selected from the set of positive samples C+, one negative example from the set of negative samples C−, and the other negative examples come from B − 1 positive and B − 1 negative examples sampled for the other samples in the same batch, where B is the batch size. The objective function minimizes the negative log-likelihood of the positive example for the target sample.
LCL(DEF, xs, c+, c−1 , . . . e−2B−1) =
− log e Sim(xs,c+)
eSim(xs,c+) + ∑2B−1 j=1 e Sim(xs,e−j )
(6)

heading: 3.3 Task Inference
text: We obtain the instruction template for inference by retrieving the top-k examples using the retriever. The LM predicts the probability of generating a
target ys, trained by minimizing the negative likelihood loss:
LNLL =
− L∑
l=1
logp(yls | DEF, {x̂i, ŷi}ki=1, xs, y<ls ) (7)
where L is the output length of the target sample. The LM receives input only in the form of instructions. Examples can be converted into instruction prompts using ATE, ATSC, and ASPE templates. To train the LM, only the top-1 scoring example is applied for fine-tuning,
ỹs = LM(Tmpl(DEF, x̂+1 , ŷ + 1 , xs)) (8)
For inference, instruction prompts are constructed using the top-k examples. Upon receiving instructions, the LM produces an output specific to the current task and input xs,
ỹs = LM(Tmpl(DEF, {x̂i, ŷi}ki=1, xs)) (9)

heading: 3.4 Alternating Training Schema
text: The training of a retriever depends on the scoring of the LM. However, the LM training requires
the retriever to form an instruction template. The instruction tuning performance depends on the collaborative effort between the two models.
Thus, we adopted an alternating training schema for the retriever and language models, as shown in Figure 4. In particular, the finetuned LM in the t−1 step is used as a scoring model to train the retriever in the t step. The LM in the t step is finetuned by the instruction generated by the updated retriever.

heading: 4 Experiments

heading: 4.1 Datasets
text: Experiments were conducted on the Semeval-2014, 15, and 16 datasets (Pontiki et al., 2014, 2015, 2016), which are benchmark dataset for the ABSA task. The benchmark comprises four datasets, including customer reviews from two domains, laptops (Lap14) and restaurants (Rest14, Rest15, and Rest16). The model performance was measured
using F1 scores for the ATE and ASPE tasks and accuracy for the ATSC task. Table 1 provides the details of the data distribution. Conflict labels were ignored.

heading: 4.2 Implementation Details
text: The LM was initialized using the flan-t5-base1. AdamW (Loshchilov and Hutter, 2019) was applied to optimize the model with an initial learning rate of 5e-5. The training batch size was 2. The gradient accumulation steps were set to 2. The number of epochs was 4 for the retriever, and 2 for the language model. The maximum sequence length was 128. Data ratio r of the training retriever was set to 0.1. The number of examples was one for the training phase and from zero to seven for the evaluation phase; in the comparative experiments, k was set to 4. The step t of alternating training schema was 3.

heading: 4.3 Baselines
text: The baseline models that emerged from the comparative experiments were categorized into generative and non-generative models,
• 1) Generative methods: GPT2med (HosseiniAsl et al., 2022), BARTABSA (Yan et al., 2021), GAS (Zhang et al., 2021), IT-MTL (Varia et al., 2022), InstructABSA (Scaria et al., 2023);
• 2) Non-generative methods: SPAN (Hu et al., 2019), GRACE (Luo et al., 2020), ABSA-DeBERTa (Marcacini and Silva, 2021), LSAT (Yang and Li, 2021), RACL-BERT (Chen and Qian, 2020), Dual-MRC (Mao et al., 2021), Seq2Path (Mao et al., 2022).
The number of paths k in Seq2Path is 4 and the results are from Mao et al. (2022). The results of other baselines are from Scaria et al. (2023). A more detailed descriptions about baselines are provided in Appendix A.

heading: 4.4 Comparative Results
text: Tables 2, 3, and 4 summarize the results of the proposed method relative to those of the baseline methods. The highest performance is in bold.
For the ATE task, the proposed method achieved F1 scores of 79.93 and 83.85 on the Rest15 and
1https://huggingface.co/google/flan-t5-base
Rest16 datasets, respectively, exceeding the baselines by 3.29% and 2.37%, respectively. In addition, it achieved better scores on the Lap14 and Rest14 datasets but was approximately 2% lower than InstructABSA, which used fixed examples. This might be related to the instruction template and the pre-trained language model. InstructABSA utilizes examples that distinguish between sentiment polarity and employs the pretrained language model tk-instruct-base-def-pos2, which could contribute to the performance variation. Nevertheless, the proposed model only performs worse than InstructABSA on the Rest14 and Lap14 datasets for the ATE task. We speculate two potential reasons for this:
1. The Rest14 and Lap14 datasets are larger thus have more retrievable examples compared to Rest15 and Rest16, resulting in increased uncertainties in example variations. This might lead the model to rely on the knowledge provided by the examples overly.
2. The ATE task might be relatively straightforward and offer limited knowledge for improvement.
2https://huggingface.co/allenai/tk-instruct-base-def-pos
For the ATSC task, the proposed method achieved optimal performances on the Lap14, Rest15, and Rest16 datasets, significantly outperforming the baselines (5-10% improvement) and achieving a similar performance to that of LSAT on the Rest14 dataset.
For the ASPE task, the proposed method surpassed the baselines on all four datasets, obtaining F1 scores of 81.49, 80.73, 73.41, and 78.64.
Moreover, for the ATSC task, the model performed better on smaller datasets (Rest15, Rest16) than on larger datasets (Lap14 and Rest14).

heading: 4.5 Number of Examples
text: To explore the impact of the number of examples on the performance, we used a retriever to extract different numbers of examples for model inference. The maximum number of examples was 7 to prevent the input text from exceeding the maximum sequence length of the model. Figure 5 shows the results.
Overall, the performances show two trends as the number of examples increases: (i) rising and then falling or (ii) rising. The use of examples
allows the model to achieve a significant performance gain. As the number of examples increases, the model can acquire more knowledge from beneficial examples. However, this performance enhancement trend is not always significant, and an increase in the number of examples can harm the model performance. Owing to the limited capacity of the retriever and limited number of beneficial examples for the query in the example pool, not all retrieved examples were beneficial or harmful to the query.

heading: 4.6 Ablation Study
text: Table 5 presents the results of the ablation study used to investigate the effectiveness of each component; w/o alternating training means that alternating training schema was not used; w/o retriever, the retriever was removed and fixed examples were used; w/o example, examples were not used; and w/o instruction, instruction prompts were not used. The results demonstrate the effectiveness of each part of the proposed method.
For further analysis, the performance decrease in the term w/o alternating training suggests that alternating training schema can better narrow the gap between the retriever and LM. Additionally, because the term w/o retriever outperforms the term w/o example overall, although inferior to the term w/o example in some cases, suggests that the model can learn from the examples, but fixed examples function differently for different target samples and are not conducive to inference for some extreme situations.

heading: 4.7 The Role of Fine-tuning Language Models
text: The Table 6 presents the results of our experiments. For the ATSC task, phrases such as The pizza is good and I think the pizza was good do not require
the LM to focus on semantic similarity or the connection between aspects and opinions. The LM can infer the result based on the retrieved example sentence’s output: positive, resulting in decent performance even without training. For the ATE task, the performance is poorer due to the low overlap in output results. For the more complex ASPE task, the retrieved example sentences should provide diverse assistance to the test sentences (including structural assistance and overlapping aspects). However, an untrained LM lacks this ability and tends to search for answers from the context rather than making inferences.
We further explored the retrieval results of the method that only trains the retriever. Compared to the proposed method, it favors retrieving example sentences with overlapping results and rarely retrieving other types of examples mentioned in the Case Study section. This limitation may hinder its effectiveness in handling complex tasks that require a deeper understanding of the context and relationships between different aspects.

heading: 4.8 Effectiveness on Different Language Models
text: The efficacy of our proposed method was examined across various backbone language models. The performance metrics for different variants in terms of sizes and types are detailed in Table 7. The results underscore the robust effectiveness of our proposed method across commonly used backbone models. Notably, employing larger models leads to discernible performance improvements. Particularly, the instruction pre-training variant, flan-t5, exhibits more substantial gains. This can be attributed to the smaller gap between the pre-training and fine-tuning phases.

heading: 4.9 Case Study
text: Table 8 provides an overview of the retrieval results for specific queries in the ASPE task. For clarity, only the first result retrieved is presented for each query. Notably, examples with IDs 1, 3, and 4 exhibit a structural similarity to the query. For instance, ID 2 mirrors the query’s aspects with the same sentiment polarity. While these instances showcase evidently favorable retrieval outcomes, there are cases where the utility of results is unclear. For instance, example ID 5 does not seem directly related to the query; however, the prediction for that particular query is accurate. Determining whether this is due to the LM disregarding irrelevant examples or if the example somehow contributes to the LM’s understanding remains an open question.

heading: 5 Conclusion
text: In this study, we proposed a retrieval-based example mining method for instructional learning in ABSA tasks to improve the performance by selecting effective examples. The proposed method conducts the alternating training of a retriever and LM by employing a two-stage training framework and iterative evolution training scheme. Experiments validated its effectiveness across ATE, ATSC, and ASPE tasks, outperforming existing baseline models.
Future work will extend the proposed method to other tasks and models and refine the training strategies to achieve further performance gains.
Limitations
There are three main limitations to our work compared to previous efforts:
1. The mechanism of retrieval is based on the likelihood score given by the language model, however, this score only focuses on the improvement of the model’s performance, and the syntactic mechanism of its work remains to be explored.
2. The choice of the number k of examples constrains the performance of the model. Although we explored the impact of using different numbers of examples on the overall performance, it is undeniable that the optimal number of examples varies for different test
inputs. Model performance would be further improved if the appropriate number of examples could be customized for each input.
3. The proposed method is only experimented on the English dataset. Whether it works equally well and whether the retrieved examples have commonalities is still unknown in other languages (e.g., Russian, French, Chinese, etc.). It remains to be explored whether the method will work on mixed language and multilingual datasets.

heading: Acknowledgements
text: This work was supported by the National Natural Science Foundation of China (NSFC) under Grant Nos.61966038 and 62266051, the Ministry of Science and Technology, Taiwan, ROC, under Grant No.MOST 111-2628-E-155-001-MY2, and the Exam-Exempted Postgraduate Research and Innovation Foundation of Yunnan University under Grant No.TM-23237123. The authors would like to thank the anonymous reviewers for their constructive comments.

heading: A Baseline Models
text: The baseline models that emerged from the comparative experiments were categorized into generative and non-generative models. This section describes these baseline models in detail. 1) Generative methods:
• GPT2med (Hosseini-Asl et al., 2022) utilizes unidirectional self-attention and language modeling loss to capture contextual representations and leverage supervision during training.
• BARTABSA (Yan et al., 2021) formulates the ABSA extraction and classification tasks as a unified index generation problem.
• GAS (Zhang et al., 2021) formulates each task as a generative problem and predictive normalization strategy to optimize the generated outputs.
• IT-MTL (Varia et al., 2022) treats ABSA as a sequence-to-sequence modeling task based on instruction tuning, achieving excellent performance with a few shots.
• InstructABSA (Scaria et al., 2023) constructs fixed instruction prompts for different tasks to train the Tk-instruct model (Wang et al., 2022), and the examples in the prompts are obtained from combinations of sentimentpositive, -negative, and -neutral examples. InstructABSA1 includes two positive and two negative sentiment examples, while InstructABSA2 adds two neutral sentiment examples.

heading: 2) Non-generative methods:
text: • SPAN (Hu et al., 2019) use a span-based labeling scheme to find and classify opinion targets in a sentence, which mitigates the problem of sentimental inconsistencies at the span level.
• GRACE (Luo et al., 2020) employs cascade labeling to enhance the interaction between aspect terms and mitigates the labeling imbalance through a gradient harmonization approach.
• ABSA-DeBERTa (Marcacini and Silva, 2021) uses a decoupled attention mechanism to separate location and content vectors for sentiment analysis.
• LSAT (Yang and Li, 2021) introduces a local sentiment aggregation paradigm that facilitates fine-grained sentiment consistency modeling.
• RACL-BERT (Chen and Qian, 2020) allows subtasks to work together in stacked multilayer networks via multitask learning and relationship propagation mechanisms.
• Dual-MRC (Mao et al., 2021) converts the original triplet extraction task into two machine reading comprehension (MRC) problems, and jointly trains multiple subtasks.
• Seq2Path (Mao et al., 2022) transforms the generation order of sentiment tuples into tree paths. This approach not only effectively addresses the issue of one aspect entity corresponding to multiple opinion words, but also ensures that the generation of each path is independent.

heading: Future Work
text: Future work will extend the proposed method to other tasks and models and refine the training strategies to achieve further performance gains. Limitations
There are three main limitations to our work compared to previous efforts:
1. The mechanism of retrieval is based on the likelihood score given by the language model, however, this score only focuses on the improvement of the model’s performance, and the syntactic mechanism of its work remains to be explored. 2. The choice of the number k of examples constrains the performance of the model. Although we explored the impact of using different numbers of examples on the overall performance, it is undeniable that the optimal number of examples varies for different test
inputs. Model performance would be further improved if the appropriate number of examples could be customized for each input. 3. The proposed method is only experimented on the English dataset. Whether it works equally well and whether the retrieved examples have commonalities is still unknown in other languages (e. g. , Russian, French, Chinese, etc. ). It remains to be explored whether the method will work on mixed language and multilingual datasets