Prompt Chaining

Prompt chaining splits a complex task into a sequence of simpler prompts to a language model, each using the last output, as in AI data extraction.

Status
Published, version 1.0.0
Last reviewed
10 Nov 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

Prompt Chaining in AI-Assisted Evidence Work

Prompt chaining breaks a job that is too large for one instruction into a fixed sequence of smaller prompts to a large language model, with the answer from each step fed into the prompt for the next. The analyst, not the model, decides how the job is split and in what order the pieces run, so each intermediate output can be inspected and corrected on its own. For a health economist or HTA analyst the interest is practical, because pulling inputs for a health economic model out of trial reports falls naturally into stages, and NICE ECD20 (2026), the NICE framework on AI methods for evidence, names prompt chaining as one way of putting extraction questions to a model. The gains are conditional, since an error made early in a chain is carried into every later step.

How a chain is built

Wu, Terry and Cai introduced the chaining of language model steps in a paper first posted in 2021 and published at CHI 2022. In their design a problem is broken into sub-tasks, each with its own natural language prompt, and the results of earlier steps are placed in the input of later ones, so one underlying model can serve every step. From a survey of 73 existing uses of language models they derived eight primitive operations suited to a single model run, among them classification, which can act as triage or as a validation check and so lets a chain branch.

In their within-subject study, 20 participants did the same tasks with and without chains, using the same model in both interfaces. Participants rated the chained interface higher for transparency and for control, and outcomes were of higher quality 82% of the time with chaining. Participants also isolated single steps to find faults, much as a programmer runs a unit test.

Not every step has to be a call to a language model. Khot and colleagues, in their Decomposed Prompting method, showed that sub-tasks can be handed to other prompts, to trained models or to symbolic functions such as a retrieval module, each of which can be tuned or replaced on its own. In evidence work, checked code can then do the arithmetic while the model handles steps that need language, such as finding where a report gives an outcome. Retrieval-augmented generation can likewise form one step of a chain.

How chaining differs from neighbouring techniques

Chain-of-Thought Prompting asks the model to write out its reasoning inside a single response, so the model chooses the steps. In a chain the decomposition is set in advance by its designer and each step is a separate call, which makes the steps easier to audit but means the designer must already know how the task divides.

Least-to-most prompting, from Zhou and colleagues, sits between the two. The model is first prompted to break a problem into simpler subproblems and then prompted to solve them in sequence, with each answer added to the prompt for the next. With the code-davinci-002 model it reached at least 99% accuracy on every split of the SCAN compositional benchmark using 14 examples, against 16% for chain-of-thought prompting on the length split. The authors also reported that decomposition prompts did not generalise well across domains, so a prompt that shows how to split maths problems does not teach a model to split commonsense questions.

Sun and colleagues compared a chain of separate draft, critique and refine prompts with one stepwise prompt asking for all three stages. Across 100 summarisation tasks, prompt chaining won the most comparisons, 77 of 100 against a one-step GPT-4 summary with GPT-4 as the judge, and the authors suspected that a stepwise prompt produces a simulated refinement, writing a weaker first draft only to correct it. An AI agent differs from a chain in who chooses the next step, since an agent decides its own actions while it runs, whereas a chain follows a route fixed in advance.

Where NICE ECD20 places prompt chaining

The ECD20 glossary lists prompt chaining as a technique of Prompt Engineering. Its chapter on AI methods for evidence synthesis applies the term to one of three ways of delivering data extraction questions, the iterative strategy, in which the study reports are given to the model once and the questions follow one by one. The alternatives are a single prompt carrying every question, and an independent strategy in which each question goes to its own model call. ECD20 notes that the independent route limits order effects and interference between items, and that it may make results more stable and accurate.

The ordering problem has been seen in practice. Schmidt and colleagues, testing GPT-4 for extraction in systematic reviews with every prompt sent in one request, found that the order of the prompts changed the responses, and that asking about study comparisons first markedly increased the detail extracted for animal studies. They noted that isolated requests might avoid this but lose useful context. For abstract screening, ECD20 warns that working through records one after another in a single conversation may degrade performance over many turns, and Laban and colleagues measured an average drop of 39% across six generation tasks when an instruction was revealed over several turns instead of all at once.

The two senses of the term differ in a way that matters for reporting. In the design of Wu and colleagues each step is a separate call that sees only the inputs passed to it, whereas the iterative strategy in ECD20 keeps the whole conversation, earlier answers included, inside the model's Context Window. A methods report should say which form was used and what each step could see, and the ECD20 advice on re-validating after prompt changes and keeping a prompt library then applies to every step.

For economic evaluation, ECD20 allows AI only as support under close human oversight, such as code a person verifies and runs or parameter suggestions that are never substituted into a model automatically. A chain suits that role, because a human check can sit between steps.

Worked example with a chained transition probability

All numbers in this example are illustrative. A team building a Markov model with monthly cycles needs the monthly probability of disease progression in both arms of a trial that reports a five-year cumulative progression risk and a hazard ratio.

1. Locate the passages. The first prompt asks the model to point to where the report gives cumulative progression in the control arm and the hazard ratio, by section, table and page. A reviewer reads those passages and copies the two sentences, one stating that 30% of control patients had progressed by five years and one giving a hazard ratio of 0.75. The model only locates the text here, because NICE ECD20 (2026) does not currently recommend generative AI for extracting the text itself.

2. Structure the values. A second prompt receives only the two copied sentences and returns structured fields, namely a proportion of 0.30, a time of 5 years, the control arm and a hazard ratio of 0.75. The reviewer compares the fields with the sentences.

3. Convert risk to a rate in code. The arithmetic is done by checked code, not by the model, using the standard rate-to-probability conversion.

r=−ln⁡(1−P)tr = \frac{-\ln(1 - P)}{t}

where rr is the constant annual progression rate, PP is the cumulative probability of progression observed over the period and tt is the length of that period in years. Here 1 − 0.30 = 0.70, the natural logarithm of 0.70 is −0.356675, and dividing 0.356675 by 5 years gives a rate of 0.071335 per year, which assumes the progression hazard was constant over the five years.

4. Convert the rate to a cycle probability.

pcycle=1−e−r Δtp_{cycle} = 1 - e^{-r \, \Delta t}

where pcyclep_{cycle} is the transition probability per model cycle, rr is the annual rate from step 3, Δt\Delta t is the cycle length in years and ee is the base of the natural logarithm. With Δt\Delta t = 1/12, the product is 0.071335 / 12 = 0.0059446, so the comparator probability is 1 − e^(−0.0059446) = 0.005927 per month.

5. Apply the hazard ratio. Assuming proportional hazards, the treatment rate is 0.071335 × 0.75 = 0.053501 per year. Dividing by 12 gives 0.0044584, so the treatment probability is 1 − e^(−0.0044584) = 0.004449 per month.

6. See how an early error travels. Suppose step 2 had recorded the time as 3 years instead of 5. Step 3 would give 0.356675 / 3 = 0.118892 per year, step 4 would give 0.118892 / 12 = 0.0099076 and a monthly probability of 1 − e^(−0.0099076) = 0.009859. That is 0.009859 / 0.005927 = 1.66 times the correct value, with every later step computed faithfully on the wrong input. The check after step 2 is where this error is cheapest to catch.

7. Interpretation. A reviewer supplied and checked every piece of text the model handled and code did the arithmetic, so the analyst still decides whether the values enter the model.

How errors accumulate along a chain

A simple model shows why long chains need checkpoints. Every added step is another chance of error. If each step must be right for the final output to be right, much as a patient must survive every cycle of a cohort model, the chance that the whole chain succeeds is

Pchain=∏k=1KpkP_{chain} = \prod_{k=1}^{K} p_k

where PchainP_{chain} is the probability that the final output is correct, KK is the number of steps and pkp_k is the probability that step kk is correct when its inputs are correct. The formula assumes that steps fail independently and that no later step corrects an earlier error.

With illustrative accuracies of 0.95 for step 1, 0.98 for step 2 and 1.00 for each code step, PchainP_{chain} = 0.95 × 0.98 = 0.931. Across 40 model inputs, about 40 × (1 − 0.931) = 2.76 would be wrong without human checks. A chain of six model calls each correct with probability 0.97 gives 0.97 raised to the sixth power, which is 0.8330, or about 40 × (1 − 0.8330) = 6.68 wrong inputs out of 40, even though each step looks more accurate than step 1 above. The product rule ignores validation steps that catch errors and failures that tend to occur together, so it is a rough guide and not a forecast.

Limitations and common misreadings

Chaining is not automatically more accurate. The gains reported by Wu and colleagues and by Sun and colleagues came from writing and summarisation tasks, and for data extraction ECD20 leans towards independent calls, so a chain needs validating on development data like any other prompt design. It also needs more model calls, and an iterative chain sends a growing conversation to the model at every turn.

Chains can be harder to follow than a single prompt, and nine participants in the study by Wu and colleagues found them more complex to learn. A chain also does not remove Hallucination (AI), because any step can invent a quote or a number. Tidy intermediate outputs can invite Automation Bias, the undue reliance on automated output that ECD20 warns against, so a human check that only confirms the format adds little.

Sources

  • Khot T, Trivedi H, Finlayson M, Fu Y, Richardson K, Clark P, Sabharwal A. Decomposed prompting: a modular approach for solving complex tasks. International Conference on Learning Representations (ICLR 2023). 2023. https://arxiv.org/abs/2210.02406
  • Laban P, Hayashi H, Zhou Y, Neville J. LLMs get lost in multi-turn conversation. arXiv preprint 2505.06120. 2025. https://arxiv.org/abs/2505.06120
  • National Institute for Health and Care Excellence. AI methods for evidence framework (ECD20). NICE; published 9 November 2026. Chapters on principles for using AI in evidence activities, AI methods for evidence synthesis and AI methods for health economic evaluation, and Appendix A glossary. https://www.nice.org.uk/corporate/ecd20
  • Schmidt L, Hair K, Graziosi S, Campbell F, Kapp C, Khanteymoori A, et al. Exploring the use of a large language model for data extraction in systematic reviews: a rapid feasibility study. 3rd Workshop on Augmented Intelligence for Technology-Assisted Review Systems (ALTARS 2024). 2024. https://arxiv.org/abs/2405.14445
  • Sun S, Yuan R, Cao Z, Li W, Liu P. Prompt chaining or stepwise prompt? Refinement in text summarization. Findings of the Association for Computational Linguistics (ACL 2024). 2024. https://arxiv.org/abs/2406.00507
  • Wu T, Terry M, Cai CJ. AI chains: transparent and controllable human-AI interaction by chaining large language model prompts. CHI Conference on Human Factors in Computing Systems (CHI '22). 2022. https://doi.org/10.1145/3491102.3517582
  • Zhou D, Schärli N, Hou L, Wei J, Scales N, Wang X, et al. Least-to-most prompting enables complex reasoning in large language models. International Conference on Learning Representations (ICLR 2023). 2023. https://arxiv.org/abs/2205.10625

Library

Publications

1
  • Journal article

    Generative Artificial Intelligence to Automate the Adaptation of Excel Health Economic Models and Word Technical Reports — Rawlinson W, Teitsson S, Reason T, et al, Vol. 28, No. 11, pp. 1683-1689 ed., 2025 (Value in Health)

    LLM pipelines that adapt Excel cost-effectiveness models and their Word reports to a new setting, checked for accuracy.

Frequently Asked Questions (6)

  • What is Prompt Chaining?

    Prompt chaining splits a complex task into a sequence of simpler prompts to a language model, each using the last output, as in AI data extraction.

    Source: Wu et al. 2022

  • How does NICE ECD20 apply prompt chaining to data extraction for a systematic review?

    NICE ECD20 (2026) uses the term for the iterative way of putting extraction questions to a large language model, in which the study reports are supplied once and the questions then follow one at a time in the same conversation. The framework sets this beside two other strategies, a single prompt that carries every question and an independent strategy that sends each question to its own model call. It notes that the independent route limits prompt ordering effects and interference between items, and that it may make results more stable and accurate. A methods report should therefore state which strategy was used and what each step could see.

    Source: NICE ECD20 (2026)

  • How does prompt chaining differ from chain-of-thought prompting and least-to-most prompting?

    Chain-of-thought prompting asks a model to write out its reasoning within one response, so the model itself chooses the steps. In prompt chaining the designer fixes the decomposition in advance and each step is a separate call, which makes every step easier to audit but requires the designer to know how the task divides. Least-to-most prompting, described by Zhou and colleagues, falls between the two, because the model first breaks a problem into simpler subproblems and then solves them in turn with each answer added to the next prompt. With the code-davinci-002 model and 14 examples it reached at least 99% accuracy on every split of the SCAN benchmark, against 16% for chain-of-thought prompting on the length split.

    Source: Zhou et al. 2023

  • How can prompt chaining be used to extract inputs for a health economic model?

    A team building a Markov model might first prompt a language model to point to where a trial report gives the cumulative progression risk and hazard ratio, and a reviewer then copies those sentences from the report. A second prompt turns the copied sentences into structured values, which the reviewer checks against the source. Checked code, not the language model, then converts the risk to a rate and the rate to a monthly transition probability. This keeps the model in the support role that NICE ECD20 (2026) allows for health economic evaluation, with a human check between steps and parameter suggestions never placed in a model automatically.

    Source: NICE ECD20 (2026)

  • Why does an early error matter more in prompt chaining than in a single prompt?

    Each step in prompt chaining takes the output of the previous step as its input, so a mistake made early is passed on faithfully to every later step. In an illustrative transition probability example, recording a five-year follow-up period as three years makes the monthly probability about 1.66 times the correct value, even though every later calculation is done correctly. Long chains therefore need checks between steps, placed where an error is cheapest to catch. Wu and colleagues found that users of chains could isolate single steps to trace faults, much as a programmer runs a unit test.

    Source: Wu et al. 2022

  • Does prompt chaining give better results than a single stepwise prompt?

    Sun and colleagues compared a chain of separate draft, critique and refine prompts with one stepwise prompt that asked for all of those stages at once. Across 100 summarisation tasks, prompt chaining won the most comparisons against a one-step GPT-4 summary, 77 of 100, with GPT-4 as the judge. The authors suspected that a stepwise prompt can produce a simulated refinement, in which the model writes a weaker first draft only to correct it. These gains came from summarisation, so a chain used for data extraction in health technology assessment still needs validating on development data like any other prompt design.

    Source: Sun et al. 2024

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 10 Nov 2026

Content version: 1.0.0

Canonical Identity

Term code
HS-HP-DH-100

Stable URI · Machine-readable · Resolvable · CC BY 4.0

This article is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Author: Dr Darrin Baines · Publisher: Intelligent Parameters Ltd · Identifier: https://healtheconomics.wiki/concept/prompt-chaining