arXiv:2012.15723 · 中英对照阅读
让预训练语言模型成为更好的少样本学习者
Making Pre-trained Language Models Better Few-shot Learners
中文速览
小样本任务常常只有几十条标注数据,常规微调容易学不稳,研究者因此想让较小、能在普通硬件上训练的语言模型也能学得更好。LM-BFF把任务改写成填空式提示,让模型用已有词汇直接作答,并自动搜索合适的提示和答案词;同时,它会为每个输入挑选有用的示例作参考。对15种分类和回归任务的测试显示,这些方法比常规微调平均提升11个百分点,最高提升30个百分点,用32条样本时也能在不少二分类任务上达到约90%的准确率。它的重要意义在于,不必依赖超大模型、丰富标注或专业人员手工设计提示,也能更可靠地从少量数据中学会新任务。
摘要
近期的 GPT-3 模型 Brown 等人(2020)仅凭借自然语言提示以及作为输入上下文的少量任务示例,便取得了显著的少样本表现。受其发现启发,我们研究一种更具实用性的场景中的少样本学习:在该场景中,我们使用规模较小、微调所需计算开销较低的语言模型。我们提出 LM-BFF——更优的语言模型少样本微调¹——这是一套简单且互补的技术,用于在少量标注样例上微调语言模型。我们的方法包括:(1)基于提示的微调,以及一种用于自动化提示生成的新流程;(2)一种改进的策略,用于动态、有选择地将示例纳入每个上下文。最后,我们提出一套系统的评估方法,用于分析多种自然语言处理任务上的少样本表现,包括分类和回归。实验表明,在这一低资源设定下,我们的方法相结合,显著优于标准微调流程,绝对提升最高可达 30%,所有任务的平均提升为 11%。我们的方法对任务资源和领域专业知识的假设极少,因此构成了一种强大的任务无关少样本学习方法。² ¹ 或者说,语言模型永远最好的朋友。 ² 我们的实现已公开发布于 https://github.com/princeton-nlp/LM-BFF。
The recent GPT-3 model Brown et al. (2020) achieves remarkable few-shot performance solely by leveraging a natural-language prompt and a few task demonstrations as input context. Inspired by their findings, we study few-shot learning in a more practical scenario, where we use smaller language models for which fine-tuning is computationally efficient. We present LM-BFF—better few-shot fine-tuning of language models11 1 Alternatively, language models’ best friends forever.---a suite of simple and complementary techniques for fine-tuning language models on a small number of annotated examples. Our approach includes (1) prompt-based fine-tuning together with a novel pipeline for automating prompt generation; and (2) a refined strategy for dynamically and selectively incorporating demonstrations into each context. Finally, we present a systematic evaluation for analyzing few-shot performance on a range of NLP tasks, including classification and regression. Our experiments demonstrate that our methods combine to dramatically outperform standard fine-tuning procedures in this low resource setting, achieving up to 30% absolute improvement, and 11% on average across all tasks. Our approach makes minimal assumptions on task resources and domain expertise, and hence constitutes a strong task-agnostic method for few-shot learning.22 2 Our implementation is publicly available at https://github.com/princeton-nlp/LM-BFF.
术语表
- GPT-3
- GPT-3
- LM-BFF
- LM-BFF
- BERT
- BERT
- RoBERTa
- RoBERTa
- T5
- T5
- few-shot learning
- 少样本学习
- few-shot setting
- 少样本设定
- fine-tuning
- 微调
- prompt-based fine-tuning
- 基于提示的微调
- prompt-based prediction
- 基于提示的预测
- prompt
- 提示
- template
- 模板
- label word
- 标签词
- automatic prompt generation
- 自动提示生成
- automatic prompt search
- 自动提示搜索
- brute-force search
- 暴力搜索
- decoding objective
- 解码目标
- in-context learning
- 上下文学习
- demonstration
- 示例
- demonstration set
- 示例集
- masked language modeling
- 掩码语言建模
- downstream task
- 下游任务
- language model
- 语言模型
- pre-trained language model
- 预训练语言模型
- semi-supervised learning
- 半监督学习
- meta-learning
- 元学习
- intermediate training
- 中间训练
- classification
- 分类
- regression
- 回归
- task-agnostic
- 任务无关