Skip to main content
Practice

What is a Prompt?

A prompt is a question or instruction directed at generative AI to perform a specific task.

For instance, to summarize a news article, you might provide the AI with the following prompt:

Prompt Example
Read the following news article and summarize the main points.

A prompt generally 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 instead of vague ones.


Below are examples of good and bad prompts when using an image generation AI.

Bad Instruction Example
Draw a cabin.

This instruction is too vague, lacking specific details.

Without guidance on the style, elements, or colors of the image, the outcome is unpredictable.


Good Instruction Example
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.

Providing a detailed and visualized instruction like this helps the AI to generate an image that aligns well with the user's intent.


Context

Context offers the background information and situation for the AI to consider when executing the instruction.

Prompt Example
# 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:

YearMonthProduct CategorySales
20191Electronics150
20191Furniture75
20191Gadgets200
20192Electronics165
............
202312Electronics190
202312Furniture90
202312Gadgets230

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.

Output Directives Example
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.