What is prompt chaining and why prefer it over one big prompt?
mediumAnswer
- Split a complex task into a chain of smaller LLM calls, where each call handles one sub-task and passes structured output to the next.
- Advantages: (1) easier to debug — inspect each intermediate output; (2) better latency for early user feedback; (3) can inject different tools / retrieval per step; (4) enables branching / retries per step; (5) each sub-prompt is simpler → less error compounding.
- Cost: more API calls, more moving parts.
- Building block for agents.
Check yourself — multiple choice
- One big prompt always
- Chain multiple LLM calls, each with structured I/O → easier debug, targeted tools, retries, streaming user feedback
- Same as CoT
- Never used
Prompt chaining: split task into targeted LLM calls with structured hand-offs.
#prompting#agents
Practise LLMs & GenAI
214 interview questions in this topic.
Related questions
- How does function calling / tool use work in modern LLMs?
- How should you write tool descriptions for reliable agent tool selection?
- Do agents plan explicitly or should we let them just react?
- What are the pillars of good prompt engineering?
- What is in-context learning (ICL) and how does it work?
- Few-shot vs zero-shot — when do you use each?