table of contents
- What is a prompt?
- The role of prompts
- The importance of prompts
- Tips for writing prompts
- Examples
- summary
- References
1. What is a prompt?
A prompt is a piece of text or instructions that is fed into an LLM (large-scale language model) to produce a response that is generated for a specific purpose. Prompts are designed based on the information or task a user is looking for and guide how the LLM should operate to produce that response.
In essence, it is a set of instructions for the AI.
2. The role of prompts
The prompt serves the following purposes:
- Question format : The text used when a user asks a specific question.
- Form of instruction : A piece of text instructing the LLM to perform a specific task.
- Providing Context : Text that provides background information or facts that the LLM needs to generate a more accurate response.
- Output format specification : Instructions for generating the LLM output in a specific format (e.g. JSON, Markdown).
3. The importance of prompts
Prompts have a significant impact on the quality and accuracy of LLM responses, so it is important that they are designed properly. The importance of prompts is evident from the emergence of the job title "prompt engineer" and the high demand for prompts.
4. Tips for writing prompts
Here are some tips for writing effective prompts:
- Write concisely : Even if it is the same command, a shorter sentence will make it easier to convey your intention to the LLM and will also be less costly.
- Write clearly : Do not write in a way that leaves room for interpretation.
- Be informative : Including necessary background information and examples will elicit more accurate responses.
- Use delimiters : If you have multiple instructions or elements, it is a good idea to use delimiters to clearly separate them.
- Assign roles : By assigning specific roles to LLMs, you can control the style and tone of the response you expect.
5. Specific Examples
Here are some specific examples of writing prompts:
Keep it concise
Bad Example :
こんにちは、私は気象情報が欲しいのですが、できれば今日の午後の天気について、具体的には気温、湿度、風速、降水確率などの情報を教えてください。
Good example :
今日の午後の天気(気温、湿度、風速、降水確率)を教えてください。
Write clearly
Bad Example :
今日の午後の天気を教えて。
Good example :
今日の午後の気温、湿度、風速、降水確率を教えてください。
Give sufficient information
Bad Example :
レポートを書いてください。
Good example :
Please write a report of no more than 1000 words on the following topic:
Topic: The future of AI and its social impact
Use delimiters
Bad Example :
次の3つの質問に答えてください。1. 今日の天気 2. 明日の天気 3. 今週末の天気
Good example :
Please answer the following three questions:
question: """
1. Today's Weather
2. Tomorrow's weather
3. This weekend's weather
"""
Assigning roles
Bad Example :
天気予報を教えてください。
Good example :
あなたは気象予報士です。今日の午後の天気予報を教えてください(気温、湿度、風速、降水確率)。
6. Summary
Prompts are an important factor that greatly affects the quality and accuracy of LLM responses. To write an effective prompt, it is important to keep in mind the following tips: conciseness, clarity, sufficient information, use of punctuation marks, and role assignment. Please refer to the concrete examples to help you create your own prompts.