Skip to main content
QUICK REVIEW

[论文解读] Language Models for Text Classification: Is In-Context Learning Enough?

Aleksandra Edwards, José Camacho-Collados|arXiv (Cornell University)|Mar 26, 2024
Text and Document Classification TechnologiesComputer Science被引用 8
一句话总结

本论文在16个数据集上对大语言模型的零-shot和少-shot提示与经过微调的较小模型进行大规模评估,结果发现经过微调的较小模型通常优于少-shot的LLMs,尽管在某些任务的低资源设置中提示方法显示出优势。

ABSTRACT

Recent foundational language models have shown state-of-the-art performance in many NLP tasks in zero- and few-shot settings. An advantage of these models over more standard approaches based on fine-tuning is the ability to understand instructions written in natural language (prompts), which helps them generalise better to different tasks and domains without the need for specific training data. This makes them suitable for addressing text classification problems for domains with limited amounts of annotated instances. However, existing research is limited in scale and lacks understanding of how text generation models combined with prompting techniques compare to more established methods for text classification such as fine-tuning masked language models. In this paper, we address this research gap by performing a large-scale evaluation study for 16 text classification datasets covering binary, multiclass, and multilabel problems. In particular, we compare zero- and few-shot approaches of large language models to fine-tuning smaller language models. We also analyse the results by prompt, classification type, domain, and number of labels. In general, the results show how fine-tuning smaller and more efficient language models can still outperform few-shot approaches of larger language models, which have room for improvement when it comes to text classification.

研究动机与目标

  • 评估零-shot 与少-shot 提示在文本分类任务中,与微调较小模型相比,LLMs 的表现有多好。
  • 识别提示与微调在二分类、多分类与多标签任务中的优点与缺点。
  • 分析跨领域、数据集属性和标签数量的性能趋势,以理解泛化性和局限性。

提出的方法

  • 在16个数据集上评估五种模型类型(生成性LLMs、RoBERTa base/large、T5、Flan-T5、FastText),覆盖二分类、 multiclass、多标签任务。
  • 比较对LLaMA-1、LLaMA-2、Flan-T5和GPT-3.5-Turbo的零-shot和一-shot提示,与微调基线(RoBERTa、T5、FastText)进行比较。
  • 使用三种提示风格(通用、任务、领域)来评估提示敏感性。
  • 对每个数据集微调RoBERTa和T5,并与提示基线进行比较。
  • 报告微观F1和宏观F1,以及跨数据集和领域的错误标签计数。
Figure 1: Micro-F1 (left) and Macro-F1 (middle) results averaged across all datasets, comparing the performance of Flan-T5, LLaMA 1, and LLaMA 2 models for all three types of prompts, i.e., ’generic’ , ’task’ , and ’domain’ as well as the average (’AVG’) between them. ’Missing label’ (right) shows t
Figure 1: Micro-F1 (left) and Macro-F1 (middle) results averaged across all datasets, comparing the performance of Flan-T5, LLaMA 1, and LLaMA 2 models for all three types of prompts, i.e., ’generic’ , ’task’ , and ’domain’ as well as the average (’AVG’) between them. ’Missing label’ (right) shows t

实验结果

研究问题

  • RQ1LLMs的零-shot和一-shot提示与微调较小语言模型在文本分类任务中的表现有多大差异?
  • RQ2在二分类、 多类和多标签分类任务中,基于提示的方法是否比微调更数据高效?
  • RQ3在不同领域和标签数量下,LLM提示与微调各自的优缺点?
  • RQ4提示设计(通用、任务、领域)如何影响模型的表现和鲁棒性?
  • RQ5领域特定或任务特定的数据集是否在提示与微调方面呈现不同的趋势?

主要发现

  • 微调后的较小语言模型(如RoBERTa)在文本分类任务上往往优于对较大LLMs进行少-shot提示。
  • 在提示模型中,Flan-T5在零-shot和一-shot设置下通常在微观F1和宏观F1方面高于LLaMA变体。
  • 一-shot 提示通常提升性能并减少错误标签,在所有模型中,Flan-T5显示出显著收益。
  • 对于多类和多标签任务,微调的掩码语言模型往往超过提示方法,表明在复杂分类中LLM提示仍有改进空间。
  • 提示选择对模型行为的影响有限,但像Flan-T5这样的较小模型在零-shot设置下对提示更敏感。
  • 在广泛的领域(包括法律、医疗、犯罪),微调仍具有竞争力或优于多数数据集,而提示在低资源场景中有价值。
Figure 2: Comparison between prompting (left) and fine-tuning (right) approaches per text classification type where ’AVG’ refers to averaged results across all prompt types per model. In ’Prompting’, ’zero’ and ’one’ refer to zero- and one- shot prompt-based learning techniques, in ’Fine Tuning’, ’o
Figure 2: Comparison between prompting (left) and fine-tuning (right) approaches per text classification type where ’AVG’ refers to averaged results across all prompt types per model. In ’Prompting’, ’zero’ and ’one’ refer to zero- and one- shot prompt-based learning techniques, in ’Fine Tuning’, ’o

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。