Clear logo

A Beginner's Guide to Prompt Engineering

15 Apr 2025
Vinay Shashidhar
Director, ML. Building Clear.

A large part of our daily work involves us regularly interacting with AI. Whether it is someone writing code, creating documents, generating images or simply drafting emails, AI has become an integral part of our lives. And if recent trends are any indication, their influence is going to grow even more. It makes even more sense to step back and reflect on whether we are unlocking their full potential.

We all have faced instances when you ask for something simple, and get a confusing, generic, or just plain wrong answer. The good news is, it's often not the AI's fault – it's how we're asking. Welcome to the world of Prompt Engineering – the art and science of crafting instructions that help AI understand exactly what you want. Think of it like giving directions. Vague directions lead to getting lost. Clear, specific directions get you to your destination efficiently.

We will be referring to the concepts mentioned in the article here. For additional insights, explore the original source materials on this topic.

What is Prompt Engineering Anyway?

Think of AI like a smart prediction machine. It guesses the next word based on what you give it. A "prompt" is simply your instruction. Prompt engineering is the skill of writing good instructions to get the best possible results from the AI. At its core, it's about communicating clearly with AI systems. Well-crafted prompts can save time and produce more useful results.

What Actually Goes Into a Prompt?

A prompt can have several parts working together.

  • The Instruction/Task: What do you want the AI to do? (e.g., "Summarize," "Translate," "Write," "Explain," "Generate code"). This is the core action.
  • Input Data: The specific text, data, or topic the AI needs to work on (e.g., the article to summarize, the sentence to translate).
  • Output Indicator/Format: How do you want the answer presented? (e.g., "in bullet points," "in a friendly tone," "limit to 100 words").
  • Context Setting and Specificity: Giving the AI background helps it understand the 'why' and 'who' behind your request. For example: Instead of saying "Write an email about the project update," try giving more specifics: "Write a short, professional email to the marketing team summarizing the key results from the Q3 social media campaign project update. Mention the 15% increase in engagement."

You don't always need all parts, but combining them thoughtfully makes your prompts much more powerful.

Setting the Rules: Using Constraints Effectively

Constraints help focus the AI's response in specific directions, similar to how parameters narrow down search results

  • Length: "Summarize this in 50 words"
  • Format: "List the ideas as bullet points"
  • Tone/Style: "Explain this in a formal tone"
  • Negative Constraints: "Don't use technical jargon," "Avoid mentioning price"
  • Real-world example:
    • Less effective: "Suggest team-building ideas."
    • More effective: "Suggest 3 low-cost team-building activity ideas for a remote team of 10 software engineers. Focus on activities that encourage collaboration and take about 1 hour. Present them as a numbered list with a brief description for each. Avoid virtual escape rooms."

The Power of Iterative Refinement

Prompt engineering is often a process of trial, error, and refinement – think of it as a conversation rather than a one-time command:

  1. Start Simple: Write your initial prompt based on your goal.
  2. Analyze the Output: Did the AI understand? Was the result accurate? Was the format correct?
  3. Identify Gaps: What was missing or wrong? Was the prompt too vague? Did it lack context? Did you forget a constraint?
  4. Refine the Prompt: Adjust your prompt based on your analysis. Add specificity, context, constraints, or examples.
  5. Repeat: Try the new prompt and continue refining until you get the desired result.

Prompting Frameworks

For those of us who want to delve deeper into formal prompting techniques, here are several powerful approaches with practical examples:

  1. Basic Prompt (Zero-Shot) – This is the simplest approach with no examples:
    "Summarize this meeting transcript and list the action items"

  2. Adding Specificity and Constraints – Adding details about what you want:
    "Summarize the key decisions made in the following meeting transcript in 3-4 bullet points. Then, list all action items mentioned using the format: "- [Action Item]: [Owner] - Due: [Deadline]""

  3. Role Prompting – Asking the AI to adopt a specific perspective:
    "Act as an efficient Project Manager reviewing a meeting transcript. Your goal is to quickly understand outcomes and track tasks. First, summarize the key decisions made in the following meeting transcript in 3-4 concise bullet points. Second, rigorously extract all action items assigned. List them using the format: "- [Action Item]: [Owner] - Due: [Deadline]". If an owner or deadline isn't explicitly mentioned, use 'TBD'."

  4. Chain of Thought – Guiding the AI through a step-by-step reasoning process:
    "Act as an efficient Project Manager reviewing a meeting transcript. Your goal is to quickly understand outcomes and track tasks. Before generating the final summary and action list, follow these steps:

    1. Read through the transcript to identify the main topics discussed.
    2. Pinpoint the key decisions reached for each topic.
    3. Scan the transcript specifically for commitments or tasks assigned (action items). Note down the task, who is assigned (Owner), and any mentioned deadline.
    4. Consolidate the key decisions into a 3-4 bullet point summary.
    5. Format the extracted action items clearly using: "- [Action Item]: [Owner] - Due: [Deadline]" (Use 'TBD' if owner/deadline is unclear).

    Now, provide the final output based on this process."

  5. Reflections – Adding a layer of self-evaluation to the AI's process:
    "After extracting the action items using the CoT steps, re-read the summary of key decisions. Does each action item clearly map to a decision or discussion point? If not, double-check the transcript for that action item's context. Also, generate two versions of the action item list based on slightly different interpretations of the transcript, and present the most likely version based on the discussion flow."

Wrapping Up: The Art of Clear Communication

Prompt engineering is fundamentally about clear communication with AI systems. Specific instructions, relevant context, occasional examples, and format guidelines typically lead to better results.
Many users find an iterative approach works well: starting with simpler prompts and gradually refining them based on results.

Helpful Shortcut: Consider asking the AI itself to help craft effective prompts. For example, you might type "What would be a good prompt to generate a marketing email about our new product launch?" The AI can often suggest well-structured prompts tailored to your specific needs.