Start studying
Module 7 · Prompt Engineering Module contents
Module 7  ·  Card 11 / 17intermediate

Prompt Chaining

Instead of one prompt that does five things, use five prompts that each do one thing.

Each step gets the previous step's output as input, so the work moves along a pipeline.

Smaller steps are easier to test, cheaper to retry, and far easier to debug when they misbehave.

You can also route each step to a different model, using the expensive one only where it earns its cost.

The price is latency and the risk that an early mistake is carried confidently to the end.

Learn in depth ↓
Module 07 · Prompt Engineering · 17 concepts
In depth  /  15 lines

Prompt Chaining, in more detail

A prompt asking a model to read a document, extract the risks, rank them and draft an email is doing four jobs.

When the output is wrong, there is no way to tell which of the four went astray.

Prompt chaining splits the work into steps, each with its own prompt, input and expected output.

Extraction produces a list, ranking consumes that list, drafting consumes the ranked list.

The benefits are the ordinary benefits of decomposition applied to a probabilistic component.

Each step can be evaluated against its own small test set, so quality is measurable per stage.

A failure is attributable, which turns debugging from guesswork into inspection.

Retries become cheap, because only the failed step is repeated rather than the whole pipeline.

Structured output between steps makes the boundaries checkable before the next step runs.

Model routing becomes possible: a small fast model extracts, a strong model does the judgement.

That alone often cuts cost substantially without any measurable loss in the final result.

The costs are real and should be weighed rather than ignored.

Latency adds up, since the steps are sequential and each waits for the one before.

Context is often repeated across steps, so total token spend can rise even as the per-step spend falls.

And errors compound: a mistaken extraction is treated as fact by every downstream step, so validate early.

Test yourself

One question on this card. Every option explains itself once you pick, right or wrong.

Question 1
What is the main advantage of splitting one large prompt into a chain of smaller ones?
Prompt Engineering

17 concepts in this module, then a graded test with every answer explained.

Study this module →
↑↓ move↵ openesc close