Prompt Chaining
One prompt that asks a model to read a document, pull out the claims, check each one and write a summary will do all four jobs adequately and none of them well. Prompt chaining is the decision to stop asking — to split the work into separate calls where each has a single job and the output of one becomes the input of the next.
How a chain is builtEach step is its own prompt with its own instructions, and the glue between steps is ordinary code: parse the previous answer, reshape it, drop what the next step does not need. A document-QA chain might extract the relevant passages, answer from only those passages, then rewrite the answer for its audience. Because the steps are separate, each can use a different model — a cheap one to classify, an expensive one to write — and frameworks such as LangChain exist largely to wire this plumbing.
Why splitting helps- Attention stays focused: a short prompt carrying one instruction is followed far more reliably than a long one carrying five.
- Failures become visible: when the final answer is wrong, you can see which step produced the bad intermediate instead of guessing.
- Each step is testable against its own expected output, and fixable without disturbing the rest.
Latency and token spend add up across calls, and errors compound — a faulty extraction is accepted as fact by every step downstream. A chain is also a fixed pipeline: the sequence is decided by you in advance, not chosen by the model as it goes.
Prompt chaining breaks a task into a sequence of separate model calls, each with one narrow instruction, passing the output of each step as input to the next. Splitting the work makes every step more reliable than a single overloaded prompt and shows exactly where a wrong answer came from. The price is extra latency and tokens, and the risk that an early mistake is treated as fact by every step after it.
Think of an assembly line instead of one person building a whole car. Each worker does one job and hands the result along. Prompt chaining works the same way with an AI: rather than asking it to do everything in a single request, you ask a series of small questions and feed each answer into the next one. First find the relevant pages, then answer using only those pages, then simplify the wording. Each small job is easier to get right, and when something goes wrong you can see which stage caused it. The downside is that it takes longer, and a mistake made early travels all the way down the line.