Module 3 Lesson 2: Foundational Prompting Techniques
Zero-shot, Few-shot, and Chain-of-Thought. The three pillars of professional AI interaction.
Leveling Up: Professional Techniques
Most people use "Zero-shot" prompting (just asking a question). But to get professional, stable results, you need to use Samples and Step-by-Step Logic.
1. Zero-shot Prompting
Just asking the AI to perform a task without any examples.
- "Translate this to French: 'Where is the library?'"
- Best for: Simple, factual asks.
2. Few-shot Prompting (The Power of Examples)
Giving the AI 2-3 examples of the style you want before asking your question.
- "Question: Happy $\rightarrow$ Answer: Positive
- Question: Sad $\rightarrow$ Answer: Negative
- Question: Excited $\rightarrow$ Answer:"
- Best for: Formatting, tone, and classification.
3. Chain-of-Thought (CoT)
Telling the AI to "Think step-by-step." This forces the model to write out its logic before giving the final answer.
- Why it works: By writing its logic, the model "reminds" itself of the context (Module 2) and is far less likely to hallucinate a wrong math answer.
Visualizing Chain-of-Thought
graph TD
Q[Complex Math Problem] --> A[Standard AI: WRONG ANSWER]
Q --> B[CoT Prompt: 'Think Step by Step']
B --> Logic1[Step 1: Calculate total...]
Logic1 --> Logic2[Step 2: Apply tax...]
Logic2 --> Logic3[Step 3: Subtract discount...]
Logic3 --> Final[Correct Answer]
💡 Guidance for Learners
If an AI gives you a wrong answer on a puzzle or math problem, don't just ask again. Type: "Think through this step-by-step and show your reasoning." It will get the answer right 80% of the time.
Summary
- Zero-shot is a direct request.
- Few-shot uses examples to define the "Vibe" or format.
- Chain-of-Thought is the #1 way to solve logic and math errors.
- Giving context (even just a few examples) is always better than no context.