arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2302.10879cs.CL
收藏

$k$ NN-适配器:黑盒语言模型的有效领域自适应

$k$NN-Adapter: Efficient Domain Adaptation for Black-Box Language Models

Princeton University(普林斯顿大学);University of Washington(华盛顿大学);Microsoft Research(微软研究院)

Yangsibo Huang, Daogao Liu, Zexuan Zhong, Weijia Shi, Yin Tat Lee

摘要:

在新领域上微调语言模型是领域自适应的标准实践。然而,当涉及到现代大规模语言模型(如GPT-3)时,它可能是不可行的,因为它只能通过API访问,因此很难访问模型的内部参数。在本文中,我们提出了$k$ NN适配器,一种方法,有效地适应这些黑盒大语言模型(LLM)到一个新的领域。$k$ NN适配器建立在检索增强的语言模型之上,并自适应地学习用来自由目标域数据组成的查询的检索结果来内插语言模型的输出。我们在四个不同领域的实验表明,$k$ NN适配器显着改善困惑,并在有限的LLM访问设置特别好。此外,我们表明,$k$ NN适配器是更有效的比微调时,训练数据的量是有限的。我们还发布了一个数据集,以鼓励进一步的研究。

英文摘要:

Fine-tuning a language model on a new domain is standard practice for domain adaptation. However, it can be infeasible when it comes to modern large-scale language models such as GPT-3, which can only be accessed through APIs, making it difficult to access the internal parameters of the model. In this paper, we propose $k$NN-Adapter, a method to effectively adapt these black-box large language models (LLMs) to a new domain. The $k$NN-Adapter builds on top of the retrieval-augmented language model, and adaptively learns to interpolate the output of the language model with retrieval results from a datastore consisting of the target domain data. Our experiments on four different domains demonstrate that $k$NN-Adapter significantly improves perplexity, and works particularly well in settings with limited access to LLMs. Additionally, we show that $k$NN-Adapter is more effective than fine-tuning when the amount of training data is limited. We also release a dataset to encourage further study.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑