Prompt Engineering
A prompt is a discrete input from the user that initiates or guides the chatbot’s response.
Last updated
A prompt is a discrete input from the user that initiates or guides the chatbot’s response.
Last updated
A conversation with an AI chatbot can have one or more prompts.We identified four components that were often (but not always) part of the AI prompts used in our study:
Request
References
Format
Framing
The following are strategies and tactics for getting better results from large language models.
In order to get a highly relevant response, make sure that requests provide any important details or context. Otherwise you are leaving it up to the model to guess what you mean. Bad example:"Who was the president?"
Good example: "Who was the president of USA in 2023, and how frequently are elections held?"
You can use the system message to specify the persona used by the model in its replies. This feature is useful for controlling and guiding the outputs of language models, ensuring coherence, relevance, and accuracy in generated responses.
You can use delimiters like triple quotation marks, XML tags, section titles, etc. to demarcate sections of text to be treated differently. By using delimiters like triple quotation marks and section titles, you can help ensure that the generated responses are accurate, relevant, and well-structured.
Providing general instructions that apply to all examples is generally more efficient than demonstrating all permutations of a task by example, but in some cases providing examples may be easier. For example, if you intend for the model to copy a particular style of responding to user queries which is difficult to describe explicitly. This is known as “few-shot” prompting.
You can ask the model to produce outputs that are of a given target length. The targeted output length can be specified in terms of the count of words, sentences, paragraphs, bullet points, etc. Note however that instructing the model to generate a specific number of words does not work with high precision. The model can more reliably generate outputs with a specific number of paragraphs or bullet points. Example:"Define prompt engneering in 50 words."
The key is to provide prompts that are open-ended and allow the writer to explore their creativity and personal experiences. Avoid overly specific or restrictive prompts. The best prompts act as a springboard for the writer's imagination.
Few-shot prompting is a powerful way to use Large Language Models (LLMs) to solve various tasks. However, it struggles with highly complex tasks. Decomposed Prompting addresses this by breaking down the task into simpler sub-tasks that can be individually optimized, leading to improved performance on challenging real-world problems.
You can use the following strategies for a bot role definiton to set your bot as a unique assistant.
Collaborative Prompts
Create together! Engage in collaborative prompts that encourage users to work with others to create new works of art or writing.
Visual Prompts
Spark your creativity with visually stimulating prompts, including photographs and artwork, to inspire your own visual masterpieces.
Character Prompts
Bring your characters to life! Develop rich and compelling characters through prompts that challenge you to delve deeper into their backstories, descriptions, and personalities.
Dialogue Prompts
Craft captivating conversations! Enhance your writing skills by engaging in prompts that focus on writing dialogue between characters and explore the art of effective communication.
Genre Prompts
Expand your creative horizons! Explore different genres like science fiction, romance, or horror through prompts that encourage you to experiment with new styles of writing or art.
Mood Prompts
Evoke emotions through your creations! Explore prompts that focus on creating specific moods or atmospheres, allowing you to master the art of setting the right tone.