Joint Prompt Optimization of Stacked LLMs using Variational Inference
Abstract
Large language models (LLMs) can be seen as atomic units of computation mapping sequences to a distribution over sequences. Thus, they can be seen as stochastic language layers in a language network, where the learnable parameters are the natural language prompts at each layer. By stacking two such layers and feeding the output of one layer to the next, we obtain a Deep Language Network (DLN). We first show how to effectively perform prompt optimization for a 1Layer language network (DLN1). Then, we present an extension that applies to 2layer DLNs (DLN2), where two prompts must be learned. The key idea is to consider the output of the first layer as a latent variable, which requires inference, and prompts to be learned as the parameters of the generative distribution. We first test the effectiveness of DLN1 in multiple reasoning and natural language understanding tasks. Then, we show that DLN2 can reach higher performance than a single layer, showing promise that we might reach comparable performance to GPT4, even when each LLM in the network is smaller and less powerful.
 Publication:

arXiv eprints
 Pub Date:
 June 2023
 DOI:
 10.48550/arXiv.2306.12509
 arXiv:
 arXiv:2306.12509
 Bibcode:
 2023arXiv230612509S
 Keywords:

 Computer Science  Computation and Language;
 Computer Science  Machine Learning
 EPrint:
 NeurIPS 2023