Skip to main content
Practice

Why Should You Learn Prompt Engineering?

In modern society, AI is utilized in every aspect of our lives, from personal travel planning to sales data analysis.

However, AI can sometimes provide irrelevant answers to questions or overwhelm users with excessive responses to simple queries.

There are also times when we don't even know how to ask the right questions to solve a problem.

Just as people need correct directions to work effectively, generative AI requires accurate prompts.


To guide sometimes errant AI, a systematic approach to asking the right questions is called Prompt Engineering.

A prompt is a sentence that conveys a user's request to AI, and prompt engineering optimizes this prompt to help AI provide the desired response.


Examining Prompt Engineering through Examples

Let's look at specific examples of how prompt engineering can be utilized.

Imagine you're asking AI for an exercise schedule and diet plan to maintain a healthy lifestyle.

Prompt Providing Unorganized Responses
I'm creating an exercise schedule for the gym.

Let me know which exercises would be good every other day from June 1 to June 10, 2024, and include the diet plan for each day.

The above prompt requests exercise schedules and diet plans, but the AI's response often includes excessive information that is difficult to interpret at a glance, making it hard for users to quickly glean the required information.

So, what if we revise the prompt as follows?

Prompt Providing Neatly Organized Table Responses
I'm creating a schedule table for gym workouts.

Please list which exercises would be good every other day from June 1 to June 10, 2024, along with breakfast and dinner diet plans, in table format.

---table format---

### Title

| Number | Date | Day | Exercise | Breakfast | Dinner |

You will see that your exercise schedule, along with the diet plan, is neatly organized in a table.

By applying this, you can prevent ChatGPT from providing excessively long responses or format information to suit .csv or .xlsx files for spreadsheets.

The ### used next to the table format in the prompt acts as a Delimiter to clearly separate and structure the information within the prompt.

This delimiter helps AI unmistakably identify the following as table format under the context of the prompt.

The vertical bar | used to specify the table format acts as a delimiter for AI to separate table columns, which is a symbol used when creating tables in Markdown.

Markdown: A document authoring method that uses simple symbols to easily style text for different sizes, weights, tables, etc.


Markdown Table Example
| Number | Date       | Day  | Exercise | Diet    |
|-------|-----------|-----|---------|--------|
| 1 | 2024-06-10 | Mon | Running | Salad |
| 2 | 2024-06-11 | Tue | Swimming| Pasta |

The Markdown table above is displayed in AI responses or Markdown documents as follows:

NumberDateDayExerciseDiet
12024-06-10MonRunningSalad
22024-06-11TueSwimmingPasta

Prompt engineering is about specifying the format of responses and improving their readability, as well as preventing AI from providing incorrect answers.

Examples of prompt engineering for preventing incorrect answers will be covered in the next lesson :)


Practice

Click on prompt examples and compare the responses from the AI.