arXiv:2005.14165 · 中英对照阅读
语言模型是少样本学习者
Language Models are Few-Shot Learners
中文速览
过去的语言模型往往要为每项任务准备大量标注样本再训练,换个任务就不够灵活;研究者想知道,把模型做得更大,能不能让它只看说明和少量例子就上手。为此,他们训练了拥有 1750 亿参数的 GPT-3,让它不更新模型参数,只靠提示文字和上下文中的示范来完成任务,并测试了从翻译、问答到算术和新词运用等多种任务。结果显示,模型越大、给的示范越多,表现通常越好;它在不少任务上达到接近甚至超过当时微调模型的水平,也能写出让人难辨真假的新闻,但在一些推理和阅读理解任务上仍表现不佳,训练数据与测试题重叠也可能抬高成绩。这项工作表明,语言模型有机会像人一样凭少量例子快速切换任务,同时也提醒人们,大模型的能力边界、偏见和误导风险都需要认真检验。
摘要
近期研究表明,在大规模文本语料库上进行预训练,随后针对特定任务进行微调,能够显著提升自然语言处理中的许多任务和基准测试的性能。尽管这种方法在架构上通常是任务无关的,但仍然需要包含数千乃至数万个示例的任务特定微调数据集。相比之下,人类通常仅凭少数示例或简单指令就能完成新的语言任务,而当前的自然语言处理系统在很大程度上仍难以做到这一点。本文表明,扩大语言模型的规模能够显著提升任务无关的少样本性能,有时甚至可以达到与此前最先进微调方法相当的竞争力。具体而言,我们训练了GPT-3,这是一种拥有1750亿参数的自回归语言模型,其参数量是此前任何非稀疏语言模型的10倍,并在少样本设置下测试其性能。对于所有任务,GPT-3都不进行任何梯度更新或微调,而是纯粹通过与模型的文本交互来指定任务和少样本示例。GPT-3在许多自然语言处理数据集上取得了出色的性能,包括翻译、问答和完形填空任务,以及若干要求即时推理或领域适应的任务,例如重新排列打乱的单词、在句子中使用新词,或进行三位数算术运算。与此同时,我们还发现,GPT-3的少样本学习在某些数据集上仍然表现不佳;此外,在一些数据集上,GPT-3还面临与在大规模网络语料库上训练相关的方法学问题。最后,我们发现,GPT-3能够生成新闻文章样本,使人类评估者难以将其与人类撰写的文章区分开来。我们讨论了这一发现以及GPT-3总体上可能带来的更广泛社会影响。
Recent work has demonstrated substantial gains on many NLP tasks and benchmarks by pre-training on a large corpus of text followed by fine-tuning on a specific task. While typically task-agnostic in architecture, this method still requires task-specific fine-tuning datasets of thousands or tens of thousands of examples. By contrast, humans can generally perform a new language task from only a few examples or from simple instructions – something which current NLP systems still largely struggle to do. Here we show that scaling up language models greatly improves task-agnostic, few-shot performance, sometimes even reaching competitiveness with prior state-of-the-art fine-tuning approaches. Specifically, we train GPT-3, an autoregressive language model with 175 billion parameters, 10x more than any previous non-sparse language model, and test its performance in the few-shot setting. For all tasks, GPT-3 is applied without any gradient updates or fine-tuning, with tasks and few-shot demonstrations specified purely via text interaction with the model. GPT-3 achieves strong performance on many NLP datasets, including translation, question-answering, and cloze tasks, as well as several tasks that require on-the-fly reasoning or domain adaptation, such as unscrambling words, using a novel word in a sentence, or performing 3-digit arithmetic. At the same time, we also identify some datasets where GPT-3’s few-shot learning still struggles, as well as some datasets where GPT-3 faces methodological issues related to training on large web corpora. Finally, we find that GPT-3 can generate samples of news articles which human evaluators have difficulty distinguishing from articles written by humans. We discuss broader societal impacts of this finding and of GPT-3 in general.
术语表
- NLP
- 自然语言处理
- pre-training
- 预训练
- fine-tuning
- 微调
- task-agnostic
- 任务无关
- downstream transfer
- 下游迁移
- language representation
- 语言表示
- word vectors
- 词向量
- RNN
- 循环神经网络
- Transformer
- Transformer
- autoregressive language model
- 自回归语言模型
- GPT-3
- GPT-3
- few-shot learning
- 少样本学习
- one-shot learning
- 单样本学习
- zero-shot learning
- 零样本学习
- in-context learning
- 上下文学习
- meta-learning
- 元学习
- inference-time demonstration
- 推理时示例
- gradient update
- 梯度更新
- context window
- 上下文窗口
- task-specific dataset
- 特定任务数据集
- supervised training dataset
- 监督训练数据集
- out-of-distribution generalization
- 分布外泛化
- spurious correlation
- 虚假相关
- log loss
- 对数损失
- reading comprehension
- 阅读理解
- question answering
- 问答
- textual entailment
- 文本蕴含
- cloze task
- 完形填空任务
- domain adaptation
- 领域适应
- Natural Questions
- Natural Questions