Prompting Techniques
Structure Prompts with Delimiters and Sections
Separate instructions, context, examples, and inputs with clear sections or delimiters to reduce ambiguity in complex prompts.
In this lesson
Why this matters
In complex prompts, separate instructions, context, examples, and inputs with clear headings or delimiters. The goal is clarity, not XML or elaborate formatting for its own sake.
How to apply it
- Define the task and desired outcome.
- Add only context or rules that affect success.
- Specify an output form or checkable criterion when needed.
- Test on realistic input and revise when a failure pattern appears.
Practical example
Weak example:
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:
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.

