Reti Linguistiche Profonde: Addestramento Congiunto di Prompt per Modelli Linguistici Impilati utilizzando Inferenza Variazionale
Deep Language Networks: Joint Prompt Training of Stacked LLMs using Variational Inference
June 21, 2023
Autori: Alessandro Sordoni, Xingdi Yuan, Marc-Alexandre Côté, Matheus Pereira, Adam Trischler, Ziang Xiao, Arian Hosseini, Friederike Niedtner, Nicolas Le Roux
cs.AI
Abstract
Consideriamo i grandi modelli linguistici (LLM) come strati linguistici stocastici in una rete, dove i parametri apprendibili sono i prompt in linguaggio naturale a ciascun livello. Sovrapponiamo due di questi strati, alimentando l'output di un livello al successivo. Chiamiamo questa architettura impilata Deep Language Network (DLN). Iniziamo mostrando come ottimizzare efficacemente i prompt per una rete linguistica a 1 strato (DLN-1). Successivamente, dimostriamo come addestrare DLN a 2 strati (DLN-2), dove è necessario apprendere due prompt. Consideriamo l'output del primo strato come una variabile latente da marginalizzare e sviluppiamo un algoritmo di inferenza variazionale per l'addestramento congiunto dei prompt. Una DLN-2 raggiunge prestazioni superiori rispetto a un singolo strato, a volte comparabili a GPT-4 con pochi esempi, anche quando ogni LLM nella rete è più piccolo e meno potente. Il codice DLN è open source: https://github.com/microsoft/deep-language-networks.
English
We view large language models (LLMs) as stochastic language layers in
a network, where the learnable parameters are the natural language
prompts at each layer. We stack two such layers, feeding the output of
one layer to the next. We call the stacked architecture a Deep Language
Network (DLN). We first show how to effectively perform prompt optimization
for a 1-Layer language network (DLN-1). We then show how to train 2-layer DLNs
(DLN-2), where two prompts must be learnt. We consider the output of the first
layer as a latent variable to marginalize, and devise a variational inference
algorithm for joint prompt training. A DLN-2 reaches higher performance than a
single layer, sometimes comparable to few-shot GPT-4 even when each LLM in the
network is smaller and less powerful. The DLN code is open source:
https://github.com/microsoft/deep-language-networks .