Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

In-Context Learning for Text Classification with Many Labels

About

In-context learning (ICL) using large language models for tasks with many labels is challenging due to the limited context window, which makes it difficult to fit a sufficient number of examples in the prompt. In this paper, we use a pre-trained dense retrieval model to bypass this limitation, giving the model only a partial view of the full label space for each inference call. Testing with recent open-source LLMs (OPT, LLaMA), we set new state of the art performance in few-shot settings for three common intent classification datasets, with no finetuning. We also surpass fine-tuned performance on fine-grained sentiment classification in certain cases. We analyze the performance across number of in-context examples and different model scales, showing that larger models are necessary to effectively and consistently make use of larger context lengths for ICL. By running several ablations, we analyze the model's use of: a) the similarity of the in-context examples to the current input, b) the semantic content of the class names, and c) the correct correspondence between examples and labels. We demonstrate that all three are needed to varying degrees depending on the domain, contrary to certain recent works.

Aristides Milios, Siva Reddy, Dzmitry Bahdanau• 2023

Related benchmarks

TaskDatasetResultRank
Intent ClassificationHWU64 10-shot
Accuracy88.1
20
Intent ClassificationBANKING77 10-shot
Accuracy85.88
20
Intent ClassificationCUREKART HINT3 (test)
Accuracy90.02
9
Intent ClassificationPOWERPLAY11 HINT3 (test)
Accuracy71.2
9
Intent ClassificationCLINC150 DialoGLUE 10-shot
Accuracy95.36
9
Intent ClassificationSOFMATTRESS HINT3 (test)
Accuracy83.79
9
Showing 6 of 6 rows

Other info

Follow for update