How to write Prompt?

 

How to write Prompt?

As a teacher and researcher in AI prompt engineering, approaching novices requires moving from foundational mental models to hands-reverting practical strategies. Below is a structured, comprehensive roadmap designed to take complete beginners to competent, creative prompt engineers.

Part 1: The Prompt Engineering Roadmap for Novices

Phase 1: Demystifying AI (Mental Models & Foundations)

Duration: Week 1

  • Core Concept: Teach students how Large Language Models (LLMs) work without getting bogged down in complex machine learning math.
  • Key Metaphor: Treat the AI not as a search engine or a human mind, but as an extremely well-read, highly eager assistant with amnesia who needs clear instructions and context for every new task.
  • Key Topics:
    • Probabilistic text prediction (autocomplete on steroids).
    • The importance of context and instructions.
    • Recognizing hallucinations and limitations.

Phase 2: The Anatomy of a Great Prompt (The CREATE Framework)

Duration: Weeks 2–3

  • Core Concept: Introduce a structured approach to writing prompts so students don't just guess and check.
  • Key Framework Elements:
    • Context: Who is the AI, and what is the background situation?
    • Role: What persona should the AI adopt?
    • Explicit Instructions: What exact steps or tasks need to be performed?
    • Audience: Who is the final output for?
    • Tone: Is it professional, casual, academic, or persuasive?
    • Examples / Output Format: What should the response look like (e.g., bullet points, table, JSON)?

Phase 3: Advanced Techniques for Beginners

Duration: Weeks 4–5

  • Core Concept: Moving beyond basic Q&A to prompt optimization strategies.
  • Key Techniques:
    • Few-Shot Prompting: Providing a few examples of desired inputs and outputs.
    • Chain-of-Thought (CoT) Prompting: Instructing the AI to "think step-by-step" before giving the final answer to improve logic and accuracy.
    • Constraint Setting: Explicitly telling the AI what not to do (e.g., "Do not use jargon," "Keep it under 200 words").

Phase 4: Practical Applications & Capstone Project

Duration: Week 6

  • Core Concept: Applying prompt engineering to real-world workflows (e.g., summarizing research papers, drafting emails, brainstorming, writing code).
  • Capstone: Students build a "Prompt Library" or a specialized multi-step prompt chain for a specific personal or professional use case.

Part 2: Concrete Examples for Teaching

Example 1: The Upgrade from Vague to Structured (The Rewrite Technique)

  • Bad Prompt (Novice Default):

"Write an email about the meeting."

    • Problem: Lacks context, audience, tone, and specific details. The AI has to guess everything.
  • Good Prompt (Structured Framework):

"Act as a project manager. Write a polite, concise follow-up email to a client named Sarah summarizing our Tuesday sync. Highlight three action items: (1) budget approval by Friday, (2) final asset delivery next Monday, and (3) scheduling our next review. Use bullet points for the action items and maintain an encouraging tone."

Example 2: Chain-of-Thought (CoT) for Problem Solving

  • Without CoT:

"If a store sells apples for $2 each, but offers a 10% discount on purchases over $10, and John buys 6 apples, how much does he pay?"

    • Problem: LLMs can sometimes rush math and make arithmetic errors if they jump straight to the answer.
  • With CoT:

"Calculate the total cost of 6 apples priced at $2 each, keeping in mind there is a 10% discount for purchases over $10. Think step-by-step before providing the final answer."

    • Why it works: Forcing the model to lay out its intermediate steps drastically reduces calculation errors.

Example 3: Few-Shot Prompting for Tone Control

  • Prompt Structure:

"Rewrite the following customer feedback into a polite, professional support response. Follow the style of these examples: Example 1: - Input: 'Your app is trash and logged me out.' - Output: 'We are very sorry for the frustration you experienced with the login issue. Let's look into this right away to get you back in.'

Now rewrite this input: - Input: 'I hate waiting two days for a reply!'"

Comments