mlsanityData to 14 Oct 2026

In-Context Learning for Text Classification with Many Labels

arXiv 2309.10954 ↗First posted 19 Sep 2023cs.CL cs.LGcited by 35

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 35 papers in the map (data through 14 Oct 2026). Builds on 30 of its 38 references that are in the map. First posted on arXiv 19 Sep 2023.

Builds on

30 of 38 references.

References · 30

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  3. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  4. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  5. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
  6. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
  7. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,455
  8. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  9. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,392
  10. 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,202
  11. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
  12. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
18 more
  1. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  2. 2022Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learningcited by 896
  3. 2023REPLUG: Retrieval-Augmented Black-Box Language Modelscited by 792
  4. 2023In-Context Retrieval-Augmented Language Modelscited by 702
  5. 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
  6. 2020GoEmotions: A Dataset of Fine-Grained Emotionscited by 486
  7. 2020MAD-X: An Adapter-Based Framework for Multi-Task Cross-Lingual Transfercited by 445
  8. 2020AdapterHub: A Framework for Adapting Transformerscited by 444
  9. 2020Efficient Intent Detection with Dual Sentence Encoderscited by 433
  10. 2023Larger language models do in-context learning differentlycited by 394
  11. 2019An Evaluation Dataset for Intent Classification and Out-of-Scope Predictioncited by 386
  12. 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
  13. 2019Benchmarking Natural Language Understanding Services for building Conversational Agentscited by 166
  14. 2022Impact of Pretraining Term Frequencies on Few-Shot Reasoningcited by 142
  15. 2022Efficient Few-Shot Learning Without Promptscited by 137
  16. 2022State-of-the-art generalisation research in NLP: A taxonomy and reviewcited by 98
  17. 2020DialoGLUE: A Natural Language Understanding Benchmark for Task-Oriented Dialoguecited by 89
  18. 2021ConvFiT: Conversational Fine-Tuning of Pretrained Language Modelscited by 25

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 22; 2025: 9; 2026: 4.

35 papers.

Sort:

By area:

  1. 2024A Survey on RAG Meeting LLMs: Towards Retrieval-Augmented Large Language Modelscited by 452
  2. 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 128
  3. 2024In-context Learning with Retrieved Demonstrations for Language Models: A Surveycited by 70
  4. 2024UnUnlearning: Unlearning is not sufficient for content regulation in advanced generative AIcited by 51
  5. 2024RepLiQA: A Question-Answering Dataset for Benchmarking LLMs on Unseen Reference Contentcited by 26
  6. 2024On the Noise Robustness of In-Context Learning for Text Generationcited by 16
  7. 2024Are Large Language Models Good Classifiers? A Study on Edit Intent Classification in Scientific Document Revisionscited by 11
  8. 2024Mitigating Boundary Ambiguity and Inherent Bias for Text Classification in the Era of Large Language Modelscited by 9
  9. 2024Unraveling the Mechanics of Learning-Based Demonstration Selection for In-Context Learningcited by 9
  10. 2024Paraphrase and Aggregate with Large Language Models for Minimizing Intent Classification Errorscited by 9
  11. 2025ICLShield: Exploring and Mitigating In-Context Learning Backdoor Attackscited by 9
  12. 2024Re-examining Sexism and Misogyny Classification with Annotator Attitudescited by 8
23 more
  1. 2025The Few-shot Dilemma: Over-prompting Large Language Modelscited by 8
  2. 2024Memorization in In-Context Learningcited by 6
  3. 2024ESPERANTO: Evaluating Synthesized Phrases to Enhance Robustness in AI Detection for Text Originationcited by 6
  4. 2024Vulnerability of LLMs to Vertically Aligned Text Manipulationscited by 6
  5. 2024Dynamic Label Name Refinement for Few-Shot Dialogue Intent Classificationcited by 6
  6. 2025GenCLS++: Pushing the Boundaries of Generative Classification in LLMs Through Comprehensive SFT and RL Studies Across Diverse Datasetscited by 6
  7. 2024Grimoire is All You Need for Enhancing Large Language Modelscited by 4
  8. 2024One size doesn't fit all: Predicting the Number of Examples for In-Context Learningcited by 4
  9. 2024Few-shot Prompting for Pairwise Ranking: An Effective Non-Parametric Retrieval Modelcited by 4
  10. 2025In-Context Learning (and Unlearning) of Length Biasescited by 3
  11. 2024When LLMs are Unfit Use FastFit: Fast and Effective Text Classification with Many Classescited by 2
  12. 2024RARe: Retrieval Augmented Retrieval with In-Context Examplescited by 2
  13. 2025Incomplete In-context Learningcited by 2
  14. 2025Mitigating Label Length Bias in Large Language Modelscited by 2
  15. 2024Effective Self-Mining of In-Context Examples for Unsupervised Machine Translation with LLMscited by 1
  16. 2025Leveraging In-Context Learning and Retrieval-Augmented Generation for Automatic Question Generation in Educational Domainscited by 1
  17. 2025From Annotation to Adaptation: Metrics, Synthetic Data, and Aspect Extraction for Aspect-Based Sentiment Analysis with Large Language Modelscited by 1
  18. 2024Logit Separability-Driven Samples and Multiple Class-Related Words Selection for Advancing In-Context Learningcited by 0
  19. 2025FoodTaxo: Generating Food Taxonomies with Large Language Modelscited by 0
  20. 2026GenAI for Social Work Field Education: Client Simulation with Real-Time Feedbackcited by 0
  21. 2026Against Political Polarization: A Unified Framework for Tracing Evolving Political Ideologies on Social Mediacited by 0
  22. 2026How to Estimate Whether You Have Found Several Needles in a Haystack: Measuring Calibration in Multi-Label Text Classificationcited by 0
  23. 2026TermJudge: A Document-Level Metric Judging, Not Counting, Terminology in Machine Translation Evaluationcited by 0