Prompt Chaining
A technique in which a complex task is broken down into a sequence of prompts. The output of one step becomes the input of the next.
Why
One huge prompt for a complex task works poorly: the model gets confused and the answer becomes blurry. A chain gives control at every stage.
Example: Article from Idea
flowchart LR
A[Plan] --> B[Draft]
B --> C[Fact-check]
C --> D[Style]
D --> E[Final]
- Draw up an outline for the article.
- Write a draft following the outline.
- Check the facts.
- Improve the style.
- Put together the final version.
When to Use
- the task has stages;
- quality control is needed at every step;
- intermediate results can be validated.
Trade-offs
A chain is longer and more expensive (several model calls), but the quality is higher and debugging is easier: you can see at which step it breaks.