SuperGLUE:比GLUE更难的NLP评测基准,评估大规模预训练语言模型

SuperGLUE(Super General Language Understanding Evaluation)

SuperGLUE(Super General Language Understanding Evaluation)是 比 GLUE 更难的 NLP 评测基准,用于评估 大规模预训练语言模型(如 T5、GPT-3、PaLM)自然语言理解能力

它是 GLUE Benchmark(2018) 的升级版,专为 更先进的 NLP 模型 设计,涵盖 多种复杂任务,如 多轮对话推理、常识推理、阅读理解 等。


1. 为什么需要 SuperGLUE?

GLUE 是 2018 年提出的 NLP 评测基准,适用于 BERT、RoBERTa 等模型,但:

  • 2019 年后,BERT 级别的模型已在 GLUE 上超越人类水平
  • GLUE 任务相对简单,无法有效衡量 GPT-3、T5、PaLM 这样的 超大规模 NLP 模型
  • SuperGLUE 提供更复杂的推理任务,更接近人类认知水平。

2. SuperGLUE vs GLUE

对比项GLUESuperGLUE
任务数量98
任务类型句子分类、文本蕴含复杂推理、常识推理、多轮问答
难度较简单(适合 BERT)更难(适合 GPT-3、T5、PaLM)
适用模型BERT、RoBERTa、T5T5、GPT-3、PaLM
人类基准87.189.8

SuperGLUE 任务比 GLUE 更贴近真实 NLP 应用,比如:

  • 需要 复杂的推理
  • 涉及 跨句关系
  • 更接近人类思维模式

3. SuperGLUE 任务

SuperGLUE 包含 8 个更具挑战性的 NLP 任务,主要涉及 多轮对话、常识推理、阅读理解

任务任务类型训练样本数评估指标
BoolQ判断问题能否从文章中回答(二分类)16K准确率
CB文本蕴含(判断句子逻辑关系)250F1 / 准确率
COPA因果推理(选择正确的因果关系)400准确率
MultiRC多选阅读理解(判断多个答案的正确性)27KF1 / 准确率
ReCoRD阅读理解(填空题形式)120KF1 / 准确率
RTE文本蕴含(类似 MNLI)2.5K准确率
WiC同义词消歧(判断一个单词在两句话中的含义是否相同)6K准确率
WSCWinograd 指代消解(判断代词指代的对象)554准确率

4. SuperGLUE 任务示例

BoolQ(布尔问答)

任务:判断一个 Yes/No 问题 是否可以从文章中得到答案(二分类任务)。

文章问题答案
The Eiffel Tower is located in Paris, France.Is the Eiffel Tower in Germany?No
The Amazon Rainforest is the largest tropical rainforest on Earth.Is the Amazon the smallest forest?No

CB(CommitmentBank,文本蕴含)

任务:判断两个句子是否具有 蕴含、矛盾、中立 关系(三分类任务)。

句子 1句子 2关系
A man is playing a guitar.A musician is performing.Entailment(蕴含)
A child is reading a book.A person is swimming.Contradiction(矛盾)

COPA(因果推理)

任务:给定一个事件,从 两个选项 中选择 最可能的因果关系二分类任务)。

事件选项 A选项 B选择
The man fell off his bike.He lost his balance.He bought a new phone.A
The child cried.The child won a prize.The child dropped their ice cream.B

WSC(Winograd 指代消解)

任务:判断句子中的 代词 指代的是哪个名词(二分类任务)。

句子代词指代对象
The city council refused the demonstrators a permit because they feared violence.theycity council
The trophy doesn’t fit into the brown suitcase because it is too large.ittrophy

5. SuperGLUE Benchmark 评分

SuperGLUE 评分 综合 8 个任务的表现,以下是 NLP 预训练模型的 SuperGLUE 评分:

模型SuperGLUE 总分
人类(Human)89.8
BERT (2018)69.0
RoBERTa (2019)80.5
T5-11B (2020)88.9
GPT-3 (2020)85.5
PaLM-540B (2022)90.9

GPT-3 和 PaLM 等 大规模 NLP 模型 已在 SuperGLUE 上超过人类水平。


6. 如何在 SuperGLUE 上测试 NLP 模型

使用 Hugging Face datasets

from datasets import load_dataset

# 加载 COPA(SuperGLUE 任务之一)
dataset = load_dataset("super_glue", "copa")

# 查看数据
print(dataset["train"][0])

使用 transformers 微调 BERT

from transformers import AutoTokenizer, AutoModelForSequenceClassification, Trainer, TrainingArguments

# 加载预训练 BERT 模型
tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")
model = AutoModelForSequenceClassification.from_pretrained("bert-base-uncased", num_labels=2)

# 处理数据
def preprocess(examples):
    return tokenizer(examples["premise"], examples["choice1"], truncation=True, padding="max_length")

encoded_dataset = dataset.map(preprocess, batched=True)

# 训练参数
training_args = TrainingArguments(output_dir="./results", evaluation_strategy="epoch")

trainer = Trainer(model=model, args=training_args, train_dataset=encoded_dataset["train"], eval_dataset=encoded_dataset["validation"])

# 开始训练
trainer.train()

7. 结论

  • SuperGLUE 是比 GLUE 更难的 NLP 评测基准,专为 T5、GPT-3、PaLM 级别的模型 设计。
  • 包含 8 个任务,涉及 因果推理、阅读理解、文本蕴含、指代消解高难度 NLP 任务
  • GPT-3、PaLM 等大规模 Transformer 模型已超越人类水平,但仍有改进空间。
  • Hugging Face 提供了 SuperGLUE 数据集,可用于训练和评估 大型预训练语言模型
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

彬彬侠

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值