Single-Path Plan Generator

Summary: Single-path plan generator orchestrates the generation of intermediate steps leading to the achievement of the user’s goal.

Context: A agent is considered “black box” to users, while users may care about the process of how an agent achieve users’ goals.

Problem: How can an agent efficiently formulate the strategies to achieve users’ goals?

Forces:

  • Underspecification. Users may assign tasks with high-level abstraction, which may be challenging for agents to handle the uncertainty or ambiguity in the provided context.
  • Coherence. Users and other interacting tools/agents will expect coherent responses or guidelines for achieving certain goals.
  • Efficiency. Uncertain decisions may affect the efficiency of an agent, which will result in reduced user satisfaction.

Solution: Fig. 1 illustrates a high-level graphical representation of single-path plan generator. After receiving and comprehending users’ goals, the single-path plan generator can coordinate the creation of intermediate steps for other agents or tools and prioritise the tasks, to progressively lead towards goal accomplishment. Specifically, each step in this process is designed to have only a single subsequent step, such as Chain-of-Thought (CoT) [1]. Self-consistency is employed to confirm with the foundation model several times and select the most consistent answer as the final decision [2]. Please note that the generated plan may have different granularity based on the given goal that complex plan may incorporate multiple workflows, processes, tasks and fine-grained steps.

Figure 1. Single-path plan generator.

Benefits:

  • Reasoning certainty. Single-path plan generator generates a multi-step plan, which can reflect the reasoning process and mitigate the uncertainty or ambiguity for achieving users’ goals.
  • Coherence. The interacting users, agents and tools are provided a clear and coherent path towards the ultimate goals.
  • Efficiency. Single-path plan generator can increase efficiency in agents via pruning unnecessary steps or distractions.

Drawbacks:

  • Flexibility. A single-path plan may result in limited flexibility to accommodate diverse user preferences or application scenarios, hence users cannot customise their solutions.
  • Oversimplification. The agent may oversimplify the generated plan which requires multi-faceted approaches.

Known uses:

  • LlamaIndex. LlamaIndex fine-tunes a ReAct Agent to achieve better performance with single-path plan generator via CoT.
  • ThinkGPT. ThinkGPT provides a toolkit to facilitate the implementation of single-path plan generator pattern.
  • Zhang et al. [3] promote the implementation by elucidating the basic mechanisms and paradigm shift of CoT.

Related patterns:

  • One-shot model querying. One-shot model querying enables the generation of single-path plans by only querying the foundation model for one time.
  • Multi-path plan generator. Multi-path plan generator can be regarded an alternative of single-path plan generator for customised strategy.
  • Self-reflection. Single-path plan generator and self-reflection both contribute to self-Consistency with Chain of Thought.

References:

[1] J.Wei, X.Wang, D. Schuurmans, M. Bosma, F. Xia, E. Chi, Q. V. Le, D. Zhou et al., “Chain-of-thought prompting elicits reasoning in large language models,” Advances in Neural Information Processing Systems, vol. 35, pp. 24 824–24 837, 2022.

[2] Z. Wang, Z. Liu, Y. Zhang, A. Zhong, L. Fan, L. Wu, and Q. Wen, “Rcagent: Cloud root cause analysis by autonomous agents with tool-augmented large language models,” arXiv preprint arXiv:2310.16340, 2023.

[3] Z. Zhang, Y. Yao, A. Zhang, X. Tang, X. Ma, Z. He, Y. Wang, M. Gerstein, R. Wang, G. Liu et al., “Igniting language intelligence: The hitchhiker’s guide from chain-of-thought reasoning to language agents,” arXiv preprint arXiv:2311.11797, 2023.