Tree-of-Prompts: Abstracting Control-Flow for Prompt Optimization

Prompt optimization (PO) generates prompts to guide Large Language Models (LLMs) in performing tasks.Existing methods, such as PromptAgent, rely on a single static prompt, which struggles with disjoint cases in complex tasks.Although Mixture-of-Prompts (MoP) uses multiple prompts, it fails to account for variations in task complexity.Inspired by programmatic control flow, we introduce a nested if-else structure to address both varying similarities and complexities across diverse cases.We propose Tree-of-Prompts (ToP), which recursively expands child prompts from a parent prompt.Sibling prompts tackle disjoint cases while inheriting shared similarities from their parent, and handle cases more complex than the parent.Evaluated on Gorilla (understanding), MATH (reasoning), and a subset of BBH benchmarks, ToP outperforms PromptAgent and MoP, with improvements of 1.4% and 4.6% over PromptAgent and 3.2% and 4.5% over MoP, when tested with GPT-4o-mini and Llama 3.2-3B, respectively.

Authors

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.995
Primary Topic
Formal Methods in Verification
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Tree-of-Prompts: Abstracting Control-Flow for Prompt Optimization

S. K. Garg, Jihyuk Kim, Shyh Hong Hwang, Lahari Poddar et al.
Formal Methods in Verification
article

Tree-of-Prompts: Abstracting Control-Flow for Prompt Optimization

S. K. Garg, Jihyuk Kim, Shyh Hong Hwang, Lahari Poddar, Chris Hench
article en

Abstract

Prompt optimization (PO) generates prompts to guide Large Language Models (LLMs) in performing tasks.Existing methods, such as PromptAgent, rely on a single static prompt, which struggles with disjoint cases in complex tasks.Although Mixture-of-Prompts (MoP) uses multiple prompts, it fails to account for variations in task complexity.Inspired by programmatic control flow, we introduce a nested if-else structure to address both varying similarities and complexities across diverse cases.We propose Tree-of-Prompts (ToP), which recursively expands child prompts from a parent prompt.Sibling prompts tackle disjoint cases while inheriting shared similarities from their parent, and handle cases more complex than the parent.Evaluated on Gorilla (understanding), MATH (reasoning), and a subset of BBH benchmarks, ToP outperforms PromptAgent and MoP, with improvements of 1.4% and 4.6% over PromptAgent and 3.2% and 4.5% over MoP, when tested with GPT-4o-mini and Llama 3.2-3B, respectively.

National Research Foundation, National Research Foundation of Korea, Iran Telecommunication Research Center, Ministry of Science and ICT, South Korea, Institute for Information and Communications Technology Promotion
Openalex Percentile: Top 79%
Formal Methods in Verification
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.