Methods for adapting language models (LMs) to new tasks and domains have traditionally assumed white-box access to the model, and work by modifying its parameters. However, this is incompatible with a recent trend in the field, where the highest quality models are only available as black-boxes through inference APIs. Even when the model weights are available, the computational cost of fine-tuning large LMs can be prohibitive for most practitioners. In this work, we present a lightweight method for adapting large LMs to new domains and tasks, assuming no access to their weights or intermediate activations. Our approach fine-tunes a small white-box LM and combines it with the large black-box LM at the probability level through a small network, learned on a small validation set. We validate our approach by adapting a large LM (OPT-30B) to several domains and a downstream task (machine translation), observing improved performance in all cases, of up to 9\%, while using a domain expert 23x smaller.
翻译:语言模型适配新任务和领域的方法传统上假定可白盒访问模型,并通过修改其参数实现。然而,这与该领域的最新趋势相矛盾——目前最高质量的模型通常仅通过推理API以黑盒形式提供。即使模型权重可获取,微调大型语言模型的计算成本对大多数从业者而言仍过于高昂。本文提出一种轻量级方法,在不访问模型权重或中间激活的前提下,实现大型语言模型对新领域和任务的适配。该方法首先微调一个小型白盒语言模型,然后通过一个小型网络在概率层面将其与大型黑盒语言模型结合,该网络在小型验证集上完成训练。通过将大型语言模型(OPT-30B)适配至多个领域及下游任务(机器翻译),我们验证了该方法的有效性:在所有场景中均观察到性能提升(最高达9%),而使用的领域专家模型规模缩小23倍。