intermediateSpring AI — Tool Calling, Agents & Production
What is the difference between zero-shot, few-shot, and chain-of-thought prompting?
Zero-shot gives just the task, no examples. Few-shot includes 2-5 example input/output pairs to demonstrate the expected format. Chain-of-thought instructs the model to 'think step by step,' dramatically improving reasoning on complex tasks — in Spring AI, few-shot examples go in the system message, CoT is triggered in the user message or system instructions.
This is a Pro question
Sign in, then upgrade to Pro or Power to unlock this question and the full Interview Prep bank.
What is the difference between zero-shot, few-shot, and chain-of-thought prompting?