大规模语言模型的最近邻测试时训练
Test-Time Training on Nearest Neighbors for Large Language Models
AI总结:
本文提出在测试时对检索到的最近邻文本进行微调,避免了检索增强的上下文成本,仅用20个邻居一次梯度迭代即可显著提升多种语言建模任务性能,缩小模型规模差距。
摘要:
许多近期的研究通过将检索到的数据添加到输入上下文来增强语言模型。这种方法要成功,检索到的数据必须在训练和测试时都添加。此外,随着输入长度随检索数据的大小线性增长,现代Transformer的计算和内存成本会二次方增长。为了避免这些复杂性,我们直接在测试时对检索到的数据微调模型,使用其标准训练设置。我们基于Pile数据集的文本嵌入构建了一个大规模分布式索引。对于每个测试输入,我们的系统检索其邻居并在其文本上微调模型。令人惊讶的是,仅检索并训练20个邻居,每个仅进行一次梯度迭代,就能在Pile的20多个语言建模任务上大幅提升性能。例如,使用最近邻的测试时训练显著缩小了小型GPT-2与比其大10倍以上的GPT-Neo模型之间的性能差距。然而,足够的索引质量和大小是必要的。我们的工作为语言建模的测试时训练建立了首个基线。
英文摘要:
Many recent efforts augment language models with retrieval, by adding retrieved data to the input context. For this approach to succeed, the retrieved data must be added at both training and test time. Moreover, as input length grows linearly with the size of retrieved data, cost in computation and memory grows quadratically for modern Transformers. To avoid these complications, we simply fine-tune the model on retrieved data at test time, using its standard training setup. We build a large-scale distributed index based on text embeddings of the Pile dataset. For each test input, our system retrieves its neighbors and fine-tunes the model on their text. Surprisingly, retrieving and training on as few as 20 neighbors, each for only one gradient iteration, drastically improves performance across more than 20 language modeling tasks in the Pile. For example, test-time training with nearest neighbors significantly narrows the performance gap between a small GPT-2 and a GPT-Neo model more than 10 times larger. Sufficient index quality and size, however, are necessary. Our work establishes a first baseline of test-time training for language modeling.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。