Table of Contents
Fetching ...

PseudoAct: Leveraging Pseudocode Synthesis for Flexible Planning and Action Control in Large Language Model Agents

Yihan, Wen, Xin Chen

TL;DR

PseudoAct synthesizes a structured pseudocode plan that decomposes a task into subtasks and explicitly encodes control flow, including sequencing, conditionals, loops, parallel composition, and combinations of these logic primitives, enabling consistent and efficient long-horizon decision-making.

Abstract

Large language model (LLM) agents typically rely on reactive decision-making paradigms such as ReAct, selecting actions conditioned on growing execution histories. While effective for short tasks, these approaches often lead to redundant tool usage, unstable reasoning, and high token consumption in complex long-horizon tasks involving branching, iteration, or multi-tool coordination. To address these limitations, this paper introduces PseudoAct, a novel framework for flexible planning and action control in LLM agents through pseudocode synthesis. Leveraging the ability of LLMs to express task-solving strategies as code, PseudoAct synthesizes a structured pseudocode plan that decomposes a task into subtasks and explicitly encodes control flow, including sequencing, conditionals, loops, parallel composition, and combinations of these logic primitives. Actions are then executed by following this global plan, making the decision logic explicit and temporally coherent. This design reduces redundant actions, prevents infinite loops, and avoids uninformative alternative exploration, enabling consistent and efficient long-horizon decision-making. Experiments on benchmark datasets show that our method significantly outperforms existing reactive agent approaches, achieving a 20.93% absolute gain in success rate on FEVER and setting a new state-of-the-art on HotpotQA.

PseudoAct: Leveraging Pseudocode Synthesis for Flexible Planning and Action Control in Large Language Model Agents

TL;DR

PseudoAct synthesizes a structured pseudocode plan that decomposes a task into subtasks and explicitly encodes control flow, including sequencing, conditionals, loops, parallel composition, and combinations of these logic primitives, enabling consistent and efficient long-horizon decision-making.

Abstract

Large language model (LLM) agents typically rely on reactive decision-making paradigms such as ReAct, selecting actions conditioned on growing execution histories. While effective for short tasks, these approaches often lead to redundant tool usage, unstable reasoning, and high token consumption in complex long-horizon tasks involving branching, iteration, or multi-tool coordination. To address these limitations, this paper introduces PseudoAct, a novel framework for flexible planning and action control in LLM agents through pseudocode synthesis. Leveraging the ability of LLMs to express task-solving strategies as code, PseudoAct synthesizes a structured pseudocode plan that decomposes a task into subtasks and explicitly encodes control flow, including sequencing, conditionals, loops, parallel composition, and combinations of these logic primitives. Actions are then executed by following this global plan, making the decision logic explicit and temporally coherent. This design reduces redundant actions, prevents infinite loops, and avoids uninformative alternative exploration, enabling consistent and efficient long-horizon decision-making. Experiments on benchmark datasets show that our method significantly outperforms existing reactive agent approaches, achieving a 20.93% absolute gain in success rate on FEVER and setting a new state-of-the-art on HotpotQA.
Paper Structure (26 sections, 4 equations, 9 figures, 2 tables)

This paper contains 26 sections, 4 equations, 9 figures, 2 tables.

Figures (9)

  • Figure 1: Comparison between reactive ReAct/DFSDT and our PseudoAct framework. (Reactive agents follow unstructured trial-and-error action sequences and may fail after reaching the maximum attempt limit. In contrast, PseudoAct generates a structured pseudocode plan that decomposes the task into phases with explicit decision logic, guiding action selection and reducing unnecessary exploration).
  • Figure 2: Illustration of a pseudocode plan for resolving a practical multi-step task in the electrical power system domain.
  • Figure 3: An example of the runtime prompt constructed by the Control-Flow Executor for solving the power grid task in Figure \ref{['fig:format']}. The agent receives both the Global Workflow Context (top) and the Local Step Context (bottom), ensuring local actions are consistent with global intent.
  • Figure 4: Overview of Scenario 1. The iteration trace reports the evolution of load and voltage at Bus 11, terminating after seven iterations when the voltage constraint is violated, with the final panel summarizing the converged solution.
  • Figure 5: Scenario 2, in which an attempted 15% load increase at Bus 5 is aborted because no load elements exist at the target bus, resulting in no voltage variation.
  • ...and 4 more figures