
如果您已了解 T5,那么 FLAN-T5 在各方面都更胜一筹。在参数数量相同的情况下,这些模型在 1000 多个额外任务上进行了微调,涵盖的语言也更多。
正如摘要开头所述:
Flan-PaLM 540B 在多个基准测试中取得了最先进的性能,例如在五轮提示的 MMLU 上达到 75.2%。我们还公开发布了 Flan-T5 检查点,1 即使与更大的模型(如 PaLM 62B)相比,也能实现强大的少样本性能。总体而言,指令微调是一种提高预训练语言模型性能和可用性的通用方法。
免责声明:本模型卡片中的内容由 Hugging Face 团队撰写。
在原始 README 中增加了 CANN 版本依赖说明,并修改了示例代码。
以下是在 openmind 中使用该模型的一些示例脚本:
from openmind import AutoTokenizer
from transformers import T5ForConditionalGeneration
device = "npu:0"
model_name = "PyTorch-NPU/flan_t5_small"
tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
model = T5ForConditionalGeneration.from_pretrained(model_name).to(device)
model_inputs = tokenizer(["Life is like a box of chocolates.", "Today is Monday."], padding="longest",
return_tensors="pt").to(device)
labels_dict = tokenizer(["La vie est comme une boîte de chocolat.", "Aujourd'hui c'est lundi."], padding="longest",
return_tensors="pt").to(device)
labels = labels_dict.input_ids
loss = model(**model_inputs, labels=labels).loss
print()
print("loss:", loss.item())
作者在原始论文的模型卡片中写道:
主要用途是语言模型研究,包括:零样本自然语言处理任务和上下文少样本学习自然语言处理任务的研究,例如推理和问答;推进公平性和安全性研究,以及理解当前大型语言模型的局限性。
更多详情请参见研究论文。
需要更多信息。
本节以下信息复制自模型的官方模型卡片:
根据Rae等人(2021)的研究,包括Flan-T5在内的语言模型有可能被用于有害的语言生成。在未针对特定应用的安全性和公平性问题进行事先评估的情况下,Flan-T5不应直接用于任何应用。
Flan-T5在大量文本数据语料库上进行微调,这些数据未经过滤以排除显式内容,也未对其中存在的偏见进行评估。因此,该模型本身可能容易生成同样不适当的内容,或复制底层数据中固有的偏见。
Flan-T5尚未在实际应用场景中进行测试。
Flan-T5不应应用于任何不可接受的用例,例如生成辱骂性言论。
该模型在多种任务的混合数据上进行训练,包括下表中描述的任务(来自原始论文,图2):

根据原始论文中的模型卡片:
这些模型基于预训练的T5(Raffel等人,2020),并通过指令进行微调,以获得更好的零样本和少样本性能。每种T5模型大小对应一个经过微调的Flan模型。
该模型在TPU v3或TPU v4 pods上进行训练,使用t5x代码库以及jax。
作者在涵盖多种语言(共1836种)的各类任务上对模型进行了评估。部分定量评估结果如下表所示:
完整详情请查阅研究论文。
FLAN-T5-Small的完整结果,请参见研究论文中的表3。
可使用Lacoste等人(2019)提出的机器学习影响计算器来估算碳排放。
BibTeX:
@misc{https://doi.org/10.48550/arxiv.2210.11416,
doi = {10.48550/ARXIV.2210.11416},
url = {https://arxiv.org/abs/2210.11416},
author = {Chung, Hyung Won and Hou, Le and Longpre, Shayne and Zoph, Barret and Tay, Yi and Fedus, William and Li, Eric and Wang, Xuezhi and Dehghani, Mostafa and Brahma, Siddhartha and Webson, Albert and Gu, Shixiang Shane and Dai, Zhuyun and Suzgun, Mirac and Chen, Xinyun and Chowdhery, Aakanksha and Narang, Sharan and Mishra, Gaurav and Yu, Adams and Zhao, Vincent and Huang, Yanping and Dai, Andrew and Yu, Hongkun and Petrov, Slav and Chi, Ed H. and Dean, Jeff and Devlin, Jacob and Roberts, Adam and Zhou, Denny and Le, Quoc V. and Wei, Jason},
keywords = {Machine Learning (cs.LG), Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Scaling Instruction-Finetuned Language Models},
publisher = {arXiv},
year = {2022},
copyright = {Creative Commons Attribution 4.0 International}
}