Designing Effective AI Prompts
Foundations / AI and Joule Design / Guidelines / Designing Effective AI Prompts
Intro
In the context of generative AI experiences, a prompt refers to the instruction given by a user to guide the output of a generative AI model.
A prompt can be:
- A predefined set of instructions for AI provided by the system
- A custom question written freely by the user
- A combination of custom text and output parameters
- A single command like “extend, simplify, translate”
Designing effective AI prompts is about helping users create quality input so they can get the best results.
In This Guideline
The sections below:
- Outline the design principles that apply for prompts
- Explore the different prompt patterns, when to use them, and what to watch out for
- Provide best practices for creating effective prompt designs
Design Principles
The following emerging design principles for generative AI are fundamental for shaping the user experience for instructing AI through prompts:
Empower and Inspire
Enhance human capabilities and improve outcomes with AI, without aiming to replace human intelligence. Facilitate empowering and inspiring interactions with AI that will improve human lives.
- Let users know when an output has been created with generative AI, or when a UI feature is using generative AI to deliver results.
- Remind users to validate the accuracy of generative AI outputs.
- Proactively help users to verify and improve generative AI results.
Allow users to ask the generative AI for prompting tips, or to write them a better prompt for their desired outcome.
Maintain Quality
Ensure high-quality input by providing AI support for user inputs, based on the user’s most likely needs in the moment. Help users understand, analyze, and validate the output generated by AI.
- Maintain contextual awareness of user needs and priorities.
- Provide education and guidance to users through embedded and interactive support.
- Enable users across diverse levels of literacy and technical expertise.
Allow users to provide feedback to the system for future improvements.
Types of Prompt Pattern
We distinguish between the following prompt types:
- Quick prompts: Ready-made questions or actions that users can trigger with one click.
- Guided prompts: Users can set output parameters to specify or narrow down queries.
- Custom prompts: Users write from scratch using natural language.
The sections below explain the use cases, pros and cons, and guidelines for each prompt type in more detail.
Quick Prompts
Quick prompts are predefined questions or actions provided by the system for the user to trigger with a single click. They are artfully crafted by prompt engineers, who specialize in giving successful direction to a generative AI feature.
Depending on the context and the nature of the task, one or several prompt options might be available.
Quick prompt button Image is shown for illustration purposes only
Quick prompts in a menu Image is shown for illustration purposes only
Quick prompts in Joule Image is shown for illustration purposes only
When to Use Quick Prompts
:icon-sys-enter-2Use:
- When users are known to be using the generative AI feature for common requests
- When users can only prompt the model about a limited set of use cases or queries
- When there are a specific and limited number of actions that the system can assist with
- When users are not subject matter experts
- When it is important to minimize prompt-infused bias as much as possible
- When you need to ensure and maintain a constant and predictable type of outcome
:icon-sys-cancel-2Don’t Use:
- When users are subject matter experts and prefer flexibility
- When we can’t predict a user’s intent
Guidelines for Quick Prompts
Avoid Bias
When using quick prompts, your team must purposefully craft the instructions for the AI system to avoid inadvertently producing biased results. Inadequate prompt design can perpetuate harm, just like biased training data.
As a designer, you can advocate for bringing together a diverse group of users and technical experts to invest in mindful prompt design, thoroughly evaluate user needs and results, and iterate to ensure that AI-generated content is free of bias.
Foster Optimal Outcomes
Your team must engineer high-quality prompts for the foundation models or large language models (LLMs), ensuring users achieve the desired result when using your AI feature with quick prompts.
Follow the best practices and, when needed, use advanced LLM techniques, such as embeddings and fine-tuning to get the best outcomes.
Guided Prompts
Guided prompts offer control and precision in generating outputs that align with user preferences, without requiring users to articulate their intent in natural language.
Users can write their prompts and adjust output settings such as style, length, and format. The intuitive interface, offering various controls, allows users to modify certain parameters, such as image size and resolution, data sources, language model, and even the persona the AI should embody when crafting responses.
Guided prompt in a popover Image is shown for illustration purposes only
Guided prompt in Joule Image is shown for illustration purposes only
When to Use Guided Prompts
:icon-sys-enter-2Use:
- When there are a specific and limited number of queries the system can answer
- When users are moderate subject matter experts
- When users have no experience in writing prompts, or only intermediate experience
- When users need to customize and personalize inputs for a more tailored experience
- When users require more specific outputs, such as generating content with a particular tone, style, or topic focus
- In scenarios like content customization, chatbot interactions, or generating recommendations
:icon-sys-cancel-2Don’t Use:
- When the use case requires that generative AI performs only one or a few specific actions. Use quick prompts instead.
- When there are limitless queries the system can answer. Use custom prompts instead.
Guidelines for Guided Prompts
Master Prompt Engineering
Like with quick prompts, you and your team must understand prompt engineering to guide users in crafting effective instructions for the AI system. Getting the best out of ChatGPT: Prompt engineering basics features a comprehensive list of learning resources.
Choosing the right prompt parameters depends on the situation and what users need. Consider these different parts of a prompt as a starting point:
- Context: Background information about the situation
- Instructions: Clear and specific instructions on what the AI should do
- Relevant information: Sources that might help the AI system to generate a more accurate response
- Formatting: Instructions on how AI should structure the response, covering style elements like punctuation and formatting
- Examples: Samples of desired outcomes
- Constraints: Limits on what the AI should do
Work with your team to determine which parts of a prompt are relevant for your user scenario and the quality of the AI response. Try different prompt structures and carefully evaluate the results.
Remember, the order of instructions in a prompt matters. Experiment with different guided prompt designs to see what works. If your product serves users with expert experience in writing prompts, you might let them change the order.
Less Is More
It’s not always necessary to reveal all the prompt parameters mentioned above to the user. You can conceal certain portions of the prompt, such as a base prompt with a designated role or persona that the AI should embody, or context information that applies universally to your product’s users. This approach helps streamline and enhance the user experience.
Hidden prompts and instructions provided by users work behind the scenes to guide the AI’s responses. These concealed elements are pivotal in shaping the AI’s output and contribute to creating an intuitive and user-friendly experience.
Familiar Building Blocks
When crafting the guided prompt user experience, utilizing familiar UI components for user input is key. Typically, these are buttons, input fields, selects, checkboxes, sliders, and so on.
These elements offer an intuitive way for users to design their prompts, ensuring a seamless experience that’s accessible by design. For a full list, check out the available input components for SAPUI5 or SAP Web Components.
Be precise when labeling different inputs and choose words carefully to minimize the chance of misinterpretation. Unless your use case requires different wording for greater clarity or newly emerging generative AI capabilities, try to adopt established labels.
Custom Prompts
Custom prompts are instructions that the user writes from scratch in natural language for the AI to follow when generating outputs.
Custom prompts allow users to explore a wide range of possibilities, engage with the AI as a collaborator, and generate diverse outputs far faster than humanly possible. They encourage creative freedom and can be valuable for writing, brainstorming, or generating ideas.
Custom prompt in Joule Image is shown for illustration purposes only
When to Use Custom Prompts
:icon-sys-enter-2Use:
- When users want to explore and experiment with the generative AI feature to improve their work, generate new ideas, conduct desk research, or get insights from a specific subject matter expert, role, or persona
- When there are limitless queries the system can answer
- When users are subject matter experts
- When users have intermediate to expert experience in writing prompts
- When the desired output is flexible, and users can explore different concepts, styles, or ideas
:icon-sys-cancel-2Don’t Use:
- When users have no experience in writing prompts, or very little experience
- When users repeatedly ask a generative AI feature to answer a limited number of questions or perform a limited number of tasks
- When a generative AI model frequently delivers hallucinations or low-quality results for subject matter that is important to your users
- In high-stakes scenarios where guardrails and constraints are needed to ensure accuracy, safety, and privacy
Benefits and Challenges of Custom Prompts
Enabling users to write or speak prompts offers several benefits:
- AI as a collaborator: Limitless, open-ended creativity
- Natural language interactions: Users can communicate in a familiar manner and engage back and forth with AI models.
- Flexibility: Users can articulate a wide range of queries and requests.
- Personalization: Well-written natural language prompts enable AI models to understand the context of user inputs better, leading to more relevant and accurate responses.
- Adaptability: Users can adjust prompts on the fly, refining instructions to fine-tune AI responses.
While custom prompts give users more control and flexibility and contribute to an engaging user experience, they come with several challenges:
- Ambiguity: If instructions are too ambiguous, AI models might generate inaccurate responses.
- Potential for bias: Imperfect prompts might inadvertently perpetuate bias that is present in training data in the generated responses.
- Too specific or too vague: If prompts are too specific, AI models might struggle to generalize to broader contexts. If they are too vague, they might result in unhelpful responses.
- Poor structure or unclear: Improperly structured or unclear prompts might produce low-quality or outright nonsensical responses.
To get the most out of custom prompts and mitigate the risks, follow the guidelines below.
Guidelines for Custom Prompts
Invite AI to Collaborate
You can leverage large language models (LLMs) to enhance the quality of user prompts significantly. Users can receive suggestions on how to improve their prompts or be provided with alternative wording by tapping into the AI’s language capabilities. AI suggestions help craft clearer instructions, detect input that might lead to biased results, improve AI responses, and make prompt creation easier.
Assist Users in Avoiding Errors
You can employ multiple strategies to assist users in writing error-free prompts:
- Education: Identify opportunities to elevate users’ knowledge of generative AI and how to create effective prompts. Infuse onboarding, product tours, new feature highlights, contextual help, instructions, and empty states with helpful bite-sized learning nuggets and examples that are available just when users need them.
- Validation: Offer suggestions and feedback on prompts written by the user. This might be a warning about sharing sensitive data or bias that has been detected in the prompt or related information, for example. In such cases, always warn users before they send the prompt to the AI system.
- Autocorrect: Automatically apply proper punctuation and sentence structure to avoid AI misinterpreting the user’s intent.
Best Practices
Choose the right prompt interaction type for the use case
- Start by learning about user needs, their preferences, and their main goals for using generative AI.
- Consider how familiar the users are with generative AI. Offer a simple prompt experience for novices and advanced options for experts. If feasible, allow users to switch between prompt types based on their evolving needs and comfort level.
- Remember that the prompt must deliver the best possible result to streamline the task that the user needs to accomplish. Match the prompt type to the complexity of the task. Consider custom prompts for open-ended creativity, guided prompts for specific queries, and predefined prompts for common requests.
- Be clear on the desired output structure and format.
- Enable users to open up possibilities and narrow down choices at the right moment to ensure the best outcomes.
Balance flexibility and guidance
- Find the right balance between open-endedness and structure for your use case.
- Gradually offer options for customization to empower users to create prompts that match their needs as they become more familiar with the system.
- Provide options for advanced users to explore and experiment with more intricate prompt structures.
Narrow down the range of options
- If appropriate for your use case, prioritize the ease of use and limit the options to those relevant to the user’s context.
- Provide a set of predefined prompts aligned with common user intents to help users get started quickly.
- Use predictive typing to display the most useful prompts.
- Limit the AI model scope by grounding your prompt with data. Enhancing the generated content with specific real-world data or references ensures that AI outputs align with the intended purpose.
Continuously assist
- Use simple and concise language to avoid ambiguity and ensure users understand quick prompts and the parameters for guided prompts.
- Poor prompt design can generate output riddled with stereotypes.
Incorporate user feedback
- Continuously gather user feedback to refine and improve the prompt design.
- Offer options to provide immediate feedback on the prompt’s impact.
Summary
Designing an effective user experience for prompting AI requires thoughtful consideration of the user’s context and needs, balancing flexibility and guidance, and incorporating user feedback to continuously improve outcomes.
By strategically employing custom, guided and quick prompts and following best practices, you can create intuitive and empowering experiences that harness the full potential of generative AI while mitigating the risks. An effectively designed prompt experience enhances user satisfaction and ensures that generated outputs are relevant, accurate, and valuable – ultimately elevating the overall user experience with generative AI systems.
Helpful Terms
Prompt engineering
The process of designing and refining instructions to guide the behavior and output of generative AI models.
Base prompt
A core set of instructions given to the large language model (LLM) that serves as a foundation for generating responses or completing tasks.
Hidden prompt
A hidden prompt is like a secret instruction guiding a language model—like the puppeteer behind the scenes!
Embeddings
Embeddings enhance prompts by searching a knowledge base for context, providing a semantic representation of relevant documents, and improving the LLM’s ability to find semantically similar information.
Fine-tuning
Fine-tuning LLMs is the resource-intensive process of customizing a pre-trained language model on specific tasks or datasets to make it more proficient and accurate in generating relevant text.