Improving language models by retrieving from trillions of tokens

https://papers.cool/arxiv/2112.04426

Authors: Sebastian Borgeaud ; Arthur Mensch ; Jordan Hoffmann ; Trevor Cai ; Eliza Rutherford ; Katie Millican ; George van den Driessche ; Jean-Baptiste Lespiau ; Bogdan Damoc ; Aidan Clark ; Diego de Las Casas ; Aurelia Guy ; Jacob Menick ; Roman Ring ; Tom Hennigan ; Saffron Huang ; Loren Maggiore ; Chris Jones ; Albin Cassirer ; Andy Brock ; Michela Paganini ; Geoffrey Irving ; Oriol Vinyals ; Simon Osindero ; Karen Simonyan ; Jack W. Rae ; Erich Elsen ; Laurent Sifre

Summary: We enhance auto-regressive language models by conditioning on document chunks retrieved from a large corpus, based on local similarity with preceding tokens. With a $2$ trillion token database, our Retrieval-Enhanced Transformer (RETRO) obtains comparable performance to GPT-3 and Jurassic-1 on the Pile, despite using 25$\times$ fewer parameters. After fine-tuning, RETRO performance translates to downstream knowledge-intensive tasks such as question answering. RETRO combines a frozen Bert retriever, a differentiable encoder and a chunked cross-attention mechanism to predict tokens based on an order of magnitude more data than what is typically consumed during training. We typically train RETRO from scratch, yet can also rapidly RETROfit pre-trained transformers with retrieval and still achieve good performance. Our work opens up new avenues for improving language models through explicit memory at unprecedented scale.


Q: 这篇论文试图解决什么问题?

A: 这篇论文提出了一种新的方法来增强自回归语言模型(LM),通过从大型语料库中检索文档片段来提高模型的性能。主要解决的问题是如何在不显著增加计算量的情况下,为语言模型提供更大规模的记忆能力。具体来说,论文的目标是:

  1. 解耦模型大小和训练数据量:作者试图探索在不直接增加模型参数数量的情况下,通过引入大规模检索数据库来增强语言模型的方法。
  2. 提高语言模型的性能:通过检索增强(Retro)模型,作者希望在各种下游任务(如问答)中实现与更大参数模型相当的性能。
  3. 处理训练数据和测试数据之间的重叠问题:论文提出了一种评估方法,以量化测试集与训练集重叠对模型性能的影响,这对于理解模型的泛化能力至关重要。
  4. 处理隐私、安全和公平性问题:随着大型语言模型的发展,它们可能会记住训练数据中的信息,这可能带来隐私和安全问题。论文讨论了检索增强模型可能如何缓解这些问题。
  5. 提高模型的可解释性和透明度:通过检索机制,模型的输出可以更加透明,因为可以直接查看或修改用于生成输出的检索数据。

总的来说,论文的核心贡献在于提出了一种新的半参数化方法,即Retro模型,它通过检索大量文本数据来增强语言模型的性能,同时保持了模型参数数量的相对较低。这种方法为构建更强大的语言模型提供了一种新的、更高效的途径。

Q: 有哪些相关研究?

A: 论文中提到了与检索增强语言模型(Retro)相关的几个研究领域和具体工作,主要包括:

  1. 大规模语言模型训练:提到了GPT-2、GPT-3和Jurassic-1等模型,这些模型通过增加训练数据规模来提高性能。
  2. 信息检索:历史上,信息检索依赖于倒排索引匹配技术,如TF-IDF和BM25。这些技术在早期的文本检索系统中被广泛使用。
  3. 潜在主题建模:如LDA(Latent Dirichlet Allocation),用于识别相关邻居。
  4. 神经网络激活的密集表示:使用神经网络的激活作为检索的表示,例如Continuous Cache和kNN-LM。
  5. 检索系统的发展:为了直接在预训练模型上进行检索,开发了检索器系统,如Dpr、Realm、RAG和FiD等。