kNN-Adapter: Efficient Domain Adaptation for Black-Box Language Models

Yangsibo Huang, Daogao Liu, Zexuan Zhong, Weijia Shi, Yin Tat Lee
2/21/2023
cs.CL

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{huang2023knnadapter,
  title  = {kNN-Adapter: Efficient Domain Adaptation for Black-Box Language Models},
  author = {Yangsibo Huang and Daogao Liu and Zexuan Zhong and Weijia Shi and Yin Tat Lee},
  year   = {2023},
  eprint = {2302.10879},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.10879v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.10879.svg)](https://codeofpaper.com/paper/2302.10879)

Discussion