Zero-shot, Few-shot and Chain-of-Thought
Three core prompting techniques: ask directly, show examples, or ask the model to reason step-by-step before answering.
Three Foundational Techniques
Three prompting techniques every agent engineer must know:
- Zero-shot — ask directly, no examples
- Few-shot — show 1-5 examples of the desired behavior
- Chain-of-thought (CoT) — make the model reason step by step before answering
Zero-shot Example
Zero-shot is the default: just ask.
prompt = 'Translate to French: Hello, how are you?'
# Model output: 'Bonjour, comment allez-vous?'All lessons in this course
- Zero-shot, Few-shot and Chain-of-Thought
- System vs User vs Assistant Roles
- Output Formatting (JSON, XML, Markdown)
- Avoiding Prompt Injection in Inputs