Source-linked AI summary
Decomposed Prompting: A Modular Approach for Solving Complex Tasks
Tushar Khot, Harsh Trivedi, Matthew Finlayson, Yao Fu, Kyle Richardson, Peter Clark, Ashish Sabharwal
TL;DR
Few-shot demonstrations struggle to teach language models all the reasoning steps required by complex tasks. Decomposed Prompting splits these tasks into simpler sub-tasks handled through separate few-shot prompts. It outperforms prior work across four tasks and generalization settings.
Problem
Few-shot demonstrations become insufficient for current language models to learn all necessary reasoning steps as tasks grow more complex.
Source: §1 · p. 1Method
Results
Decomposed Prompting outperforms prior work across four tasks and generalization settings, with gains consistent across prompt choices and decomposition schemes.
Source: §5 · p. 9, §4.5 · p. 9Takeaways & Limitations
Modular sub-task handlers can be reused across tasks and replaced with improved implementations without changing the rest of the system.
Source: §1 · p. 2The experiments use GPT3-sized decomposers because only these models reliably produce the required structured outputs.
Source: §4.4 · p. 8
Abstract
from arXiv · showhide
Few-shot prompting is a surprisingly powerful way to use Large Language Models (LLMs) to solve various tasks. However, this approach struggles as the task complexity increases or when the individual reasoning steps of the task themselves are hard to learn, especially when embedded in more complex tasks. To address this, we propose Decomposed Prompting, a new approach to solve complex tasks by decomposing them (via prompting) into simpler sub-tasks that can be delegated to a library of prompting-based LLMs dedicated to these sub-tasks. This modular structure allows each prompt to be optimized for its specific sub-task, further decomposed if necessary, and even easily replaced with more effective prompts, trained models, or symbolic functions if desired. We show that the flexibility and modularity of Decomposed Prompting allows it to outperform prior work on few-shot prompting using GPT3. On symbolic reasoning tasks, we can further decompose sub-tasks that are hard for LLMs into even simpler solvable sub-tasks. When the complexity comes from the input length, we can recursively decompose the task into the same task but with smaller inputs. We also evaluate our approach on textual multi-step reasoning tasks: on long-context multi-hop QA task, we can more effectively teach the sub-tasks via our separate sub-tasks prompts; and on open-domain multi-hop QA, we can incorporate a symbolic information retrieval within our decomposition framework, leading to improved performance on both tasks. Datasets, Code and Prompts available at https://github.com/allenai/DecomP.
1 INTRODUCTION
Decomposed Prompting (DECOMP) separates complex tasks into simpler sub-tasks handled by independently prompted modules. Evaluations on eight challenging datasets using GPT3 illustrate benefits from finer decomposition, recursive processing, richer demonstrations, symbolic retrieval, and formatting correction.
1 INTRODUCTION
- Few complex-task demonstrations may not teach every necessary reasoning step, while few-shot prompting’s ability to perform document retrieval and integration remains unclear.Chain-of-Thought prompting (Wei et al., 2022) demonstrates both decomposition and step execution, but complex-task examples can fail to teach essential sub-skills.Source: §1 · p. 1
- DECOMP uses a separately prompted decomposer to specify sub-task sequences and delegates their execution to dedicated, independently prompted handlers.Handlers can use standard prompts, further decomposition, or symbolic functions such as retrieval.Source: §1 · pp. 1–2, Figure 1 · p. 2
- Reusable sub-task handlers can be debugged independently and swapped without changing the rest of the system.Handlers can receive broader, richer examples, be decomposed further, or be replaced with symbolic implementations suited to large-scale retrieval.Source: §1 · p. 2
- 14-17 pts of improvement on two Math QA datasets come from post-processing CoT to fix frequent formatting errors.The Math QA evaluations use datasets from Cobbe et al. (2021) and Roy & Roth (2015).Source: §1 · p. 2
- DECOMP improves long-context QA through richer sub-task demonstrations and beats CoT on three open-domain multi-hop QA datasets using symbolic retrieval.The evaluations cover long-context QA and open-domain datasets (Yang et al., 2018; Trivedi et al., 2022), with ElasticSearch handling retrieval.Source: §1 · p. 2
- DECOMP teaches kth-letter extraction through finer decomposition and builds scale-invariant list reversal by recursively reversing smaller lists, extending a weaker model’s capabilities.These experiments test concatenating the kth letter of words and reversing a list.Source: §1 · p. 2
2 RELATED WORK
Decomposed Prompting builds on few-shot multi-step reasoning and neural modular approaches, distinguishing itself through flexible decomposition structures and few-shot construction of both the decomposer and sub-task agents.
Few-shot Prompts for Multi-Step Reasoning
- Chain-of-Thought supplies intermediate reasoning steps for multi-step tasks (Wei et al., 2022; Chowdhery et al., 2022).This extends few-shot prompting, which lets LLMs learn NLP tasks from a few examples (Brown et al., 2020).Source: §2 · p. 2
- Prior compositions of LLMs or symbolic functions (Jung et al., 2022; Creswell et al., 2023) are characterized as specialized systems with predefined decomposition structures.Other cited examples include Press et al., 2022; Parisi et al., 2022; Gao et al., 2022; Schick et al., 2023.Source: §2 · pp. 2–3
- Unlike least-to-most prompting (Zhou et al., 2023) and successive prompting (Dua et al., 2022), Decomposed Prompting supports recursive and non-linear decompositions.It generates new questions from previous answers and explicitly assigns different prompts or symbolic systems to sub-questions. Unlike least-to-most, it need not require an LLM to eventually answer the complete question.Source: §2 · p. 3
Modular Approaches for Multi-Step Reasoning
- Compared with Text Modular Networks from Khot et al. (2021), Decomposed Prompting uses few-shot LLMs for both decomposer and sub-task agents.Text Modular Networks trained a next-question generator for existing textual and symbolic agents and used best-first search over decompositions. Few-shot construction avoids requiring specialized supervised training data for sub-tasks.Source: §2 · p. 3
3 DECOMPOSED PROMPTING
DECOMP uses a decomposer LLM to build prompting programs and a controller to execute them through modular sub-task handlers. The framework supports hierarchical and recursive decomposition, reusable prompts, and external system calls.
3 DECOMPOSED PROMPTING
- A decomposer LLM generates a prompting program comprising sub-task functions, sub-queries, and answers, which a controller executes until its stopping condition is met.The controller passes inputs and outputs between the decomposer and sub-task handlers.Source: §3 · p. 3
- Few-shot demonstrations teach decomposition, while sub-task handlers can be prompts, further prompting programs, symbolic functions, or trained models.Demonstrations specify sequences of sub-task functions, sub-queries, and answers; handlers can include calculators or specialized supervised models.Source: §3 · p. 3
3.1 DECOMPOSED PROMPTS
- Separate split, str pos, and merge prompts learn word splitting, character lookup, and concatenation from examples independent of the complex task.Sub-task prompts can capture additional generalizations, such as splitting words into letters or merging without a delimiter.Source: §3.1 · p. 4, Figure 2 · p. 4
- Optional control structures, including foreach and references to previous answers, reduce manual decomposition effort and potential errors.foreach applies a sub-task to each array element and combines its answers into an array. Experiments use two compositional operators from Khot et al. (2022).Source: §3.1 · p. 4, §3.2 · p. 4
3.2 PROMPT EXECUTION AND INFERENCE
- Inference alternates history-conditioned decomposition with sub-task execution until [EOQ] causes the last answer to become the final prediction.The experiments use greedy search to approximate MAP answer inference (Dohan et al., 2022).Source: §3.2 · pp. 4–5, Figure 3 · p. 4
3.3 DECOMP CAPABILITIES
- Hierarchical decomposition further divides difficult sub-tasks, such as finding a string’s kth letter through letter enumeration followed by array selection.Direct kth-letter identification challenged GPT3 text-davinci-002; the decomposition reuses the general-purpose split prompt.Source: §3.3 · p. 5, Figure 4 · p. 5
- Recursive self-calls extend base prompting methods to longer inputs by reducing problems to smaller instances where the model is accurate.Standard prompting and CoT cannot express these recursive approaches. Unlike least-to-most prompting (Zhou et al., 2023), DECOMP decomposes iteratively top-down and explicitly supplies relevant prior answers.Source: §3.3 · p. 5
- External system calls let DECOMP retrieve documents for open-domain question answering when knowledge access cannot be handled by an LLM alone.Retrieval can use an Elasticsearch index or Google search.Source: §3.3 · p. 5
4 CASE STUDIES
DECOMP improves symbolic manipulation and multi-hop question answering through hierarchical, recursive, and retrieval-based decomposition. Separate sub-task handlers improve generalization and accuracy, with gains consistent across prompt choices and decomposition schemes.
4.1 kth LETTER CONCATENATION (HIERARCHICAL DECOMPOSITION)
- Close to 100% accuracy persists as inputs lengthen in kth-letter concatenation, while DECOMP outperforms CoT and least-to-most prompting.Separate prompts teach hard sub-tasks more effectively than a single CoT, even with the same rolled-out reasoning procedure. Tests cover an unseen letter position, longer inputs, and a new delimiter.Source: §4.1 · p. 6, Figure 7 · p. 7
4.2 LIST REVERSAL (RECURSIVE DECOMPOSITION)
- Recursive DECOMP improves list-reversal length generalization, whereas base CoT fails on longer sequences and rolled-out CoT becomes too long and convoluted.Using davinci-001, all prompts share three examples containing 3–5 items and are evaluated on 4-, 6-, 8-, and 10-item sequences. Recursive decomposition abstracts away sub-modules that the rolled-out prompt cannot.Source: Figure 8 · p. 7, §4.2 · p. 7
4.3 LONG-CONTEXT QUESTION ANSWERING
- DECOMP outperforms CoT across CommaQA-E evaluation splits and decomposition granularities, with fine-grained decomposition marginally outperforming coarse-grained decomposition.Separate prompts isolate context-independent decomposition from single-hop QA, while finer question-type handlers provide more examples per class. On unseen relation compositions, decomposition scores rise slightly because the relations are easier for its QA models, whereas CoT declines.Source: Figure 10 · p. 8, §4.3 · p. 8
4.4 OPEN-DOMAIN QUESTION ANSWERING
- Across three open-domain QA datasets, Decomp-Ctxt outperforms No-Ctxt throughout and NoDecomp-Ctxt except with Codex on HotpotQA, where performance is comparable.Flan-T5-XXL also outperforms all baselines and achieves scores comparable to Codex-only systems. Single-hop retrieval returns answers and documents for subsequent questions and final QA; GPT3-sized decomposers remain necessary for reliable structured outputs.Source: §4.4 · pp. 8–9, Figure 12 · p. 9
4.5 ADDITIONAL RESULTS
- 17 pt improvement on MultiArith (78 →95) accompanies GSM8K improvement (36 →50.6) when GPT3 extracts CoT answers instead of pattern matching.A targeted answer-extraction handler reduces errors when generated reasoning does not match the expected answer pattern.Source: §4.5 · p. 9
- DECOMP’s gains over baselines remain consistent across prompt choices and decomposition schemes, rather than appearing only in aggregate.Source: §4.5 · p. 9
5 CONCLUSION … A.2 HYPERPARAMETER TUNING FOR OPEN DOMAIN QA
Decomposed Prompting uses modular few-shot sub-tasks and outperforms prior work on four different tasks and generalization settings. The open-domain QA details describe retrieval corpora and held-out tuning of retrieved-paragraph counts.
5 CONCLUSION
- Four different tasks and generalization settings show Decomposed Prompting outperforming prior work.The approach decomposes complex tasks into prompting programs built from simpler sub-tasks.Source: §5 · p. 9
- Separate few-shot prompts make the decomposer and shared sub-tasks independently optimizable, further decomposable, and replaceable with symbolic systems.This modular design draws inspiration from software libraries.Source: §5 · p. 9
- Answer F1 treats predictions and ground-truth answers as token bags when computing precision and recall (Rajpurkar et al., 2016).Further metric details are referenced to HotpotQA (Yang et al., 2018).Source: §5 · p. 9
A.1 RETRIEVAL CORPUSES FOR OPEN DOMAIN QA
- 430,225 paragraphs for 2WikiMultihopQA and 139,416 for MuSiQue result from pooling each dataset’s train, dev, and test question paragraphs.These originally reading-comprehension datasets provide 10 and 20 paragraphs per question, respectively. HotpotQA instead uses the fullwiki setting with its associated Wikipedia corpus.Source: §A.1 · p. 13
A.2 HYPERPARAMETER TUNING FOR OPEN DOMAIN QA
- 100 held-out questions per dataset guide grid-search selection of the retrieved-paragraph count K for NoDecomp-Ctxt and Decomp-Ctxt.The selected K maximizes performance on this held-out set.Source: §A.2 · p. 13
- K ∈ {6, 8, 10} for GPT3 and K ∈ {2, 4, 6, 8} for Flan-T5-* define NoDecomp-Ctxt’s search ranges.GPT3 accommodates more tokens, motivating its different range. NoDecomp-Ctxt performs only one retrieval step.Source: §A.2 · p. 13
- K ∈ {2, 4, 6} defines Decomp-Ctxt’s search range for both GPT3 and Flan-T5-* models.K counts paragraphs retrieved per round; Decomp-Ctxt usually performs multiple retrieval steps, motivating a different range from NoDecomp-Ctxt.Source: §A.2 · p. 13
A.3 ADDITIONAL RESULTS
Additional results are presented for the MuSiQue, HotpotQA, and 2WikiMultihopQA datasets.
- Figure 13 presents results on the MuSiQue dataset.Source: Figure 13 · p. 13
- Figure 14 presents results on the HotpotQA dataset.Source: Figure 14 · p. 13
- Figure 15 presents results on the 2WikiMultihopQA dataset.Source: Figure 15 · p. 14
A.3.1 MUSIQUE
On MuSiQue, retrieval substantially improves performance over No-Ctxt QA across all settings, with further gains from DecomP-based Decomp-Ctxt QA.
- DecomP-based Decomp-Ctxt QA further improves MuSiQue performance beyond the gains achieved with retrieval.Source: §A.3.1 · p. 14
- Retrieval delivers substantial MuSiQue performance gains over No-Ctxt QA.Source: §A.3.1 · p. 14
- The retrieval benefits and further Decomp-Ctxt QA improvements hold across all evaluated settings.Source: §A.3.1 · p. 14
A.3.2 HOTPOTQA
On HotpotQA, incorporating retrieval produces large gains, while gains from DecomP are mostly seen in smaller models.
A.3.2 HOTPOTQA
- Incorporating retrieval produces large gains on HotpotQA.Source: §A.3.2 · p. 14
- Gains from DecomP on HotpotQA are mostly seen in smaller models.Source: §A.3.2 · p. 14
- Figure 14 presents all reported HotpotQA results.Source: §A.3.2 · p. 14
A.3.3 2WIKIMULTIHOPQA
On 2WikiMultihopQA, incorporating retrieval yields large gains, while DecomP provides substantial gains over NoDecomp-Ctxt.
- DecomP provides substantial gains over NoDecomp-Ctxt on 2WikiMultihopQA.Source: §A.3.3 · p. 14
- Incorporating retrieval produces large gains on 2WikiMultihopQA.Source: §A.3.3 · p. 14
- Figure 15 collects all reported results on the 2WikiMultihopQA dataset.Source: §A.3.3 · p. 14
B MATH QA · C EFFECT OF SCALE ON COMMAQA · D RESULTS ON ALL PROMPTS
Decomposed Prompting improves math QA by separating chain-of-thought reasoning from answer extraction. On CommAQA, performance declines with weaker or smaller models, but DECOMP outperforms CoT until performance approaches zero with curie.
B MATH QA
- Math QA experiments used GSM8K Cobbe et al. (2021), MultiArith Roy & Roth (2015), and original CoT prompts from Wei et al. (2022).Source: B MATH QA · p. 14
- Most CoT systems Wei et al. (2022); Wang et al. (2023) extract numbers following the phrase answer is, which can be inaccurate; language-model extraction is proposed as more reliable.Decomposed Prompting first identifies the chain-of-thought reasoning, then uses a second GPT3-based sub-module to extract the answer.Source: B MATH QA · p. 14
- DECOMP first produces chain-of-thought reasoning, then delegates answer extraction to a second GPT3-based sub-module.The authors suggest extending this approach to complex answer types, including nonextractive answer generation from chain-of-thoughts.Source: B MATH QA · pp. 14–15
- 14-point and 17-point improvements over CoT are reported on GSM8K and MultiArith, respectively.These gains come from separating chain-of-thought reasoning from answer extraction.Source: B MATH QA · pp. 14–15, Figure 16 · p. 15
C EFFECT OF SCALE ON COMMAQA
- DECOMP outperforms CoT as CommAQA models weaken or shrink, although performance declines and approaches zero with curie.Figure 17 identifies davinci-001 as weaker and curie-001 as smaller.Source: Figure 17 · p. 15, C EFFECT OF SCALE ON COMMAQA · p. 15
- 2048-token context windows required shorter CommAQA prompts for text-curie-001 and text-davinci-001; evaluation also included text-davinci-002.Prompts were reduced to fit the smaller models’ context windows.Source: C EFFECT OF SCALE ON COMMAQA · p. 15
D.1 PER-PROMPT RESULT ON LETTER CONCATENATION
On letter concatenation with a space delimiter, DECOMP consistently outperforms chain-of-thought and least-to-most prompting, with stable results across prompts P1, P2, and P3.
D.1 PER-PROMPT RESULT ON LETTER CONCATENATION
- Results remain stable across prompts P1, P2, and P3.Source: §D.1 · p. 15
- The evaluation uses letter concatenation with a space delimiter and varies N.Source: §D.1 · p. 15
- DECOMP outperforms chain-of-thought and least-to-most prompting across all tested values of N and all three prompts.Figure 18 reports these comparisons for prompts P1, P2, and P3.Source: §D.1 · p. 15, Figure 18 · p. 16
D.2 PER-PROMPT RESULTS ON COMMAQA
DECOMP outperforms CoT on every evaluated prompt set on CommAQA.
D.2 PER-PROMPT RESULTS ON COMMAQA
- DECOMP outperforms CoT on each CommAQA prompt set, with results for all prompts presented in Figure 19.Source: Figure 19 · p. 16, §D.2 · p. 16
E EFFECT OF DECOMPOSITION SCHEME
Alternative decomposition schemes preserve letter-concatenation scores and improve reversal on longer inputs, while both remain better than CoT. Their trade-offs concern answer-format robustness, correct use of list elements, and GPT3 call counts.
Letter Concatenation
- GPT3-generated sub-questions replace looping over letter-concatenation answers, potentially improving robustness to malformed answer formatting.However, generated sub-questions may reorder, omit, or repeat list elements.Source: E EFFECT OF DECOMPOSITION SCHEME · pp. 16–17
List Reversal
- O(n) GPT3 calls, versus O(log(n)) for binary splitting, are required when reversal recursively reverses the tail and concatenates it before the head.This replaces the original scheme of splitting the list into halves.Source: E EFFECT OF DECOMPOSITION SCHEME · p. 17
E EFFECT OF DECOMPOSITION SCHEME
- Alternative decompositions match the original letter-concatenation scores, strengthen reversal on longer inputs, and outperform CoT on both tasks.The stronger reversal scheme requires more GPT3 calls.Source: Figure 20 · p. 17, E EFFECT OF DECOMPOSITION SCHEME · p. 17
F ERROR ANALYSIS · F.1 LETTER CONCATENATION · F.1.1 DECOMP
DECOMP outperforms CoT and generalizes better on letter concatenation, with analyzed errors confined to sub-task execution. Examples show incorrect letter extraction and failure to insert the requested separator.
F.1.1 DECOMP
- The error analysis found failures only in sub-task execution.The reported examples identify letter extraction and concatenation as failure points.Source: §F.1.1 · pp. 17–18
- DECOMP consistently outperforms CoT and generalizes better on the kth-letter concatenation task.Figure 22 reports exact-match (EM) results.Source: Figure 22 · p. 18
- The benchmark comparison uses k=3 and a semicolon delimiter.These evaluation conditions differ from the space-delimited error examples.Source: Figure 22 · p. 18, §F.1.1 · p. 18
- The evaluation varies N, the number of input words, to compare performance across input lengths.Figure 22 reports DECOMP’s better generalization under this variation.Source: Figure 22 · p. 18
- The letter-extraction sub-task returned “c” rather than the requested third letter “n” from “Nancy,” despite receiving an explicitly indexed character list.This changed the final prediction from “n m b u n” to “c m b u n.”Source: §F.1.1 · p. 18
- The concatenation sub-task returned “leoie” instead of “l e o i e,” preserving the letters but omitting the requested spaces.The sub-task prompt explicitly instructed concatenation using a space.Source: §F.1.1 · p. 18
F.1.2 COT W/ ROLLOUT
On letter concatenation, CoT produced errors more frequently than DECOMP, which the authors attributed to difficulty effectively teaching each subtask within CoT. Examples show incorrect letter extraction despite correctly enumerated letter positions.
F.1.2 COT W/ ROLLOUT
- CoT made errors more frequently than DECOMP on letter concatenation because individual subtasks could not be effectively taught within CoT.The error types were similar to those observed with DECOMP.Source: §F.1.2 · p. 18
- For “Sheila,” CoT incorrectly extracted “i” at position 3 despite correctly listing “e” at that position.The predicted concatenation was “i c r a u,” rather than the expected “e c r a u.”Source: §F.1.2 · p. 18
- For “Benitez,” CoT incorrectly extracted “i” at position 3 despite correctly listing “n” at that position.The predicted concatenation was “o l k t i,” rather than the expected “o i k t n.”Source: §F.1.2 · p. 18
F.2 COMMAQA
CommaQA errors primarily arise from answering single-hop sub-questions incorrectly. CoT makes the same errors more frequently because it cannot delegate this sub-task to a specialized prompt.
F.2 COMMAQA
- CommaQA errors primarily stem from incorrect answers to single-hop sub-questions.Source: §F.2 · p. 19
- CoT makes the same types of errors more frequently because it cannot delegate the QA sub-task to a specialized prompt.Source: §F.2 · p. 19
- The illustrated failure omits Polytetrafluoromethane from Haldron’s movie list and returns only Pompasole instead of Hydrallium and Pompasole.Source: §F.2 · p. 19
G TASK PROMPTS
This section presents task prompts for letter concatenation, sequence reversal, factual and multi-hop question answering, and a two-stage math-answering pipeline. The examples illustrate direct answering, chain-of-thought reasoning, and modular or recursive decomposition, including operators for passing intermediate answers and retrieval-based prompts that collect document titles for final answering.
G.1.3 COT
- CoT prompts narrate letter extraction and concatenation, while the shared framework separates GPT3 chain-of-thought generation from regex-based answer extraction.When the module name is omitted, the chain of thought is sent to the extractor by default.Source: G TASK PROMPTS · p. 19, §G.1.3 · p. 22
G TASK PROMPTS
- The default select operator replaces references to earlier answer indices with their corresponding answers, following the operators defined by Khot et al.Select is assumed whenever an operator is not specified.Source: G TASK PROMPTS · p. 19
- The foreach operator applies a question to each list element and collects answers; foreach merge additionally flattens the results and removes duplicates.Their implementation names are project values and project values flat unique, respectively.Source: G TASK PROMPTS · p. 19
G.1 LETTER CONCATENTATION
- The letter-concatenation appendix shows one experimental prompt, with the complete prompt collection provided as supplementary material.Source: §G.1 · p. 19
G.1.1 DECOMPOSED PROMPTING
- Decomposed letter concatenation splits the input into words, extracts a specified or last letter from each word, and merges the letters using the requested separator.The str position module can itself split a word into indexed letters and call arr position to retrieve the requested letter.Source: §G.1.1 · p. 20
G.1.4 LEAST-TO-MOST W/ ROLLOUT
- Least-to-most rollout reuses a shorter prefix’s answer, appends the next word’s extracted letter, and then invokes answer extraction.The demonstrated continuation combines the existing “b x” output with Simon’s fourth letter, “o”, to produce “b x o”.Source: §G.1.4 · pp. 23–24
G.1.5 ALT DECOMP SCHEMA (GENERATE EACH SUB-QUESTION)
- The alternative decomposition schema explicitly generates a separate letter-extraction question for each word before merging the answers.Its last-letter example separately queries Augusta, Ada, and King, then concatenates their answers into “a a g”.Source: §G.1.5 · p. 24
G.2.1 SPLIT REVERSAL
- Split reversal implements Algorithm 1 by recursively halving sequences, reversing each half, and joining the reversed second half before the reversed first half.Sequences shorter than four items are reversed directly; the algorithm caption reports O(log n) LM calls for n items.Source: §G.2.1 · pp. 25–26
- The modular reversal prompt delegates extraction, number removal, reversal, and joining to named subtask calls linked through intermediate-answer references.Numbered sequence halves are extracted first, then stripped of their numbering before reversal.Source: §G.2.1 · pp. 25–26
- The chain-of-thought reversal prompt enumerates items by position, restates those positions in reverse order, and outputs the reversed sequence.The four-item demonstration proceeds from first through fourth, then fourth through first.Source: §G.2.1 · p. 27
- The unrolled decomposition prompt narrates splitting, number removal, reversing each half, and joining them in a single reasoning trace.For odd-length sequences, the illustrated split rounds the first half's length down.Source: §G.2.1 · p. 27
- The tail-based reversal variant extracts the first element, reverses the remaining sequence, and appends the first element to the reversed tail.Its prompt also removes numbering before passing extracted items to reversal and joining subtasks.Source: §G.2.1 · p. 28
G.3 LONG-DOCUMENT QA
- The long-document QA appendix supplies one prompt used for CommaQA experiments, with the complete prompt set provided as supplementary material.Source: §G.3 · p. 29
G.3.1 DECOMPOSED PROMPTING: (COARSE)
- Coarse decomposed prompting chains selection and QA projections, flattening and deduplicating intermediate results to answer multi-hop questions about people, movies, and awards.One example selects Modiparity winner Bioperatology, retrieves the directed movies Pestok and Vitrilateral, and returns their awards Gutney and Antipositive.Source: §G.3.1 · pp. 29, 31
- Coarse prompt examples answer direct questions with lists, identifying Sclerocybin’s written movies and people born in 1935.The respective answers are Noenometer and Tayenne, and Sclerocybin and Zayage.Source: §G.3.1 · p. 31
G.3.2 DECOMPOSED PROMPTING: (FINE)
- Fine decomposition chains simp qa, pos qa, and aw qa calls using selection and flattened, deduplicated projections of previous answers.Examples select people by birth year, retrieve movies they produced or wrote, and retrieve those movies’ awards. References #1 and #2 identify prior answers; [EOQ] marks completion.Source: §G.3.2 · pp. 31–32
- Award-led decompositions traverse from winning movies to actors or from award-winning people to directed movies, then retrieve awards.The Erowid example returns Aniconder and Trifogation; the Modiparity example returns Gutney and Antipositive.Source: §G.3.2 · p. 32
- The aw qa examples retrieve awards for both movies and people, and identify recipients of a named award.Zalate receives Hallowcock, Wetherality receives Aniconder, and the Modiparity recipient is Bioperatology.Source: §G.3.2 · pp. 33–34
- The pos qa examples retrieve movies produced or directed by a named person and actors appearing in a named movie.Teeplemole’s producer query returns Featsaw and Zalate; Bioperatology’s director query returns Pestok and Vitrilateral. Dewbar’s actor query returns Wetherality.Source: §G.3.2 · pp. 34–35
- The simp qa examples select people by birth year or country and movies by release year.The country query identifies Gastrat as from Stridery; the release-year query returns Dewbar and Nilitude for 1984.Source: §G.3.2 · pp. 31, 37
- Fine decomposed prompts demonstrate direct questions about birth years, countries of origin, and movie release years, returning answers as lists.Examples return Kapod’s birth year, people from Legault, and Nohit’s release year.Source: §G.3.2 · pp. 37–38
G.3.3 COT
- The CoT prompt demonstrates a birth-year-to-producer-to-movie-to-award chain, returning Zorgion, Chowwurst, and Hallowcock.The demonstration supplies reasoning under QS, the answer under A, and an [EOQ] terminator.Source: §G.3.3 · p. 38
- Another CoT demonstration traces Erowid-winning movies to their actors and then the actors’ awards, returning Aniconder and Trifogation.The reasoning identifies Dewbar and Caudacite, then Wetherality, Lougeri`ere, and Gigabut.Source: §G.3.3 · p. 39
- Additional CoT demonstrations retrieve movie awards through award-winning directors or writers selected by birth year.The director example returns Gutney and Antipositive; the writer example returns Brownbeard, Goosehead, and Handt.Source: §G.3.3 · pp. 39–40
G.4 SHORTER PROMPTS FOR SMALLER CONTEXT WINDOWS
- Shorter qa(small) demonstrations answer single-relation questions about awards, production, acting, and countries of origin.Examples include retrieving a movie’s awards and retrieving movies associated with an award, with answers formatted as lists.Source: §G.4 · pp. 40–41
- Shorter variants include aw qa(small), pos qa(small), and simp qa(small).The supplied aw examples retrieve award-winning movies, while pos examples retrieve movies a person produced or acted in.Source: §G.4 · pp. 41–43
- Shorter-context factual QA demonstrations combine structured movie relations and prose person facts with direct questions returning lists of matching entities.Examples ask which people were born in 1910 or come from Piperfish.Source: §G.4 · p. 43
- The shorter-context chain-of-thought demonstration connects people’s birth years to their produced movies and those movies’ awards before returning an answer list.The example identifies Muntaril and Teeplemole as born in 1910 and returns Zorgion, Chowwurst, and Hallowcock.Source: §G.4 · p. 44
G.5 MATH QA
- Math QA deterministically calls cot to generate chain-of-thought reasoning, then gpt ans to extract the answer.An extraction demonstration converts reasoning containing 3 + 2 = 5 into the standalone answer 5.Source: §G.5 · pp. 44–45
G.6 OPEN DOMAIN QA
- 100 development-set questions are used to tune the number of retrieved paragraphs for all retrieval-based approaches.The appendix includes prompts for 5 of 20 randomly sampled questions.Source: §G.6 · p. 46
- Open-domain multihop QA chains retrieve odqa subquestions, then passes collected document titles and the original question to multihop titleqa.One example first identifies David Hicks, then asks where he received paramilitary training, producing the final answer Afghanistan.Source: §G.6 · p. 46
- The age-comparison example retrieves each person’s birth date separately before multihop titleqa identifies Jeremy Horn as older than Renato Sobral.This illustrates separate retrieval subquestions feeding a final comparison rather than an entity-dependent retrieval chain.Source: §G.6 · pp. 46–47
- Retrieval-based demonstrations first retrieve candidate titles, then invoke singlehop titleqa, returning titles and an answer before terminating with [EOQ].The David Hicks training example returns Afghanistan while retaining the candidate titles in the structured response.Source: §G.6 · p. 48
- Single-hop title-QA demonstrations pair Wikipedia-titled contexts with separate factual questions and short answer lists.Separate examples identify David Hicks as the Australian detainee who published Guantanamo: My Journey and name Afghanistan as his training country.Source: §G.6 · p. 49
- Direct multi-hop title-QA demonstrations combine identifying the Australian detainee who published Guantanamo: My Journey with determining his training country.The combined question receives the short answer Afghanistan.Source: §G.6 · p. 51
- The comparison demonstration asks whether Jeremy Horn or Renato Sobral is older and supplies Jeremy Horn as the direct answer.Separate single-hop examples supply August 25, 1975 for Horn’s birthdate and September 7, 1975 for Sobral’s.Source: §G.6 · pp. 50–51
- Album demonstrations answer separate single-hop questions and a combined multi-hop question with Walls and Bridges.The combined question joins Nobody Loves You with Apple Records and Lennon’s 18-month separation from Yoko Ono.Source: §G.6 · pp. 51–52
- Chain-of-thought demonstrations explicitly identify David Hicks or Rihanna before answering the associated question about training location or awards.The examples conclude with Afghanistan for Hicks and one award at the American Music Awards of 2012 for Rihanna.Source: §G.6 · p. 52
- Narrative QA demonstrations state supporting facts before a concluding answer, exemplified by comparing Jeremy Horn’s and Renato Sobral’s birth dates.The demonstration concludes that Jeremy Horn is older.Source: §G.6 · pp. 52–53
- The 2wikimultihopqa decomposition prompt issues retrieve odqa subquestions, collects retrieved titles, and sends the original question to multihop titleqa.One demonstration retrieves two film directors and their nationalities before answering that they do not share a nationality.Source: §G.6 · p. 53
- A temporal-comparison decomposition retrieves each film’s director and death date before selecting Twenty Plus Two as the film whose director died later.The retrieved dates are January 23, 2006 for Joseph M. Newman and September 15, 2001 for Fred de Cordova.Source: §G.6 · pp. 53–54
- Sequential relationship questions use an intermediate answer in the next retrieval, tracing Krishna Shah through Rudra Shah to grandchild Prithvipati Shah.The accumulated titles and original grandchild question are then passed to multihop titleqa.Source: §G.6 · p. 54
- The retrieve odqa submodule first retrieves titles, then invokes singlehop titleqa, returning both the titles and the extracted answer.For Coolie No. 1, retrieval returns two titles and the answering step identifies David Dhawan.Source: §G.6 · pp. 54–55
- Singlehop titleqa demonstrations pair Wikipedia-title contexts with short answer lists for director identities, nationalities, and death dates.Examples answer David Dhawan for a director question, India for his nationality, and January 23, 2006 for Joseph M. Newman’s death.Source: §G.6 · pp. 57–58
- Kinship demonstrations connect single-hop child questions to a multi-hop grandchild answer through the same intermediate person.Krishna Shah’s child is Rudra Shah, whose child is Prithvipati Shah; the direct and chain-of-thought grandchild demonstrations return Prithvipati Shah.Source: §G.6 · pp. 58, 59, 61
- 2WikiMultihopQA demonstrations contrast direct answer lists with chain-of-thought answers that identify intermediate entities and facts before reaching a conclusion.The nationality example identifies David Dhawan and Karl Freund, associates them with India and Germany, and concludes that their nationalities differ.Source: §G.6 · pp. 58–60
- Temporal-comparison demonstrations select Twenty Plus Two for the later director death and Martin Hodge for the earlier birth.The director comparison explicitly contrasts Joseph M. Newman’s death on January 23, 2006, with Fred de Cordova’s death on September 15, 2001.Source: §G.6 · pp. 59–60
- Decomposed prompts chain retrieve odqa calls, then pass accumulated Wikipedia titles and the original question to multihop titleqa.The CIMI-FM demonstration retrieves Quebec City, then its first large winter carnival date, and returns 1894 before terminating with EOQ.Source: §G.6 · p. 61
- Two-step retrieval can resolve an employer first and then ask when that organization was founded.The Neville A. Stanton demonstration retrieves the University of Southampton, retrieves its founding year as 1862, and passes the collected titles to final multi-hop answering.Source: §G.6 · p. 62
- Three-step retrieval demonstrations follow a performer-to-birthplace-to-county chain before answering the original question.The Smoke in tha City example follows MC Eiht to Compton and then Los Angeles County, which becomes the final answer.Source: §G.6 · pp. 62–63
- The ISO example first identifies the International Organization for Standardization as setting ISO 21500 standards, then asks for its headquarters and answers Geneva.The headquarters question explicitly names the organization returned by the preceding answer.Source: §G.6 · pp. 63–64
- Combined retrieval-and-QA examples return titles and answer lists, whereas standalone singlehop examples provide Wikipedia-titled contexts and answer lists.The combined format closes with [EOQ].Source: §G.6 · pp. 63, 65, 66
- Open-domain QA demonstrations retrieve candidate article titles, then pass those titles and the question to a singlehop titleqa module.Retrieved candidates can include unrelated titles, as in the California-border example.Source: §G.6 · p. 64
- 1,989 mi is the demonstrated border-length answer after successive questions connect Finding Dory to California and California to Mexico.Each question invokes retrieval separately.Source: §G.6 · p. 64
- Direct multihop titleqa demonstrations pair composite questions with answers, without showing intermediate reasoning.Examples answer Geneva for ISO headquarters, 1862 for Neville A. Stanton’s employer’s founding, and Los Angeles County for the Smoke in tha City performer’s birthplace county.Source: §G.6 · pp. 67–68
- The chain-of-thought example explicitly links CIMI−FM to Quebec City before identifying the first large winter carnival there as occurring in 1894.The response states both intermediate facts before repeating the final answer.Source: §G.6 · p. 68
- The ISO 21500 example identifies International Organization for Standardization as the standards-setting organization and gives Geneva as its headquarters.Source: §G.6 · p. 68
- The Finding Dory demonstration first identifies California as the film’s setting, then Mexico as the country bordering that state.Source: §G.6 · p. 69
- 1,989 mi is the US–Mexico border length given as the answer to the question starting from Finding Dory’s setting.The question asks for the US border length with the country bordering the state where the film takes place.Source: §G.6 · p. 69
- 1862 is the founding year given for the University of Southampton, identified as Neville A. Stanton’s employer.Source: §G.6 · p. 69
- The Smoke in tha City demonstration identifies MC Eiht as the performer and Compton as his birthplace before determining the county.Source: §G.6 · p. 69
- The performer-birthplace example answers Los Angeles County as the county containing Compton.Source: §G.6 · p. 69
Related papers
This paper cites
- Language Models are Few-Shot Learners2020
- Training language models to follow instructions with human feedback2022
- Self-Consistency Improves Chain of Thought Reasoning in Language Models2022
- HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answering2018
- MuSiQue: Multihop Questions via Single-hop Question Composition2021
- PAL: Program-aided Language Models2022
Cited by
- Statutory Article Retrieval from Arabic Judicial Narratives: Family Law and Law of Evidence in Saudi Arabia2026
- Decompose, Don't Expand: Capability-Independent AI Systems by Construction2026
- Ask Before You Answer: A Question-Driven Evidence Reasoning Architecture (QERA) for In-Context Learning2026
- Knowing When the Evidence Is Enough: Requirement-Directed Search with Horn-Closure Certificates2026
- SCOPE: Compiling Natural-Language Policies into Neurosymbolic Predicate Programs2026
- Automated Materials Data and Knowledge Extraction using Machine Learning and Large Language Models2026