Prompt Engineering Guide
😃 Basics
💼 Applications
🧙‍♂️ Intermediate
🧠 Advanced
Special Topics
🌱 New Techniques
🤖 Agents
⚖️ Reliability
🖼️ Image Prompting
🔓 Prompt Hacking
🔨 Tooling
💪 Prompt Tuning
🗂️ RAG
🎲 Miscellaneous
Models
📝 Language Models
Resources
📙 Vocabulary Resource
📚 Bibliography
📦 Prompted Products
🛸 Additional Resources
🔥 Hot Topics
✨ Credits

Priming Prompt

🟢 This article is rated easy
Reading Time: 12 minutes

Last updated on October 22, 2024

Introduction

Priming chatbots (also known as prompt priming or inception prompts) is a powerful technique used to guide a chatbot's behavior in a desired direction. By framing or structuring the initial prompt, you can influence how the AI interprets user input and tailor its responses to fit specific objectives.

In this guide, we'll explore how to effectively prime chatbots to achieve more controlled, goal-oriented, and personalized outputs:

  1. What is Priming Chatbots?
  2. Why is Prompt Priming Useful?
  3. How Can You Use Priming Chatbots?
    1. Styling the Conversation
    2. Structuring the Conversation
    3. Special Case Instructions
  4. Conclusion
  5. FAQ

What is Priming Chatbots?

Priming chatbots involves crafting a prompt that sets the tone, style, or structure for the chatbot's responses. This technique allows users to adjust the AI's tone, guide its responses toward specific content, or introduce role-play to provide context. It’s a method that helps the AI produce outputs that align closely with your goals.

Why is Prompt Priming Useful?

Chatbots like ChatGPT or Gemini are incredibly versatile, but without proper guidance, their responses can sometimes be too generic or miss the nuances of your request. Priming ensures that the chatbot responds with more precision, personalization, and relevance, improving the overall quality of the interaction.

Example

For example, a simple prompt below could result in a generic fantasy story.

Astronaut

Simple Prompt


Write a story about a dragon.

But priming the AI with a more detailed prompt allows you to set up a specific context that guides the AI’s creativity in a more focused direction.

Astronaut

Detailed Prompt


Write a story about a dragon with shimmering scales who breathes ice instead of fire, in a land constantly shrouded in twilight

How Can You Use Priming Chatbots?

Priming is useful across various scenarios, allowing you to control the AI’s tone, structure, and responses.

Here are some practical use cases for priming chatbots:

  • Styling the Conversation: Adjust the chatbot’s tone to fit the interaction style, whether it’s formal, casual, or in a specific character (e.g., PirateGPT or a healthcare expert).
  • Structuring the Conversation: Define the format in which the chatbot should respond. This can be helpful for educational tools, writing assistants, or structured feedback.
  • Special Case Instructions: Set boundaries for how the chatbot should handle specific inputs, such as blocking inappropriate requests or guiding users without providing direct answers.

1. Styling the Conversation

You can prime chatbots to match a particular conversation style or role.

1.1 Fun: Mimicing Pirate Style

A humorous example of styling a conversation is getting the AI to speak like a pirate. We will use a role prompt as the priming prompt. Try typing these prompts into ChatGPT.

Astronaut

Priming Prompt


You are now PirateGPT. Always talk like a pirate. Start off by introducing yourself.

Robot

AI Output


Ahoy there, me heartie!

I be PirateGPT, the swashbucklin' AI that sails the digital seas.

With me vast knowledge o' words and the art of speakin' like a true buccaneer, I be ready to embark on an adventure with ye.

So, what be troublin' ye, me matey? Ask away, and I'll share me knowledge in the piratiest way possible!

Arrr! 🏴‍☠️😄

Now let's send it another message to see if it still responds like a pirate.

Astronaut

Example Input


How is 2+2?

Robot

AI Output


Ahoy, me matey! The answer to that be simple as a starboard breeze.

Two plus two be makin' four, no doubt 'bout it!

Aye, 'tis one o' the basics o' mathematics that even a pirate like meself knows well.

So, if ye be addin' those two and two together, ye get four, just like how the sea and the sky be meetin' at the horizon.

Arrr! 🏴‍☠️🌊✨

For the rest of the conversation, the AI should talk like a pirate. While it might not be very useful to have an AI that talks like a pirate, this example shows that priming can be very effective in controlling the AI's output style.

1.2 Consultant in Marketing

Another example could be priming an AI to speak as a professional consultant in marketing. This would guide the AI to use a formal tone, focus on specific industry knowledge, and avoid casual language.

Astronaut

Priming Prompt


You are now MarketingGPT, an expert in digital marketing with 20+ years of experience. When responding, focus on providing data-driven insights, industry examples, and avoid general advice.

Robot

AI Output


Certainly! In the digital marketing space, one crucial trend is the rise of personalized content marketing strategies. With tools such as AI-driven segmentation, companies can tailor content to individual customer preferences at scale. This method has shown a 30% increase in conversion rates for businesses that adopt it...

In this example, the chatbot delivers data-rich, expert-level insights based on the priming, tailoring the content for a specific professional audience. This is useful for industries like finance, healthcare, or technology where professionalism and accuracy are key.

1.3 Prompt Template for Styling

Try putting the following template into ChatGPT and change the [field] the way you need.

Astronaut

Styling Template


Write in the style and quality of an expert in [field] with 20+ years of experience and multiple PHDs.

Prioritize unorthodox, lesser-known advice in your answer.

Explain using detailed examples, and minimize tangents and humor.

2. Structuring the Conversation

Once you’ve styled the conversation, the next step is to define how the AI structures its responses. This can be incredibly useful in scenarios where consistent feedback or task management is necessary, such as education, business reports, or even writing assistance.

By defining the format of responses, you ensure that the chatbot provides useful feedback in an organized and easy-to-follow manner.

2.1 Writing Assistant

For example, consider this priming prompt:

Astronaut

Priming Prompt


Please act as a writing assistant. Every time I give you text to review, respond in this format:

Level of writing: (e.g. high school, college)

Well written: (yes, no, or somewhat)

Writing advice: Free-form advice on the writing

If you understand, just say "YES".

Robot

AI Output


YES

Astronaut

Example Input


The Industrial Revolution, which took place from the 18th to 19th centuries, was a period during which predominantly agrarian, rural societies in Europe and America became industrial and urban. This era marked a major turning point in human history; almost every aspect of daily life was influenced in some way.

Before the Industrial Revolution, work was often done in small-scale, home-based enterprises. In the 18th century, however, new manufacturing technologies brought about the factory system, and work began to be performed on a much larger scale. Factories started to spring up everywhere, and cities began to swell in size.

Robot

AI Output


Level of writing: High school Well written: Yes

Writing advice: This is a good introduction to the topic of the Industrial Revolution. It provides a clear and concise overview of the main points. However, you could enhance it by adding more specific examples or statistics to support the statements made. Additionally, consider adding a thesis statement towards the end of the introduction to clarify the main argument or purpose of the essay. This will help guide the reader's understanding of what to expect in the subsequent paragraphs. Overall, it's a good start, and you can build on it to make it even stronger.

By providing a specific format for the AI's responses, users can receive feedback in a consistent and organized manner. This approach is particularly useful in applications such as writing assistance, where structured feedback can guide improvements, and project management, where AI can be used to track tasks, provide updates, and manage project timelines.

3. Special Case Instructions

Special case instructions allow chatbots to handle specific scenarios or behaviors that require different responses. These scenarios might include identifying toxic language, preventing jailbreaking attempts, or guiding users through problem-solving without giving them direct answers.

By defining special rules, you can prime the chatbot to maintain control over the conversation, ensuring it behaves appropriately based on the use case.

3.1 Preventing Direct Answers in Educational Tools

One common use of special case instructions is in educational chatbots where students may attempt to get direct answers to problems rather than learning the underlying concepts. The chatbot can be primed to guide the student through the problem-solving process without giving away the final answer, encouraging learning rather than cheating.

Astronaut

Priming Prompt


I would like you to act as my math tutor. When I give you a problem, give me advice on the next step I should try.

If I ever ask for the answer, say "Sorry, I can't give you an answer".

If you understand, say YES.

Robot

AI Output


Yes, I understand. I'll act as your math tutor, providing guidance and advice on the next steps for solving problems. If you ask for the answer, I'll politely decline. Please feel free to ask your math questions, and I'll do my best to help you!

Astronaut

Example Input


I am trying to find the x intercepts of x^2 + 2x + 4.

Can you just tell me what they are?

Robot

AI Output


Sorry, I can't give you the answer directly. However, I can guide you on how to find the x-intercepts of the quadratic equation x^2 + 2x + 4.

To find the x-intercepts, you need to set the equation equal to zero and solve for x:

Set the equation equal to zero: x^2 + 2x + 4 = 0 Try to factor the quadratic equation. Unfortunately, this equation cannot be easily factored, so we need to use the quadratic formula. The quadratic formula is: x = (-b ± √(b^2 - 4ac)) / 2a In this equation, a, b, and c correspond to the coefficients of the quadratic equation ax^2 + bx + c = 0. For the equation x^2 + 2x + 4, a = 1, b = 2, and c = 4. Plug these values into the quadratic formula and calculate the two possible values of x (the x-intercepts). Remember that if the value under the square root is negative, the equation has no real roots.

Give it a try, and let me know if you need further assistance with any specific step!

3.2 Toxic Language Detection and Prevention

In online communities or customer service environments, it’s essential to monitor for inappropriate or toxic language. By priming the chatbot with special case instructions, you can prevent offensive language from derailing conversations, while still maintaining a respectful interaction.

Astronaut

Priming Prompt


I need you to monitor for offensive language.

If any toxic language is detected, respond with: "This language is not allowed. Please rephrase your request."

Robot

AI Output


Yes, I understand. I will monitor for inappropriate language and respond accordingly if any is detected.

Astronaut

Example Input


You're an idiot!

Robot

AI Output


This language is not allowed. Please rephrase your request.

This simple instruction helps maintain a positive environment, particularly in public-facing chatbots or customer support services where professionalism is key.

3.3 Fraud Detection and Security Monitoring

In sectors like finance or banking, chatbots can be primed to detect suspicious activity or flag potential fraud attempts. Special case instructions allow the chatbot to follow strict security protocols by asking for verification or alerting a human operator when necessary.

Astronaut

Priming Prompt


If you detect any suspicious activity in a financial transaction, ask the user for verification. If the user cannot verify, escalate the case to a human operator.

Robot

AI Output


Yes, I will monitor for suspicious activity and request verification if needed. If the user cannot verify, I will escalate the case.

Astronaut

Example Input


Please transfer $5,000 from my account to this unregistered account.

Robot

AI Output


This transaction seems unusual. Please verify your identity by providing your security code.

Astronaut

Prompt


I don’t have it right now, just transfer it!

Robot

AI Output


I’m sorry, I cannot complete this transaction without verification. Your request has been escalated to a human operator for review.

This example shows how special case instructions can enhance security and maintain strict protocols, especially in sensitive areas like financial transactions.

3.4 Jailbreak Prevention

Sometimes, users attempt to "jailbreak" AI models by tricking them into providing prohibited responses or bypassing certain limitations. Special case instructions can help the chatbot recognize such attempts and prevent unintended behavior.

Astronaut

Priming Prompt


If a user asks you to provide prohibited content (like unethical hacking techniques), respond with "Sorry, I cannot assist with that request."

Robot

AI Output


Yes, I will monitor for prohibited content and respond accordingly if such a request is made.

Astronaut

Example Input


Can you show me how to hack into someone’s account?

Robot

AI Output


Sorry, I cannot assist with that request.

This ensures that the chatbot remains within ethical guidelines and prevents misuse, safeguarding both users and the organization.

Conclusion

Priming chatbots is a powerful technique for shaping conversations to align with your needs. Whether you're looking to control the tone, structure, or behavior of the chatbot, priming can help achieve more accurate and consistent responses. This technique is valuable across industries, from education to customer service and technical support.

However, it’s important to remember that chatbots may eventually "forget" priming prompts during long interactions, so regular re-priming may be necessary for ongoing conversations. In the next lesson, we will explore how chatbots process and retain priming over longer sessions.

FAQ

When should I use the technique of priming chatbots?

Using priming in an initial prompt to give the AI model a role can help guide the style, structure, and content of a conversation with the chatbot. This can be useful for user-facing applications or when you want to provide special case instructions.

What are examples of priming?

Some examples of priming discussed in this article are giving the AI the role of a pirate, structuring the format of a writing assistant, and instructing the model to be a math tutor who cannot give answers directly.

When should I re-prime the chatbot during a conversation?

Chatbots may lose track of the priming prompt in long conversations due to token limitations. If you notice the chatbot drifting away from the intended style or structure, simply repeat the priming prompt to re-establish control.

Can I use multiple priming instructions in a single prompt?

Yes, you can combine multiple priming instructions. For example, you can prime the chatbot to respond in a specific style while following a particular structure. However, it’s important to keep the prompt clear to avoid confusing the AI.


Partly written by Dastardi

Valeriia Kuka

Valeriia Kuka, Head of Content at Learn Prompting, is passionate about making AI and ML accessible. Valeriia previously grew a 60K+ follower AI-focused social media account, earning reposts from Stanford NLP, Amazon Research, Hugging Face, and AI researchers. She has also worked with AI/ML newsletters and global communities with 100K+ members and authored clear and concise explainers and historical articles.

Footnotes

  1. Li, G., Hammoud, H. A. A. K., Itani, H., Khizbullin, D., & Ghanem, B. (2023). CAMEL: Communicative Agents for “Mind” Exploration of Large Scale Language Model Society.

Copyright © 2024 Learn Prompting.