Writing Prompts: How to Give Effective Instructions
In recent years, the use of generative AI, including ChatGPT, has expanded rapidly. While these AIs bring us innovative possibilities, writing the right instructions, or “prompts,” is important to maximize their capabilities.
This article provides a comprehensive explanation of prompts, from the basics of how to write prompts to techniques, things to be careful about, and useful tools for providing more effective instructions. By reading this, you will have a deeper understanding of generative AI and be able to create the optimal prompt to achieve your goals.
What is a prompt?
Prompt definition and role
A prompt is an instruction given to a generative AI. In a dialogue with an AI, the prompt serves to communicate what we expect from the AI. Depending on the content of the prompt, the output of the AI, such as text, images, music, and videos, can change significantly.
For example, if you input the prompt “Tell me about the weather today” to a text generation AI, the AI will collect current weather information and output it as a sentence. On the other hand, if you input the prompt “Describe today’s weather in a haiku,” the AI will generate a haiku based on the information about the weather.
As such, prompts are an important factor in determining the output of generative AI, and depending on how you write the prompts, you can make the most of the AI’s capabilities.
Basic prompt writing
There are three basic elements to writing a prompt:
- Clear instructions: Be clear about what you want the AI to do. Avoid vague or abstract language; use specific, easy-to-understand language.
- Be specific: Be specific about the information the AI needs to perform its task. Clear keywords, context, constraints, etc. will lead to more accurate results.
- Desired Output Format: Tell us what format you want your results to appear in. Specifying specifics like text length, format, style, image size, resolution, composition, etc. will help you get the results you expect.
For example, if you input the prompt “Write an article introducing tourist spots in Tokyo” into a text generation AI, you can get better results by adding more specific information as follows:
- Clear instructions: “Write an article in English introducing tourist spots in Tokyo for foreign tourists.”
- Specific information: “Please introduce some famous tourist spots such as Sensoji Temple, Tokyo Tower, and Shibuya Scramble Crossing, as well as some hidden gems.”
- Desired output format: “Approximately 1000 characters of text, including bullet points and photos.”
Prompt Type
The prompts vary depending on the type of spawned AI.
- Text generation prompts: These prompts are used to instruct text generation AIs such as ChatGPT to create, translate, summarize, etc.
- Image Generation Prompts: These prompts are used to instruct image generation AIs such as Midjourney and Stable Diffusion to generate, transform, or edit images.
- Other: You can also create prompts for other types of generative AI, such as music generation AI or video generation AI, depending on their purpose.
The writing method and points to note vary depending on the type of prompt. It is important to understand the characteristics of each AI and create appropriate prompts.
How to Write Effective Prompts
Prompts play an important role in communicating with generative AI. Creating effective prompts can help you get higher quality output from your AI. Here, we will explain how to write prompts in three parts.
Give clear instructions
AI cannot understand context or implicit consent like humans can, so prompts need to be as clear and specific as possible.
- Avoid vague statements: Avoid vague statements like “write a catchy sentence.” Instead, give specific instructions like, “The target audience is women in their 20s. Write a catchy copy that conveys the appeal of the product in a casual tone.”
- Use clear subject and predicate: By using clear subject and predicate, such as “Please explain about XX” instead of “Tell me about XX,” the AI can generate more accurate answers.
- Use imperatives: Giving instructions in imperative form, such as “please do this” or “please do this”, makes it easier for the AI to understand the task.
example:
- Vague prompt: “Tell me a funny story.”
- A clear prompt: “Write a short, funny story that an elementary school child would enjoy.”
Provide specific information
To get an AI to perform a task, you need to be specific and provide it with the information it needs.
- Keywords: Including relevant keywords in your prompts will help the AI gather better information and incorporate it into the output.
- Context: By explaining the background, purpose, and target audience of the task, the AI can generate more contextual answers.
- Constraints: By specifying the specific conditions you want for the output (number of characters, format, style, etc.), you can more easily get the results you expect.
- Examples and reference materials: Providing concrete examples and reference materials makes it easier for the AI to grasp the concept, increasing the likelihood of it generating high-quality output.
- Values and Units: Precisely specifying values and units allows the AI to perform more accurate calculations and comparisons.
example:
- Low-information prompt: “Make a trip plan.”
- Prompt with specific information: “Please create a trip plan for a four-day, three-night trip from Osaka to Kyoto. The budget is 50,000 yen per person, and we would like to enjoy historical sites and delicious food.”
Specify the desired output format
AI can generate output in a variety of formats, so by being specific about your desired output format you can get results that fit your needs.
- Text Length: Specify text length – short, long, bullet points, etc.
- Format: Specify the format of your piece of writing – email, blog post, poem, code, etc.
- Style: Specify the tone (polite, casual, etc.) and writing style (descriptive, narrative, etc.).
- Image size, resolution, and composition: For image generation AI, specify the image size, resolution, composition, etc.
example:
- Unformatted prompt: “Tell me about cats”
- Formatted prompt: “Please describe in bullet points the types of cats, their characteristics, and how to care for them.”
Prompt Engineering Techniques
Prompt engineering is a technique for effectively designing and adjusting prompts to obtain desired outputs from an AI model. Here, we will introduce some representative techniques of prompt engineering.
Few-shot learning
Few-shot learning is a technique that teaches an AI model a new task by showing it a small number of examples. For example, if you show a sentence generation AI the example “apples are red” and ask it the question “What about bananas?”, it can generate the answer “yellow.”
Few-shot learning is effective when you want to specialize an AI model for a specific task. For example, if you want to generate sentences in a specific genre, you can show the AI model several examples of sentences in that genre to help it generate more appropriate sentences.
Chain-of-Thought prompting
Chain-of-Thought prompting is a technique that improves the ability of an AI model to solve complex problems by explicitly showing the thought process to the model. For example, for the problem “1+2+3+4+5=?”, the AI model can arrive at a more accurate answer by showing the calculation process step by step, such as “1+2=3, 3+3=6, 6+4=10, 10+5=15.”
Chain-of-Thought prompting is useful for tasks that require logical thinking or reasoning, such as solving math problems or summarizing text.
Zero-shot prompting
Zero-shot prompting is a technique for instructing an AI model on a new task without showing it any examples in advance. For example, if you instruct a text generation AI to “write a poem about cats,” the AI model will generate a poem based on its knowledge of cats.
Zero-shot prompting is effective in increasing the versatility of AI models, but it is necessary to provide clear and specific instructions to the AI model so that it can correctly understand the task and output the appropriate results.
Points to note when creating prompts
When creating a prompt, keep the following points in mind:
Understanding the characteristics of AI
AI is not omnipotent. It is important to understand what AI is good at and what it is not good at, and assign it appropriate tasks. For example, current AI can answer questions about facts, but may not be able to answer questions that ask for emotions or opinions.
AI can also reflect the biases contained in the training data. For example, AI trained with data that contains prejudice against a particular gender or race may generate discriminatory text or images.
Ethical considerations
It is also important to consider ethical considerations when creating prompts. Avoid discriminatory or offensive language or instructions that infringe copyrights. Also, when dealing with personal or confidential information, you must be mindful of privacy protection.
Feedback and Improvements
Evaluate the output generated by the AI and revise the prompts as needed. Prompt engineering is the process of creating more effective prompts through trial and error.
Prompt creation support tool
There are now tools available to help you create prompts, which can help you create more efficient and effective prompts.
Introduction of main tools
- PromptBase: A marketplace of prompts for various tasks. You can buy prompts created by other users or sell your own prompts.
- AIPRM for ChatGPT: An extension for ChatGPT that provides SEO-optimized prompts and task-specific prompts.
- Other: There are many other tools available to help you create prompts. Find the one that works best for you and use it.
How to use the tool
Prompt creation tools can help you get ideas for prompts and improve the quality of your prompts, but it’s also important to practice writing your own prompts rather than relying too much on them.
Summary: Mastering prompts to expand the possibilities of generative AI
Generative AI is a revolutionary technology that has the potential to significantly change the way we live and work. However, to realize its true value, it is essential to know how to write effective prompts. Prompts are the key to communicating with AI and an important means of maximizing AI’s capabilities.
This article provides a comprehensive explanation of prompts, from the basics of how to write prompts to techniques for providing more effective instructions, things to be aware of, and useful tools. Use this information to improve your prompt-writing skills and maximize the potential of generative AI.
When creating prompts, it’s important to always keep the following points in mind:
- Provide clear and specific instructions: AI cannot interpret human intent, so prompts must be written clearly and specifically so that the AI can understand them without misinterpretation.
- Understand the characteristics of AI: AI is not omnipotent, so it is important to understand what it is good and bad at and assign it appropriate tasks.
- Ethical considerations: Avoid discriminatory or offensive language, or instructions that infringe copyrights. Also, when dealing with personal or confidential information, you must be mindful of privacy protection.
- Feedback and improvement: Evaluate the output generated by the AI and revise the prompts as needed. Prompt engineering is the process of creating more effective prompts through trial and error.
You can also use prompt creation tools to help you get ideas for prompts and improve the quality of your prompts.
Mastering prompts is synonymous with mastering generative AI. By honing your prompt engineering skills, you will gain a deeper understanding of generative AI and be able to maximize its capabilities. Generative AI is a powerful tool that expands our creativity and opens up new possibilities. Be sure to master prompts and maximize the potential of generative AI.
Comments