学习与多个语言模型协同解码
Learning to Decode Collaboratively with Multiple Language Models
AI总结:
提出一种通过token级交错生成让多个LLM协同解码的方法,将模型选择建模为潜在变量并优化边际似然,无需监督即可学习何时自行生成或调用助手模型,实验证明联合系统性能优于单模型。
摘要:
我们提出了一种方法,教授多个大型语言模型(LLM)通过在token级别交错它们的生成来进行协作。我们将决定哪个LLM生成下一个token的决策建模为潜在变量。通过在我们的潜在变量模型下优化训练集的边际似然,基础LLM自动学习何时自行生成以及何时调用其中一个“助手”语言模型来生成,所有这些都无需直接监督。解码过程中的token级协作允许以针对当前特定任务定制的方式融合每个模型的专业知识。我们的协作解码在跨领域设置中尤为有用,其中通才基础LLM学习调用领域专家模型。在指令遵循、特定领域问答和推理任务上,我们展示了联合系统的性能超越了单个模型。通过对学习到的潜在决策进行定性分析,我们展示了用我们方法训练的模型表现出几种有趣的协作模式,例如模板填充。我们的代码可在 https://github.com/clinicalml/co-llm 获取。
英文摘要:
We propose a method to teach multiple large language models (LLM) to collaborate by interleaving their generations at the token level. We model the decision of which LLM generates the next token as a latent variable. By optimizing the marginal likelihood of a training set under our latent variable model, the base LLM automatically learns when to generate itself and when to call on one of the ``assistant'' language models to generate, all without direct supervision. Token-level collaboration during decoding allows for a fusion of each model's expertise in a manner tailored to the specific task at hand. Our collaborative decoding is especially useful in cross-domain settings where a generalist base LLM learns to invoke domain expert models. On instruction-following, domain-specific QA, and reasoning tasks, we show that the performance of the joint system exceeds that of the individual models. Through qualitative analysis of the learned latent decisions, we show models trained with our method exhibit several interesting collaboration patterns, e.g., template-filling. Our code is available at https://github.com/clinicalml/co-llm.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。