'One size doesn't fit all': Learning how many Examples to use for In-Context Learning for Improved Text Classification
Chandra, Manish, Ganguly, Debasis, Li, Yiwen, Ounis, Iadh
–arXiv.org Artificial Intelligence
Predictive models in natural language processing (NLP) have evolved from training models from scratch to fine-tuning pre-trained models with labelled data. An extreme form of this fine-tuning involves in-context learning (ICL), where the output of a pre-trained generative model (frozen decoder parameters) is controlled only with variations in the input strings (called instructions or prompts). An important component of ICL is the use of a small number of labelled data instances as examples in the prompt. While existing work uses a static number of examples during inference for each data instance, in this paper we propose a novel methodology of dynamically adapting the number of examples as per the data. This is analogous to the use of a variable-sized neighborhood in k-nearest neighbors (k-NN) classifier. In our proposed workflow of adaptive ICL (AICL), the number of demonstrations to employ during the inference on a particular data instance is predicted by the Softmax posteriors of a classifier. The parameters of this classifier are fitted on the optimal number of examples in ICL required to correctly infer the label of each instance in the training set with the hypothesis that a test instance that is similar to a training instance should use the same (or a closely matching) number of few-shot examples. Our experiments show that our AICL method results in improvement in text classification task on several standard datasets.
arXiv.org Artificial Intelligence
Mar-10-2024
- Country:
- North America
- United States
- Washington > King County
- Seattle (0.14)
- New York > New York County
- New York City (0.04)
- Arizona > Maricopa County
- Tempe (0.04)
- Washington > King County
- Canada > Ontario
- Toronto (0.04)
- United States
- Europe
- Spain (0.04)
- United Kingdom > Scotland
- City of Glasgow > Glasgow (0.04)
- Ireland > Leinster
- County Dublin > Dublin (0.04)
- Belgium > Brussels-Capital Region
- Brussels (0.04)
- Asia
- Singapore (0.04)
- Middle East > UAE
- Abu Dhabi Emirate > Abu Dhabi (0.04)
- North America
- Genre:
- Research Report (1.00)
- Industry:
- Leisure & Entertainment (0.68)
- Technology: