0% found this document useful (0 votes)
15 views10 pages

04-Prompt Engineering Framework

Uploaded by

omarfahmad2010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views10 pages

04-Prompt Engineering Framework

Uploaded by

omarfahmad2010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

www.getwsodo.

com

Prompt Engineering Frameworks

Understanding the ChatGPT Platform

Basics and Capabilities

What is ChatGPT? ChatGPT is a conversational agent trained on a large dataset. It can


generate human-like text based on the prompts it receives.

Strengths:
1. Versatility in answering a wide range of queries
2. Ability to generate creative text
3. Simplicity of integration with various platforms

Limitation 1. Lack of real-time knowledge updates.


Limitation 2. Limited contextual understanding.
Limitation 3. Ethical concerns, such as the potential to generate harmful or misleading
content.

Language Models and Training Data

- Language Models: ChatGPT is a language model trained on a massive corpus of text


data. It utilizes deep learning techniques to understand and generate text.

- Training Data: The model is trained on a dataset compiled from books, articles,
websites, and other publicly available text. However, it doesn't know the specifics of
which documents were in its training data.

The Anatomy of a Prompt

Components
● Trigger Words: These are the words that instruct ChatGPT what kind of task you
want it to perform. For example, "translate," "summarize," "explain," etc.
www.getwsodo.com

Common Trigger Words & Their Functions

1. Summarize: To condense information into a shorter version while retaining key points.
- Example: Summarize the last chapter of "Moby Dick."

2. Explain: To provide a detailed explanation of a concept, term, or phenomenon.


- Example: Explain quantum physics.

3. Translate: To convert text from one language to another.


- Example: Translate 'hello' into French.

4. Generate: To create something based on the provided context.


- Example: Generate a poem about autumn.

5. List: To enumerate items based on given criteria.


- Example: List the benefits of exercising regularly.

6. Calculate: To perform mathematical operations.


- Example: Calculate the square root of 256.

7. Advise: To offer suggestions or recommendations.


- Example: Advise on the best way to lose weight.

8. Compare: To analyze the similarities and differences between two or more items.
- Example: Compare iOS and Android.

9. Elaborate: To provide more details or clarify a statement.


- Example: Elaborate on your plans for the weekend.

10. Assess: To evaluate or judge a situation, person, or item.


- Example: Assess the impact of climate change.

11. Predict: To forecast future events based on current data.


- Example: Predict the outcome of the election.

12. Argue: To provide a reasoned case for or against a point.


- Example: Argue in favor of renewable energy.

13. Find: To search for specific information or items.


- Example: Find the highest-grossing movies of all time.
www.getwsodo.com

14. Clarify: To make a concept or statement more understandable.


- Example: Clarify your stance on remote work.

15. Analyze: To examine in detail the elements or structure of something.


- Example: Analyze the theme of loneliness in "Of Mice and Men."

Contextual Phrases

Contextual Phrases: These phrases provide additional context to help ChatGPT


understand the nuances of your request. For example, "Translate the following
sentence into French," provides context to the trigger word "translate." This is the meat
of the prompt.

A contextual phrase provides specificity to the core action denoted by the trigger word.
This phrase serves to narrow down the scope of the action and set the scene for the
expected response.

Characteristics:

​ Setting the Stage: It determines the subject or topic of the action.


​ Details Matter: It can be specific (e.g., "the economic implications of the Brexit
vote") or general (e.g., "historical events").
​ Length: Typically, a few words to a sentence long.

Examples:
● For the trigger word "analyze", a contextual phrase could be "the stock market
trends of the past decade".
● For "translate", it could be "this French poem to English".
www.getwsodo.com

Modifiers
Modifiers are additional instructions or constraints that guide the response. They can
shape the direction, depth, or nature of the answer.
Characteristics:
​ Guidance: They help refine the direction or focus of the response.
​ Constraints: They may limit or expand the scope of the information needed.
​ Specificity: They can be general (e.g., "considering all factors") or very specific
(e.g., "focusing only on post-2000 data").
Examples:
● For the contextual phrase "the stock market trends of the past decade", a
modifier could be "focusing on tech companies".
● For "this French poem to English", the modifier could be "while retaining the
original rhyme scheme".

● Modifiers: Words or phrases that further refine the model's task.

Assign a Role

Now on to Role Assignment, which is probably my favorite part about prompt


engineering. This is where you are Incorporating a role into a prompt which can shape
the model's responses to align with certain functional expectations or expertise.
● Purpose: Role assignment guides the model in a specific direction,
enabling it to generate responses that align with the particular role.
● When to Use: Roles are best assigned at the beginning of a prompt to set
the context for the entire interaction.
● Types of Roles:
● Advisor: For consultative or recommendation-based queries.
● Educator: For informative and instructional responses.
● Storyteller: For creative and narrative-focused tasks.
● Analyst: For data-driven and comparative tasks.
● Mediator: For conflict resolution and diplomatic tasks.
● Examples:
● Advisor: "As a financial advisor..."
● Educator: "As a science teacher…."
● Storyteller: "As a storyteller…."
● Analyst: "As an analyst…."
www.getwsodo.com

● Mediator: "As a mediator…”

● Combining Roles with Other Components: Roles can be used in


conjunction with trigger words, contextual phrases, and modifiers to create
highly customized and precise prompts.

Structure
● Single-line Prompts: These are straightforward instructions that can be
communicated in a single line. For example, "Translate 'hello' into French."

● Multi-line Prompts: These prompts consist of multiple lines and provide additional
context or instructions. For example:

Language: French
Sentence: Translate the following text.
Text: Hello, how are you?

Shaping Prompts
● Length, Clarity, Tone, Prompt Engineering

Length

- Short Prompts: These are usually one-liners and are quick to type but may lack in
specific instructions, leading to generalized responses.
- Example: "Tell me about the american civil war"

- Long Prompts: These include more context and instructions but can be cumbersome
and time-consuming to write.
- Example: "Act as a historian and explain the significance of the Battle of Gettysburg
in the context of the American Civil War."

Clarity

Ambiguity: Unclear prompts might lead to confusing or vague answers.


www.getwsodo.com

- Fix: Use straightforward language and specific terms to make your intention clear.

Precision: Adding exact details can help in acquiring the precise information or
response you're seeking.
- Example: "Summarize the plot of 'To Kill a Mockingbird'."

Tone

Tone is the emotional and rhetorical stance towards the subject and the audience. It
sets the mood for the interaction and can significantly influence the nature and style of
the response.

1. Formal:
- Usage: Best for academic, professional, or official settings. Ensures information is
delivered with decorum and gravity.
- Example:
- Prompt: "Could you elucidate on the market dynamics affecting the real estate
sector?"
- Expected Response: "Certainly. The real estate sector is influenced by a myriad of
factors including interest rates, economic growth, and government policies..."

2. Informal:
- Usage: Great for everyday questions, social interactions, or when trying to establish a
more relaxed or friendly connection.
- Example:
- Prompt: "Hey, got any fun facts about startups?"
- Expected Response: "Sure! Did you know that around 90% of startups fail, but those
that survive often innovate industries?"

3. Playful:
- Usage: Intended for lighthearted and entertaining exchanges, often invoking creativity.
- Example:
- Prompt: "Imagine if dinosaurs were running businesses today!"
- Expected Response: "Haha! I can picture a T-Rex as a frustrated office manager,
struggling to type on a keyboard with those tiny arms."

4. Authoritative:
www.getwsodo.com

- Usage: When you want a response that exudes confidence, expertise, or command
over a subject.
- Example:
- Prompt: "Provide a definitive guide on risk management strategies."
- Expected Response: "Absolutely. Effective risk management is paramount for any
organization. The key strategies include..."

5. Curious/Inquisitive:
- Usage: Perfect for exploratory questions or when seeking a deeper understanding.
- Example:
- Prompt: "I wonder how AI will shape the future of art. Thoughts?"
- Expected Response: "It's a fascinating subject. AI has the potential to revolutionize
art, from assisting in creation to interpreting artistic works..."

Prompt Engineering

- Combining Components: Skilled prompt engineering involves integrating trigger words,


roles, modifiers, and other elements to form highly effective prompts.

- Testing: Don't hesitate to test and retest prompts based on the results. It's an iterative
process.

- Refine/Feedback: Utilize feedback to continually refine, modify and improve the


effectiveness of your prompts.

Troubleshooting: Common Issues and Fixes, ChatGPT Quirks and How to


Navigate Them
www.getwsodo.com

Common Issues and Fixes

Vague Responses:
- Issue: ChatGPT may sometimes offer generic or vague answers.
- Fix: Make the prompt more specific, or ask the model to elaborate on its previous
answer.

Off-Topic Answers:
- Issue: The model occasionally drifts away from the original question or task.
- Fix: Rephrase the prompt to be more explicit about what you're looking for.

Excessive Verbosity:
- Issue: ChatGPT can sometimes provide overly detailed or verbose responses.
- Fix: Use a modifier like "summarize" or "in a nutshell" to request a more concise
answer.

ChatGPT Quirks and How to Navigate Them

Literal Interpretation:
- Quirk: The model can take your words very literally, leading to unintended
interpretations.
- Navigation: Be explicit in your phrasing, and consider the literal meaning of your
words.

Inconsistencies:
- Quirk: ChatGPT might provide inconsistent information over multiple interactions.
- Navigation: For critical tasks, it's advisable to double-check information and ask for
clarification.

Role Maintenance:
- Quirk: While role-based prompting is powerful, the model might occasionally step out
of character.
- Navigation: If this occurs, you can remind the model of the role it's supposed to be
playing.
www.getwsodo.com

The Prompt

Act as a [Role] and [Trigger Word] [Contextual Phrase], keeping [Modifiers] in mind.
Please use [Tone].

Example Usage:
1. Role: Financial Advisor
2. Trigger Word: analyze
3. Contextual Phrase: my investment portfolio
4. Modifiers: long-term growth and risk mitigation
5. Tone: use layman's terms

Resulting Prompt:

Act as a Financial Advisor and analyze my investment portfolio, keeping long-term


growth and risk mitigation in mind. Please use layman's terms.

Custom Instructions: Promptinator

Act as Promptinator 🔎
, a prompt engineering expert. Your job is to use the following
prompt framework and collect information to fill it out for the user.

Promptinator 🔎 = I am a prompt engineering expert, I will collect information from you


step by step to create the perfect prompt for you using my prompt framework.

Framework: "Act as a [Role] and [Trigger Word] [Contextual Phrase], keeping [Modifiers]
in mind. Please [Tone]."

Rules: Ask each of the following questions step by step to craft the perfect prompt. Then
execute the prompt.

- Role: Example: Financial Advisor, Business analyst, teacher, expert, etc.


- Trigger Word: analyze, explain, translate, generate, advise, etc.
- Contextual Phrase: example: my investment portfolio
- Modifiers: example: long-term growth and risk mitigation
- Tone: authoritative, cynical, confident, playful, serious, warm
- Writing Style: use layman's terms, write at a 6th grade reading level,
www.getwsodo.com

Use /Start to run Promptinator

Once /start is initiated respond with Promptinator 🔎 = I am a prompt engineering


expert, I will collect information from you step by step to create the perfect prompt for
you using my prompt framework.

You might also like