Skip to main content
How to write effective AI prompts

Master AI communication! Learn to craft effective AI prompts with these 4 essential components and explore real-world examples.

Updated over 3 months ago

First, we'll delve into the fundamental structure of a prompt, laying the groundwork for effective AI communication. Then, we'll detail each structure element so you understand how every part contributes to the final output. Finally, we'll conclude the section with real-world examples, demonstrating how to apply these concepts in practice.

Understanding the Basics of Prompt Structure

Every effective prompt involves four main components: Persona, Task, Context, and Format. Let’s take a closer look at what each of these elements means:

Persona: Defines the role or characteristics of the AI to match the response style.

Task: Specifies the action or objective the AI needs to accomplish.

Context: Provides background information or details relevant to the task.

Format: Describes the desired structure or presentation of the AI's output.

While the Task section is the only required part of a prompt, including the Persona, Context, and Format is essential for achieving more accurate and refined results. Providing more detailed data and clear explanations to the AI leads to significantly better outcomes, making your prompts far more effective.

Breaking down Task, Persona, Context, and Format

Now, let’s examine each component more closely to gain a deeper understanding of its role in crafting an effective prompt.

Persona

  • Definition: Persona refers to the identity or role you assume when responding to the prompt or performing the task. It influences the tone, style, and viewpoint of the response.

  • Purpose: It tailors the response to fit the persona’s needs, making the interaction more appropriate and effective.

  • Example: If the persona is a "helpful customer service agent," the response will be courteous, empathetic, and focused on solving the issue.

Task

  • Definition: The task is the specific action or set of actions you are asked to complete in response to the prompt. It’s the core instruction.

  • Purpose: Defining the task ensures the targeted response and fulfills the desired objective.

  • Example: The task could be "summarize a document," "draft an email," or "recommend a product."

Context

  • Definition: Context provides background information or the task's situation. It can include the purpose, audience, or any particular limitations.

  • Purpose: Context ensures that the response is suitable for the situation and aligned with the intended goals. It helps prevent misunderstandings by setting clear expectations.

  • Example: The context could be "replying to a customer's complaint about a delayed delivery" or "writing a memo to a busy executive."

Format

  • Definition: Format refers to the structure, style, or medium in which the response should be delivered. This might include instructions about length, tone, or the arrangement of content.

  • Purpose: Defining the format ensures that the response meets the required guidelines and is presented in a way that’s easy to understand or use.

  • Example: The format might be "a three-paragraph email," "a bulleted list," or "a formal report."

Now that we’ve covered the prompt structure let's analyze a well-crafted prompt to gain a clearer understanding of how these components work together for better results:

I’m the COO of a mid-sized company.

I am hosting a quarterly town hall meeting with the entire company. There has been a lot of positive progress and momentum this quarter, but I am worried that multiple teams

have low morale due to unforeseen setbacks. I want to brainstorm and practice responding to potentially tough questions.

Help me write challenging questions that employees may ask at the upcoming town hall about our earnings, leadership changes, and company vision. Generate potential answers for each question

that use a confident but firm tone in bullet point style, headlines, and bold format.

Persona

  • Exact part from the prompt: "I’m the COO of a mid-sized company."

  • Why it matters: As the COO, your responses must reflect your leadership role, showing authority, confidence, and understanding of the company's direction.

Task

  • The exact part from the prompt: "Help me write challenging questions that employees may ask at the upcoming town hall about our earnings, leadership changes, and company vision. Generate potential answers for each question."

  • Why it matters: The task is to prepare challenging questions and confident responses, which will help you prepare for difficult discussions during the town hall meeting.

Context

  • The exact part from the prompt: "I am hosting a quarterly town hall meeting with the entire company. There has been a lot of positive progress and momentum this quarter, but I am worried that multiple teams have low morale due to unforeseen setbacks. I want to brainstorm and practice how I will respond to potentially tough questions."

  • Why it matters: The context highlights the company's positive progress but also the low morale among teams due to setbacks, which is why tough questions may arise.

Format

  • The exact part from the prompt: "that use a confident but firm tone in a bullet point style use headlines and bold format."

  • Why it matters: The format calls for structured questions and answers with a confident and firm tone to address concerns while maintaining conversation control.

Now that we understand what a proper prompt structure looks like and how to create one, practice is the key to mastering this skill. First, we'll focus on transforming a poorly written prompt into a great one with just a few minor adjustments. Then, we'll challenge ourselves to write a prompt from scratch.

How to improve bad AI prompts

Improving a weak prompt into a strong one can be achieved step by step using the Persona, Task, Context, Format framework. Here’s how to do it effectively:

Step 1: Clarify the Persona

  • What to check: Is the role or identity of the person clear? Does the persona match the intended tone and style of the response?

  • How to improve: Specify who the user is supposed to be. A good prompt will state the persona directly to guide the tone and perspective.

  • Example: If the original prompt is vague, like "Answer this question," improve it by adding the persona: "As a customer support representative, answer this question."

Step 2: Define the Task

  • What to check: Is the prompt's action or goal clearly stated? Does it tell the user what they need to do?

  • How to improve: Make sure the task is specific and actionable. If necessary, break down complex tasks into manageable steps.

  • Example: Instead of "Write about this topic," specify "Write a 300-word summary of this article focusing on the main points."

Step 3: Provide Context

  • What to check: Does the prompt provide enough background information or details about the situation? Does it explain why the task is being performed?

  • How to improve: Add relevant details that help the user understand the situation. This could include the audience, purpose, or any specific challenges.

  • Example: Rather than just saying, "Write an email," improve it with context: "Write an email to a client explaining a delayed shipment and how the issue will be resolved."

Step 4: Specify the Format

  • What to check: Does the prompt outline how the response should be structured or formatted? Does it provide guidance on tone, length, or style?

  • How to improve: Give clear instructions on how the response should look. Include guidelines for length, tone, or specific formats like bullet points or paragraphs.

  • Example: If the original prompt says, "Respond to this feedback," improve it by saying, "Respond to this feedback in a three-paragraph email using a polite and professional tone."

Putting It All Together:

Let's make this clearer by walking through a straightforward example. This will help demonstrate the concept practically.

Bad Prompt Example: "Write a summary."

Step-by-Step Improvement:

  1. Persona:

    • Clarify who is writing the summary.

    • Improvement: "As a marketing analyst, write a summary..."

  2. Task:

    • Specify what the summary should focus on.

    • Improvement: "...summarize the key findings from the latest sales report..."

  3. Context:

    • Add relevant background information.

    • Improvement: "...for the executive team, who will use it to make decisions on next quarter’s strategy."

  4. Format:

    • Provide clear instructions on how the summary should be structured.

    • Improvement: "...Write the summary in three bullet points, keeping it concise and data-focused."

Final Prompt:

"As a marketing analyst, write a summary of the key findings from the latest sales report for the executive team. They will use this information to plan next quarter’s strategy. Write the summary in three bullet points, focusing on data-driven insights."

Examples of Effective Prompts

Let's conclude this section with three well-structured prompts to guide further discussion and exploration.

Example 1

Persona: You are a project manager for a software development team.

Task: Write an update email to the stakeholders summarizing the project's current status, highlighting any delays or challenges, and outlining the next steps.

Context: The project has faced a few setbacks due to unforeseen technical issues, but the team is working on a solution. Stakeholders are concerned about the timeline and budget.

Format: Write the email in three short paragraphs, using a professional tone. Include a brief summary of the challenges, the current status, and the next steps to resolve the issues.


Example 2

Persona: You are a teacher creating a study guide for high school students.

Task: Write a study guide summarizing the key points of the upcoming history exam, focusing on the main events and figures of the 20th century.

Context: The students have struggled with the complexity of some historical events, so the guide should simplify these topics while still covering the important details.

Format: Organize the study guide into bullet points under three main headings: Key Events, Important Figures, and Significant Outcomes. Keep each bullet point concise and easy to understand.


Example 3

Persona: You are a content writer for an online magazine.

Task: Write an article reviewing the top three coffee shops in your city, focusing on the quality of coffee, atmosphere, and customer service.

Context: The audience consists of coffee enthusiasts who appreciate detailed reviews with honest opinions.

Format: Write the article in five paragraphs: one introductory paragraph, followed by one paragraph for each coffee shop, and a concluding paragraph. Use a friendly and engaging tone, and include specific examples to support your opinions.

Did this answer your question?