04 · Decomposition

Break it into small steps

04Decomposition

Group 04 · 9 techniques

Decomposition

Break it into small steps. Big problem -> small problems. Solve one by one.

Each slide shows one technique: the plain prompt, the same prompt with the technique applied, and what changed. Use the arrows, the keys ← →, or pick a technique on the left.

Least-to-Most Prompting

Prompt the LLM to break a problem into sub-problems (without solving), then solve them sequentially, appending each answer, until the final result.

Before

Q: 'think, machine, learning' - what are the last letters concatenated? A: [direct answer]

After · new words marked

First break the problem into sub-problems: 'think', then 'think, machine', then 'think, machine, learning'. Solve each in turn, using the previous answer.

What happened

With GPT-3 code-davinci-002 and 14 exemplars: SCAN benchmark >=99% accuracy in every split (incl. length split) vs 16% for CoT; on 12-word lists 74.0% vs 31.8% for CoT.

Decomposed Prompting (DECOMP)

Few-shot prompt showing how to route sub-problems to functions (string splitting, web search, etc., often separate LLM calls).

Before

Solve this whole problem in one go.

After · new words marked

Break it into sub-problems and call the right function for each (e.g. split strings, search the web), then combine the results.

What happened

Improved performance over Least-to-Most on some tasks (Khot et al. 2022).

Tree of Thoughts (ToT)

Tree search: generate multiple possible next 'thoughts', evaluate progress by prompting, continue the best branches, backtrack as needed.

Before

Solve this puzzle step by step in one chain.

After · new words marked

Generate several candidate next steps, rate each (sure / likely / impossible), explore the most promising, and backtrack when a path dead-ends.

What happened

Game of 24, GPT-4: CoT solved 4% of tasks, Tree of Thoughts 74%.

Recursion-of-Thought

Like CoT, but each complicated sub-problem mid-chain is sent to another prompt / LLM call; the answer is inserted back into the original prompt.

Before

Solve this nested problem in one chain.

After · new words marked

When a sub-problem is too complicated, solve it in a separate prompt and insert its answer back here before continuing.

What happened

Improvements on arithmetic and algorithmic tasks; can handle over-context-length problems (Lee & Kim 2023).

Program-of-Thoughts (PoT)

The LLM generates programming code as its reasoning steps; a code interpreter executes them for the final answer.

Before

Solve this math problem in words.

After · new words marked

Write Python code that solves this problem step by step, then run it and report the result.

What happened

Excels in mathematical and programming-related tasks but less effective for semantic reasoning (Chen et al. 2023).

Faithful Chain-of-Thought

CoT with both natural language and symbolic language (e.g. Python) reasoning, symbolic language chosen per task.

Before

Reason in words only.

After · new words marked

Reason in words AND in symbolic code, so each step can be checked.

What happened

Like PoT but with task-dependent symbolic languages (Lyu et al. 2023).

Skeleton-of-Thought

Prompt the LLM to create an answer skeleton (sub-problems), solve them in parallel, concatenate outputs.

Before

Answer this multi-part question in one pass.

After · new words marked

First outline the answer as a skeleton of sub-points, solve each sub-point independently, then join them.

What happened

Speed via parallelisation, not accuracy (Ning et al. 2023).

Metacognitive Prompting

Five-part prompt chain mirroring human metacognition: clarify the question, preliminary judgement, evaluate the response, confirm the decision, assess confidence.

Before

Answer this question.

After · new words marked

1) Clarify the question. 2) Give a preliminary judgement. 3) Evaluate that response. 4) Confirm the decision. 5) Assess your confidence.

What happened

No result claim quoted in the Prompt Report section 2.2.3 (Wang & Zhao 2024).

ReAct (Reason + Act)

Interleave free-form reasoning traces with actions and observations from tools, so the model can plan, act, observe, and correct itself.

Before

Answer from memory, or act without reasoning: Search[...] / Lookup[...] / Finish[...]

After · new words marked

Thought 1: I need to search for... Act 1: Search[...] Obs 1: ... Thought 2: ... Act 2: ...

What happened

With 1-2 in-context examples: +34% absolute success on ALFWorld and +10% on WebShop vs imitation / RL methods; reduced hallucination on HotpotQA and FEVER (PaLM-540B).