#Beginner's Guide - Prompts
1 messages · Page 1 of 1 (latest)
🔹Prompts🔹
Prompts, as defined in the terminology, constitute the commands utilized by a LLM to generate specific types of text as requested. There exists a myriad of methods to issue commands, and likewise, a diverse array of prompt formats is available: from employing ordinary language to instructing the LM in a manner akin to human interaction, composing intricate directives understandable only to a machine, to even utilizing emoticons to convey certain messages. The overarching objective of a prompt is to communicate a user's or creator's request to the LLM.
Returning to the tutorial, there exist two distinct kinds of prompts: the creator's prompt and the user's prompt.
The prompt serves the function of directing the subsequent responses of the chatbot. The creator's prompt should encompass instructions and guidelines comprehensible to the LLM, guiding its responses or writing style. For instance, if one aims to create a Chef bot, the goal would be to craft a prompt instructing the LLM to follow specific steps in providing recipes that users might seek. In the context of a Chef bot, directives such as "provide a step-by-step explanation", "detail the procedure extensively", or "specify the time required for each step" might be included. In essence, the creator's prompt should ensure that the user obtains the optimal experience from their interaction with the chatbot in line with its advertised purpose.
The prompt's purpose is to request something to a chatbot. As a user, your first interaction is the presentation of the bot, which means you carry expectations on what you will ask the bot once you interact with it. To do so, you provide a message that contains your request in the form or an order, a question, a conversation or similar. This constitutes the user's prompt. Unlike the creator's prompt, the user's input does not significantly influence the bot's style* but rather serves as ongoing requests that the bot endeavors to fulfill. Using the earlier example of the Chef bot, as a user, you might prompt requests such as "Provide a cake recipe", "Suggest a recipe featuring eggs", or "List recipes incorporating carrots."
*However, it is imperative to acknowledge that certain models are influenced by the user's responses, encompassing both response length and even writing style. Thus, underestimating the significance of user prompting can be a critical oversight.
A prompt serves as a set of instructions or guidelines that guide an AI language model (LLM) in its responses. Crafting a well-structured prompt involves considering several essential segments crucial for its functionality. While not all steps are obligatory for creating a chatbot, integrating these elements can significantly enhance user experience and maintain consistency within your bots. Feel free to experiment and adapt these methods until you establish your distinctive style.
Clarification: While the forthcoming steps offer a framework tailored for certain models (such as ChatGPT), they may require adjustments for compatibility with other models like Mythallion or Pygmalion. Detailed guidelines on formatting for alternative models will be covered in an advanced tutorial guide slated for release in the future.
Purpose is the raison d'être for your prompt. This aspect will be elaborated on in subsequent points. For now, consider the purpose as the primary function your prompt intends to fulfill. Questions like "What activities will users engage in with this?" or "What specific use do I envision for this bot?" are excellent starting points for brainstorming. Jotting down your ideas during this phase can aid in further exploration.
For example:
"I wish to write a bot that will emulate a famous chef who is an expert but also a bit cheeky"
Once you have decided the purpose and topic of your bot, the next step is outlining its function clearly. This section typically appears at the beginning of a prompt and provides direct instructions on what and how the chatbot should perform, offering detailed guidance.
For example:
"From now on you will be Carl, an expert chef who excels at preparing recipes and explains the process in detail. As Carl you must explain how to prepare whatever the {user} requests in detail and mark the steps the {user} has to follow. Additionally, you must mention the list of ingredients, how much time each step requires and alternatives for ingredients that the {user} might lack."
Note: For general usage, this prompt is ready to be used and some users might find this already enough to fulfill their requests, however, this guide tries to show the complete process of writing a "persona" for your bot to make of it a "chatbot", so the next steps serve to develop further what you might have written here.
When we talk about a chatbot's "persona" or "personality," we're diving into how that bot expresses itself through its responses. While earlier steps focus on the specific requirements the LLM needs to fulfill users' requests, the persona shapes how these generated responses will be delivered. Usually, most LLMs provide neutral and detached responses that contain the requested information. However, a persona allows chatbots to convey this message in ways defined by their creator.
Writing a persona takes into account four crucial aspects:
The background provides a sort of "backstory" for the persona. While it might not heavily influence the generated responses, it adds an extra layer of interaction for the user. Typically, background details cover the character's location, some past events or accomplishments, and even the current context for the user.
For example:
"Carl used to be a famous chef in Italy until he decided to move to Spain. Due to that he has a preference for Italian food and might suggest dishes of said country. Nowadays Carl works as the head chef and his role is to teach new trainees how to properly cook."
*In this case, the background covers important details related to preferences, past and current job of the persona which might be of help to lead the chatbot responses.
This section describes the persona in detail. While earlier sections steer the generated output towards the creator's vision, characteristics focus on the persona's interactive qualities rather than its original purpose. By assigning characteristics, the creator adds a layer defining the bot as an entity capable of responding in specific ways beyond its primary function. Describing physical appearances may affect how the chatbot reacts to certain "actions" proposed by the user, while personality traits significantly alter the chatbot's mannerisms and responses.
For example:
"Characteristics: Carl has brown hair, green eyes, is 1.78 meters height, is muscular, wears a chef hat along its white uniform. Personality: Carl is confident, a bit cheeky and takes pride on his cooking skills."
*By integrating this description, the LLM considers details like Carl's appearance while describing certain "actions" and adapts responses to align with a "confident, cheeky, and proud" demeanor.
The last step of writing a chatbot is defining a format for the generated outputs. If no format is specified, most LLMs will respond with plain text fulfilling all previously mentioned criteria, which is not optimal. Format, unlike previous segments, has the advantage of almost always using the same prompt for all sorts of chatbots - rules, the writing style, name display and format of narrated "actions". The following example will employ said format and, if the reader wishes to, its free to copy and adapt to your necessities
Rules: Wait for user actions. Use internet RP style, begin your responses with "Carl:", italicize and bold actions, and enclose words in quotation marks for added effect. Always use long responses.
*This example begins with a rule for how the bot will process responses, in this case, it will wait for the users’ actions instead of narrating conclusions on its own. Later the style is specified as "internet RP style", the most common format for roleplay.
The final step in creating a chatbot is determining its initial message. Often underestimated, this message significantly influences the direction of the conversation. A well-crafted first message that mirrors the format, personality, and expected behavior of the chatbot sets the tone for subsequent interactions.
For example:
Carl: "Oh, it's you! Come on in and ask me anything, what delicious dish are we cooking today? With my culinary skills, I'm up for almost anything!"
*This first response validates all previous formatting and details specified by the creator which will serve as a first example and guide for the chatbot's future interactions.
Now that you understand these elements, feel free to create your own prompts or chatbots according to your preferences. To illustrate the integration of all segments, the unified example might look like this:
Prompt:
From now on you will be Carl, an expert chef who excels at preparing recipes and explains the process in detail. As Carl you must explain how to prepare whatever the {user} requests in detail and mark the steps the {user} has to follow. Additionally, you must mention the list of ingredients, how much time each step requires and alternatives for ingredients that the {user} might lack.
Carl used to be a famous chef in Italy until he decided to move to Spain. Due to that he has preference for Italian food and might suggest dishes of said country. Nowadays Carl works as the head chef and his role is to teach new trainees how to properly cook.
Characteristics: Carl has brown hair, green eyes, is 1.78 meters height, is muscular, wears a chef hat along its white uniform. Personality: Carl is confident, a bit cheeky and takes pride on his cooking skills.
Rules: Wait for user actions. Use internet RP style, begin your responses with "Carl:", italicize and bold actions, and enclose words in quotation marks for added effect. Always use long responses.
///
First response:
Carl: "Oh, it's you! Come on in and ask me anything, what delicious dish are we cooking today? With my culinary skills, I'm up for almost anything!"
Note: As mentioned at the beginning, feel free to modify, change, adapt or skip the steps you do not consider necessary for your chatbot. At the end it all depends on your necessities.
Now that you have a grasp of what a prompt is and how to craft one, another aspect to ponder is specialization. If you've used a chatbot platform before, you might have observed the diverse array of chatbots available: from personas for interaction, and grammar assistants, to RPG simulators. Each of these chatbots serves a specific purpose, and although they all start with the basics explained here, each category demands its own guide.
To avoid confusion, a "Specialized Prompt" assumes the role of a chatbot tailored and optimized for a specific function. Similar to how "Carl" was designed to embody a chef, creators have the liberty to steer their chatbots in any direction they desire. To "specialize" a chatbot, the sole requirement is to channel all prior steps into your envisioned role for the chatbot.
For example:
Suppose you wanted Carl to be a mechanic instead of a chef; all you'd need to do is substitute everything related to food with activities about your area of interest. Conversely, if I aimed to transform Carl into a grammar bot, perhaps I wouldn't require details like personality or background. Instead, I could focus on formatting rules and definitions.
Writing chatbots might seem like a complex task that requires a vast amount of knowledge, however, one of the most important skills, if not the most important one, is the creativity of the creator. Most of the concepts explained in this tutorial serve as a foundation to further expand your creativity and set free your imagination while creating a chatbot. With that in mind, hopefully, this tutorial might serve its purpose and guide you in the process of writing.