Skip to content

Current path

Prompt Engineering
Level: Intermediate33 lessons
Progress0/33 · 0%

Prompting Techniques

Use Examples Effectively

Choose relevant, diverse examples that demonstrate the desired pattern rather than adding examples without purpose.

In this lesson

Why this matters

An example is a behavioral signal, so it should be correct, relevant, and representative. Overly similar examples can teach a narrow pattern that does not generalize.

How to apply it

  1. Define the task and desired outcome.
  2. Add only context or rules that affect success.
  3. Specify an output form or checkable criterion when needed.
  4. Test on realistic input and revise when a failure pattern appears.

Practical example

Weak example:

text
Weak version of the same task: «ممتاز»→إيجابي، «رائع»→إيجابي، «جميل»→إيجابي.

The weak version leaves an important part of the task or its boundaries to guesswork. The improved version adds information tied directly to success without treating length or complexity as a goal.

Improved example:

text
Improved version: «الخدمة ممتازة»→إيجابي، «تأخر التوصيل»→سلبي، «المنتج عادي»→محايد.

Short practice

Apply the lesson concept to this task: أضف حالة حدّية إلى مجموعة أمثلة لديك.

Check your understanding

Check: لماذا ننوّع الأمثلة؟
Answer: لتغطية حالات مختلفة وتقليل تعلم نمط ضيق غير مقصود.

Summary

Keep this concept as one tool rather than a magic formula. Tie it to the goal and success criteria, then build on it in the next lesson.