AI Hints
Home›Generative AI Tutorial›The Art of Prompting
Generative AI · Lesson 23 of 77

Prompting Techniques

The methods professionals use.

⏱ 2 min read▶ Video at 55:31🎓 Free
Watch this lesson in the Generative AI courseWatch on YouTube ↗Full Generative AI course

Once you know the basic recipe, a few techniques can lift your results even higher. In this lesson, you will learn four of the most useful. Zero shot, few shot, chain of thought, and self checking.

Prompting Techniques
From the video: Prompting Techniques
  • Zero-shot and few-shot
  • Chain of thought
  • Self-checking

Zero-shot versus few-shot

Zero shot means you just ask, with no examples. Classify this review as positive or negative. This works well for simple tasks. Few shot means you show a few examples first. Here are three reviews, with their labels. Now classify this new one. The examples teach the exact format, and the exact style you want. Few shot is especially powerful, when the task is unusual, or the output must be consistent.

Zero-shot

  • Just ask, no examples
  • Works for simple tasks
  • Fast to write
  • Output format may vary

Few-shot

  • Show 2 to 5 examples first
  • Great for unusual tasks
  • Teaches the exact style
  • Output is consistent

Few-shot in action

Here is few shot in action. We show the model two examples. A sentence, and the emoji that matches. Then we give a new sentence. The model follows the pattern, and answers with a fitting emoji. We never explained the rule, we simply showed it. The model spotted the pattern, from the examples.

Few-shot prompt
YouI just got a promotion! → 🎉 It is raining all weekend. → 🌧️ I baked fresh bread today. →
AI🍞

Chain of thought

Some problems need steps. If you ask a model, a tricky word problem, it may jump to a wrong answer. But if you add, let's think step by step, it writes out its reasoning first, and the answer is much more often correct. Why? Because each written step becomes part of the context, so the model can build on its own reasoning, instead of guessing in one leap.

  1. Ask a hard questiona multi-step problem
  2. Add: think step by stepinvite the reasoning
  3. Model writes its stepseach step becomes context
  4. Better final answerfewer jumps to wrong answers
Let's think step by step
Chain of thought
From the video: Chain of thought

Self-checking and role switching

Two more tricks. First, ask the model to check itself. After it answers, say, review your answer for mistakes, and correct any you find. It often catches its own errors. Second, ask it to play a critic. Write the email, then act as a strict editor, and improve it. Having the model argue with itself, often gives a polished result.

Check your answerreview for mistakes, then fix
Act as a critica strict editor improves the draft
Ask for alternativesthree versions, then choose
Ask whythe model explains its choices

Summary

Excellent. Zero shot just asks. Few shot shows examples. Chain of thought asks for step by step reasoning. And self checking asks the model to review its own work. Next, we turn all this into reusable patterns, and learn to get answers in exactly the format you need.

Key takeaways
  • Few-shot: show examples
  • Chain of thought: think step by step
  • Ask the model to check itself
Next up: Prompt Patterns — templates and structured output