What is a Prompt?
A prompt
is a question or instruction given to generative AI to perform a specific task.
For example, if you want AI to summarize a news article, you might use the following prompt:
Read the following news article and summarize the main points.
A well-structured prompt typically consists of four key components: Instruction
, Context
, Input Data
, and Output Directives
.
Instruction
The instruction specifies the task you want the AI to perform
.
Just like with people, to get a clear result from AI, you should provide
clear instructions
.
Below are examples of good and bad prompts when using an image generation AI.
Draw a cabin.
This instruction is too general, lacking specific details about the style, setting, or colors. As a result, the generated image could be unpredictable.
Draw a small cabin nestled in a peaceful mountain forest. The cabin should be wooden, surrounded by lush green trees. Show the sky in the background at sunset. The sky should be tinged with orange and pink.
By providing specific and visual details, AI can generate an image that closely matches your intent.
Context
Context offers the background information
and situation
for the AI to consider when executing the instruction.
# Instruction Based on the sales data per product below, analyze the sales trend by product category over the past 5 years. # Context With increasing market competition, a deep sales analysis of the company’s product line has become essential. In particular, we want to understand how seasonal changes affect sales volumes for each product category, and identify which products have been the most popular.
Providing context such as the need to assess seasonal sales changes and popular products ensures the AI understands the requirements more thoroughly, enhancing the accuracy of the task execution.
Input Data
Input data refers to the data that the AI will analyze or reference
.
In the sales volume analysis example, sales data like the following would be considered input data:
Year | Month | Product Category | Sales |
---|---|---|---|
2019 | 1 | Electronics | 150 |
2019 | 1 | Furniture | 75 |
2019 | 1 | Gadgets | 200 |
2019 | 2 | Electronics | 165 |
... | ... | ... | ... |
2023 | 12 | Electronics | 190 |
2023 | 12 | Furniture | 90 |
2023 | 12 | Gadgets | 230 |
Output Directives
Output directives specify the format of the desired output
.
For example, when requesting data analysis, you might include a directive to present results in a specific format, such as a table, graph, or text summary.
Below is an example of output directives from the sales volume analysis example that instructs creating a line graph and report using the input data.
Visualize the monthly sales volume for each product category as a line graph. Use 'Month' as the x-axis and 'Sales' as the y-axis, displaying each category in a different color. Subsequently, write a report analyzing how sales volumes change with the seasons, and which products have been the most popular.
Check out the AI's response.
Lecture
AI Tutor
Design
Upload
Notes
Favorites
Help