StateFlow: Enhancing LLM Task-Solving through State-Driven Workflows

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Wu, Yiran, Yue, Tianwei, Zhang, Shaokun, Wang, Chi, Wu, Qingyun
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866912027764588544
author Wu, Yiran
Yue, Tianwei
Zhang, Shaokun
Wang, Chi
Wu, Qingyun
author_facet Wu, Yiran
Yue, Tianwei
Zhang, Shaokun
Wang, Chi
Wu, Qingyun
contents It is a notable trend to use Large Language Models (LLMs) to tackle complex tasks, e.g., tasks that require a sequence of actions and dynamic interaction with tools and external environments. In this paper, we propose StateFlow, a novel LLM-based task-solving paradigm that conceptualizes complex task-solving processes as state machines. In StateFlow, we distinguish between "process grounding" (via state and state transitions) and "sub-task solving" (through actions within a state), enhancing control and interpretability of the task-solving procedure. A state represents the status of a running process. The transitions between states are controlled by heuristic rules or decisions made by the LLM, allowing for a dynamic and adaptive progression. Upon entering a state, a series of actions is executed, involving not only calling LLMs guided by different prompts, but also the utilization of external tools as needed. Our results show that StateFlow significantly enhances LLMs' efficiency. For instance, StateFlow achieves 13% and 28% higher success rates compared to ReAct in InterCode SQL and ALFWorld benchmark, with 5x and 3x less cost respectively. We also show that StateFlow can be combined with iterative refining methods like Reflexion to further improve performance.
format Preprint
id arxiv_https___arxiv_org_abs_2403_11322
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle StateFlow: Enhancing LLM Task-Solving through State-Driven Workflows
Wu, Yiran
Yue, Tianwei
Zhang, Shaokun
Wang, Chi
Wu, Qingyun
Computation and Language
Artificial Intelligence
It is a notable trend to use Large Language Models (LLMs) to tackle complex tasks, e.g., tasks that require a sequence of actions and dynamic interaction with tools and external environments. In this paper, we propose StateFlow, a novel LLM-based task-solving paradigm that conceptualizes complex task-solving processes as state machines. In StateFlow, we distinguish between "process grounding" (via state and state transitions) and "sub-task solving" (through actions within a state), enhancing control and interpretability of the task-solving procedure. A state represents the status of a running process. The transitions between states are controlled by heuristic rules or decisions made by the LLM, allowing for a dynamic and adaptive progression. Upon entering a state, a series of actions is executed, involving not only calling LLMs guided by different prompts, but also the utilization of external tools as needed. Our results show that StateFlow significantly enhances LLMs' efficiency. For instance, StateFlow achieves 13% and 28% higher success rates compared to ReAct in InterCode SQL and ALFWorld benchmark, with 5x and 3x less cost respectively. We also show that StateFlow can be combined with iterative refining methods like Reflexion to further improve performance.
title StateFlow: Enhancing LLM Task-Solving through State-Driven Workflows
topic Computation and Language
Artificial Intelligence
url https://arxiv.org/abs/2403.11322