# MADLAD-400

## 概述

MADLAD-400 模型在论文 [MADLAD-400: A Multilingual And Document-Level Large Audited Dataset](https://huggingface.co/papers/2309.04662) 中发布。

该论文的摘要如下：

*我们推出了 MADLAD-400，这是一个基于 CommonCrawl 的、经过人工审核的通用领域 3T token 单语数据集，涵盖 419 种语言。我们讨论了通过自我审核 MADLAD-400 所揭示的局限性，以及数据审核在数据集创建过程中的作用。随后，我们使用公开可用的数据，在覆盖 450 多种语言的 2500 亿 token 上训练并发布了一个 10.7B 参数的多语言机器翻译模型，发现其性能与显著更大的模型具有竞争力，并报告了在不同领域上的结果。此外，我们训练了一个 8B 参数的语言模型，并评估了其在少样本翻译任务上的表现。我们将基线模型 1 提供给研究社区。*

该模型由 [Juarez Bochi](https://huggingface.co/jbochi) 添加。原始检查点可在[此处](https://github.com/google-research/google-research/tree/master/madlad_400)找到。

这是一个支持许多低资源语言的机器翻译模型，其性能可与规模大得多的模型相媲美。

可以直接使用 MADLAD-400 的权重，而无需对模型进行微调：

```python
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer

model = AutoModelForSeq2SeqLM.from_pretrained("google/madlad400-3b-mt", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("google/madlad400-3b-mt")

inputs = tokenizer("<2pt> I love pizza!", return_tensors="pt").to(model.device)
outputs = model.generate(**inputs)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
['Eu amo pizza!']
```

Google 发布了以下变体：

- [google/madlad400-3b-mt](https://huggingface.co/google/madlad400-3b-mt)

- [google/madlad400-7b-mt](https://huggingface.co/google/madlad400-7b-mt)

- [google/madlad400-7b-mt-bt](https://huggingface.co/google/madlad400-7b-mt-bt)

- [google/madlad400-10b-mt](https://huggingface.co/google/madlad400-10b-mt)

原始检查点可以在[此处](https://github.com/google-research/google-research/tree/master/madlad_400)找到。

有关所有 API 参考、代码示例和笔记本，请参阅 [T5 的文档页面](t5)。有关 MADLAD-400 训练和评估的更多详细信息，请参阅模型卡片。

