Learning to Decode Collaboratively with Multiple Language Models

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Shen, Shannon Zejiang, Lang, Hunter, Wang, Bailin, Kim, Yoon, Sontag, David
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866929475031138304
author Shen, Shannon Zejiang
Lang, Hunter
Wang, Bailin
Kim, Yoon
Sontag, David
author_facet Shen, Shannon Zejiang
Lang, Hunter
Wang, Bailin
Kim, Yoon
Sontag, David
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2403_03870
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Learning to Decode Collaboratively with Multiple Language Models
Shen, Shannon Zejiang
Lang, Hunter
Wang, Bailin
Kim, Yoon
Sontag, David
Computation and Language
Machine Learning
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.
title Learning to Decode Collaboratively with Multiple Language Models
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2403.03870