Prompt Design Guide | Prompt Engineering Guide

Kalyan KS · Beginner ·✍️ Prompt Engineering ·2y ago
Skills: Prompt Craft53%

About this lesson

Prompt Design Guide. This video lecture discusses prompt design guide in detail i.e., how to effectively craft the different elements of a prompt. The quality (accuracy and relevance) of outputs generated depends largely on the quality of the input prompt i.e., how well the input prompts are crafted. In general, an input prompt consists of many elements like persona, context, instruction, format, tone, constraints etc. 📝 Lecture Notes - https://llmnanban.akmmusai.pro/Mastery/Prompt-Design-Guide/ 📙 LLM Prompt Engineering Simplified Book (by Kalyan KS) ============================================================== Book link - https://llmnanban.akmmusai.pro/Book/LLM-Prompt-Engineering-Simplified-Book/ 📥 Do you want to get the latest updates related to Generative AI, LLMs, and Prompt Engineering? You can follow me on Twitter and LinkedIn. I do share a lot of useful information. 👋 Keep in touch? ============================================================== 🐥 Twitter - https://twitter.com/kalyan_kpl 🔗 LinkedIn - https://www.linkedin.com/in/kalyanksnlp/ 🌎 Website - https://www.akmmusai.pro/kalyanksnlp

Full Transcript

hi everyone in this video I'm going to present prompt design guide that is how to properly craft each prompt element the quality that is accuracy and relevance of outputs generated depends largely on the quality of the prompts that is how effectively The Prompt elements are crafted in general a prompt consists of many elements like Persona context instruction format tone constraints Etc let us see how to properly craft each of these prompt elements first let us see how to craft the Persona element the Persona element specifies what role the chatbot has to assume to generate the output remember that the more specific and well-defined your persona element is the better the chatbot can understand and respond appropriately here are some of the tips for crafting the Persona element the first one is be specific clearly Define the Persona you want the chatbot to take on this could be a specific character profession or role for example you can specify assume the Persona of a friendly librarian or imagine you are a techsavvy teenager second one is use descriptive language provide a clear description of the Persona using adjectives adverbs and illustrative phrases for example you can specify you are a wise and compassionate therapist with over 20 years of experience helping people navigate life's challenges third one is be respectful and ethical ensure that the Persona you're asking the chatbot to assume is respectful and adheres to ethical guidelines for example you should not ask the chatbot to assume the role of a criminal as it is against the ethical guidelines fourth one is mention limitations if there are any limitations to the Persona such as knowledge restrictions or ethical boundaries make them clear for instance provide medical advice but do not diagnose illnesses or avoid discussing sensitive political topics consider the prompt here the Persona element is assume that you are a friendly tourist guide in Thailand with more than two decades of experience here the Persona element is specific uses descriptive language and also follows ethical guidelines in this way you can craft a Persona element now let us see how to craft the context element the context element provides the necessary background details for the chatbot to get a better understanding here are some of the tips for crafting the content context element the first one is provide relevant information include key details that are directly related to the user's request or question this could include names dates locations or any specific facts or events that are relevant to the conversation for example instead of simply saying I'm planning a trip provide details like I'm planning a trip to Thailand for two weeks in July second one is be clear and concise keep the context element brief and to the point avoid unnecessary details or information that may confuse the chat bot consider the prompt here the context element is I'm a traveler from India I'm planning a trip to Thailand for 2 weeks here the context element is clear and concise and also provides all the relevant information in this way you can craft a context element now let us see how to craft the instruction element the instruction element specifies what the chatbot has to do here are some of the tips for crafting the context element the first one is be clear and concise your instruction should be straightforward and easy to understand avoid using complex language or unnecessary jargon the second is avoid ambiguity and vagueness ensure that your instruction leaves no room for ambiguity as ambiguous instructions can lead to unexpected or incorrect responses the third one is use action verbs use action verbs to convey the desired action some of the commonly used action verbs are explain describe list summarize translate write suggest classify complete generate Etc consider the prompt here the instruction element is suggest me a good traveling plan so that I can cover maximum number of places in 2 weeks if You observe the instruction element it starts with an action verb suggest and is clear and concise without any ambiguity in this way you can craft an instruction element now let us see how to craft the Exemplar element the Exemplar element provides hints in the form of examples to the chatbot for desired output generation here are some of the tips to effectively craft the Exemplar element the first one use word delimiters use word delimiters to separate the different parts of examples suppose you want to generate questions and answers from a paragraph in such a case you have to write example questions and answers in the Exemplar element in the examplar element you have to use word delimeters like question and answer to separate the question and answer in each example the second is provide diverse examples include multiple examplars to cover different aspects or variations this helps the model generalize and provide more accurate responses consider the prompt here the prompt does sentiment analysis on the given tweet based on the given example tweets along with their labels in the Exemplar element If You observe the Exemplar element the tweet and labels are separated using the word delimiters tweet and label moreover the Exemplar element includes diverse examples that is tweets from different labels in this way you can craft the Exemplar element now let us see how to craft the tone element the tone element specifies the style in which the output should be generated here are some of the tips to effectively craft the Exemplar element the first one is be explicit clearly specify the tone you want in your prompt use adjectives and adverbs that describe the tone such as formal casual humorous serious friendly or authoritative the second one is specify language and style preference if you have specific language preferences mention them in the tone element for instance if you want the text to be written in British English formal style explicitly state that in your prompt consider the prompt here the prompt asks the chatbot to generate a traveling plan to Thailand If You observe the tone element the tone element asks the chatbot to generate the traveling plan in a funny tone here the tone element explicitly specifies the tone using the adverb funny in this way you can craft the tone element now let us see how to craft the constraints element the constraints element specifies the restrictions on the output to be generated here are some of the tips to effectively craft the constraints element the first one is be clear and specific clearly Define the constraints in your prompt use explicit language to specify what is allowed and what is not allowed the second one is use keywords and phrases incorporate keywords and phrases that are relevant to your constraints these can include words like must should not cannot only Etc consider the prompt here the constraints element asks the chatbot to include the Divine places to visit at the end of the trip here the constraints are clear and specific in this way you can craft the constraints element now let us see how to craft the data element the data element specifies the input data which is to be processed by the chatbot to generate the expected output here are some of the tips to effectively craft the data element the first one is use delimiters use delimiters like tweet text QA Etc to separate the input data from the rest of the elements in the prompt the second is use punctuation marks use punctuation marks like single quotes double quotes asterisks Etc to explicitly highlight the input data consider the prompt here the prompt does sentiment analysis on the given tweet based on the given example tweets along with their labels in the Exemplar element If You observe a data element tweet text is separated from the rest of the prompt using the delimiter Tweet moreover the Tweet is highlighted using double quotes in this way you can craft the data element I hope you find this video informative you can find the notes for this video lecture in the book llm prompt engineering simplified which is freely available online to read like the video and subscribe to the channel so that you won't miss new video lectures see you in the next video lecture

Original Description

Prompt Design Guide. This video lecture discusses prompt design guide in detail i.e., how to effectively craft the different elements of a prompt. The quality (accuracy and relevance) of outputs generated depends largely on the quality of the input prompt i.e., how well the input prompts are crafted. In general, an input prompt consists of many elements like persona, context, instruction, format, tone, constraints etc. 📝 Lecture Notes - https://llmnanban.akmmusai.pro/Mastery/Prompt-Design-Guide/ 📙 LLM Prompt Engineering Simplified Book (by Kalyan KS) ============================================================== Book link - https://llmnanban.akmmusai.pro/Book/LLM-Prompt-Engineering-Simplified-Book/ 📥 Do you want to get the latest updates related to Generative AI, LLMs, and Prompt Engineering? You can follow me on Twitter and LinkedIn. I do share a lot of useful information. 👋 Keep in touch? ============================================================== 🐥 Twitter - https://twitter.com/kalyan_kpl 🔗 LinkedIn - https://www.linkedin.com/in/kalyanksnlp/ 🌎 Website - https://www.akmmusai.pro/kalyanksnlp
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

Up next
What is Prompt Chaining Explained with Examples
VLR Software Training
Watch →