SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.12509 · NeurIPS · 2023

Joint Prompt Optimization of Stacked LLMs using Variational Inference

Xingdi Yuan, Marc-Alexandre Côté, Adam Trischler, Alessandro Sordoni, Nicolas Le Roux, Matheus Pereira, Ziang Xiao, Arian Hosseini, Friederike Niedtner

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 19 functions out of this paper's own repositories and ran 3 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
microsoft/deep-language-networks canonical 3 of 19
FunctionStatusWhere it lives
compute_pairwise_kl Ran microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("4e2d9476c7b7f5bb")
init_prompts Ran microsoft/deep-language-networks/projects/vi_dln/vi_main.py
code served (permissive licence) · get_code("27d7836227d45e77")
load_template Ran microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("d843b5eea08b3a77")
DLNTemplate Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("25b3e2a5424120d2")
Info Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("a3be7a8450083a00")
LLM Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("58142a168b50bfe8")
LLoss Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("917d903a0020d602")
LogProbs Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("f8c95ea21f840a49")
LogProbsScore Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("f37b35b99bcbb3c0")
OutputClasses Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("5805bad2f84aed03")
PosteriorSampler Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("a78e566e54ca2436")
PriorLayer Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("bea9ae5b3a1554ae")
ResidualPriorLayer Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("44e5112d138ac1a5")
ResultLogEntry Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("9a68c9cffdb8207f")
ScoreRequest Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("674886d8862cc099")
SequentialPromptSampler Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("244a56a215343711")
Templates Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("ff15cdb643c50016")
VILModel Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("b62b5074721ca0f4")
log_message Not yet run microsoft/deep-language-networks/dln/vi/model.py
code served (permissive licence) · get_code("df0c026e50c6f1a0")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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 1-Layer language network (DLN-1). Then, we present an extension that applies to 2-layer DLNs (DLN-2), 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 DLN-1 in multiple reasoning and natural language understanding tasks. Then, we show that DLN-2 can reach higher performance than a single layer, showing promise that we might reach comparable performance to GPT-4, even when each LLM in the network is smaller and less powerful. The DLN code is open source. 1

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2306.12509")
get_code_for_paper("2306.12509")
have("2306.12509")

Connect an agent — have() is free.