Retroformer: Agenti Linguistici su Larga Scala Retrospettivi con Ottimizzazione a Gradiente della Politica
Retroformer: Retrospective Large Language Agents with Policy Gradient Optimization
August 4, 2023
Autori: Weiran Yao, Shelby Heinecke, Juan Carlos Niebles, Zhiwei Liu, Yihao Feng, Le Xue, Rithesh Murthy, Zeyuan Chen, Jianguo Zhang, Devansh Arpit, Ran Xu, Phil Mui, Huan Wang, Caiming Xiong, Silvio Savarese
cs.AI
Abstract
Negli ultimi mesi è emersa una nuova e potente tendenza in cui i grandi modelli linguistici (LLM) vengono potenziati per diventare agenti linguistici autonomi in grado di eseguire compiti multi-step orientati a obiettivi in modo indipendente, piuttosto che limitarsi a rispondere alle query degli utenti umani. La maggior parte degli agenti linguistici esistenti, tuttavia, non è ottimizzata utilizzando ricompense specifiche per l'ambiente. Sebbene alcuni agenti consentano un affinamento iterativo attraverso feedback verbali, non ragionano e pianificano in modi compatibili con l'apprendimento basato su gradienti dalle ricompense. Questo articolo introduce un framework metodologico per rinforzare i grandi agenti linguistici apprendendo un modello retrospettivo, che regola automaticamente i prompt degli agenti linguistici dal feedback dell'ambiente attraverso il gradiente della politica. Nello specifico, l'architettura dell'agente proposta apprende dalle ricompense in più ambienti e compiti, per affinare un modello linguistico pre-addestrato che perfeziona il prompt dell'agente linguistico riassumendo la causa principale dei tentativi falliti precedenti e proponendo piani d'azione. I risultati sperimentali su vari compiti dimostrano che gli agenti linguistici migliorano nel tempo e che il nostro approccio supera notevolmente i baseline che non sfruttano adeguatamente i gradienti dall'ambiente. Ciò dimostra che l'uso dell'ottimizzazione del gradiente della politica per migliorare gli agenti linguistici, per cui riteniamo che il nostro lavoro sia uno dei primi, sembra promettente e può essere applicato per ottimizzare altri modelli nell'architettura dell'agente per migliorarne le prestazioni nel tempo.
English
Recent months have seen the emergence of a powerful new trend in which large
language models (LLMs) are augmented to become autonomous language agents
capable of performing objective oriented multi-step tasks on their own, rather
than merely responding to queries from human users. Most existing language
agents, however, are not optimized using environment-specific rewards. Although
some agents enable iterative refinement through verbal feedback, they do not
reason and plan in ways that are compatible with gradient-based learning from
rewards. This paper introduces a principled framework for reinforcing large
language agents by learning a retrospective model, which automatically tunes
the language agent prompts from environment feedback through policy gradient.
Specifically, our proposed agent architecture learns from rewards across
multiple environments and tasks, for fine-tuning a pre-trained language model
which refines the language agent prompt by summarizing the root cause of prior
failed attempts and proposing action plans. Experimental results on various
tasks demonstrate that the language agents improve over time and that our
approach considerably outperforms baselines that do not properly leverage
gradients from the environment. This demonstrates that using policy gradient
optimization to improve language agents, for which we believe our work is one
of the first, seems promising and can be applied to optimize other models in
the agent architecture to enhance agent performances over time.