AI From Zero · Prompt Engineering

What Is Prompt Engineering?

Learn what prompt engineering means and how clear goals, context, instructions, constraints, examples, and output requirements can improve AI responses.

Estimated learning time: 15 minutes

What You'll Learn

By the end of this lesson, you will be able to:

- Explain what a prompt is.
- Explain what prompt engineering means.
- Understand why the way a request is written can affect an AI response.
- Distinguish between vague and specific prompts.
- Give an AI assistant a clear goal.
- Provide relevant context.
- Specify the desired output.
- Add useful constraints to a prompt.
- Use examples to guide an AI response.
- Improve a prompt through iteration.

What Is a Prompt?

A prompt is the instruction, question, or information that you provide to an AI system to guide its response.

For example:

"Explain machine learning in simple language."

This is a prompt.

A prompt can be very short, or it can contain detailed instructions, background information, examples, constraints, and output requirements.

What Is Prompt Engineering?

Prompt engineering is the practice of designing and refining instructions so that an AI system can produce a more useful result.

It is not about discovering one magical sentence that always produces a perfect answer.

Instead, it is about communicating the task clearly and giving the AI the information and guidance it needs.

Why Does Prompt Wording Matter?

AI systems respond to the information and instructions provided in the prompt.

If a request is vague, the AI may have to make assumptions.

If a request is specific, the AI has a clearer understanding of what the user wants.

Compare these two prompts:

Vague:

"Write something about marketing."

Specific:

"Write a 300-word introduction to digital marketing for beginners. Use simple language and include three practical examples."

The second prompt provides much more direction.

Start With a Clear Goal

A useful prompt should make the desired goal clear.

For example:

"Help me prepare for a job interview."

This identifies a general goal.

You can make it more specific:

"Help me prepare for a beginner-level data analyst interview. Give me ten common questions and explain what a strong answer should contain."

The second version gives the AI a clearer task.

Provide Relevant Context

Context tells the AI about the situation surrounding the task.

For example, suppose you want help writing an email.

Instead of saying:

"Write an email about the delay."

You could provide context:

"Write an email to a customer explaining that their project delivery will be delayed by two days. Keep the tone professional and reassuring."

The additional context helps the AI understand the situation.

Give the AI a Role When Useful

Sometimes it is useful to tell the AI what perspective or role to use.

For example:

"Act as a beginner-friendly programming tutor and explain this Python error."

Or:

"Act as an editor and review this paragraph for clarity and grammar."

A role can provide useful direction, but it should not be treated as a guarantee that the AI possesses real-world professional authority.

Specify the Audience

The same information may need to be presented differently depending on who will read it.

For example:

  • A child.
  • A beginner.
  • A university student.
  • A technical professional.
  • A business executive.

You can include the audience in the prompt.

"Explain cloud computing to a small-business owner with no technical background."

This gives the AI useful guidance about the expected level of explanation.

Specify the Output

Tell the AI what form you want the answer to take.

Examples include:

  • Bullet points.
  • A table.
  • A numbered list.
  • A short paragraph.
  • An email.
  • A report.
  • A checklist.
  • A presentation outline.

For example:

"Compare these three options in a table with columns for cost, advantages, disadvantages, and best use."

This is more useful than simply asking:

"Compare these options."

Add Constraints

Constraints define boundaries for the response.

Examples include:

  • Maximum length.
  • Number of examples.
  • Reading level.
  • Tone.
  • Required sections.
  • Information that should be excluded.
  • Formatting requirements.

For example:

"Explain this concept in fewer than 200 words using simple language and three examples."

The constraints make the expected result clearer.

Use Examples

Examples can help an AI understand the type of output you want.

Suppose you want product descriptions to follow a particular format.

You could provide one example and ask the AI to follow the same structure for other products.

This approach is sometimes called few-shot prompting when multiple examples are provided.

Tell the AI What to Avoid

Sometimes it is useful to explain what should not appear in the response.

For example:

"Write a professional product description. Avoid exaggerated claims, technical jargon, and unsupported promises."

This gives the AI additional boundaries.

Vague Prompts and Specific Prompts

Consider the difference:

Vague:

"Make this better."

Specific:

"Rewrite this paragraph so it is clearer and more concise. Keep the original meaning and use a professional tone."

The second prompt provides clear criteria for improvement.

Prompt Structure

A useful beginner prompt can often be structured using five basic components:

  1. Goal: What do you want to accomplish?
  2. Context: What information does the AI need?
  3. Instructions: What should the AI do?
  4. Constraints: What limits or rules should it follow?
  5. Output: What should the final result look like?

Not every prompt needs all five components.

Simple tasks may require only a goal and instruction.

Complex tasks may benefit from all five.

An Example of the Five-Part Structure

Suppose you need a study plan.

You could write:

"I am preparing for a beginner-level AI exam. I have two weeks available and about one hour each evening. Create a daily study plan covering the major concepts I should understand. Keep each session focused on one topic and include a short review at the end of each week. Present the result as a table with day, topic, activity, and review."

This prompt contains:

  • Goal: Prepare for an AI exam.
  • Context: Beginner level, two weeks, one hour each evening.
  • Instructions: Create a daily study plan.
  • Constraints: One topic per session and weekly review.
  • Output: A table with specified columns.

Prompt Engineering Is an Iterative Skill

Your first prompt does not have to be perfect.

You can inspect the result and improve the prompt.

For example:

  1. Write the initial prompt.
  2. Review the response.
  3. Identify what is missing or incorrect.
  4. Add clearer instructions.
  5. Run the improved prompt.
  6. Compare the results.

This process is called iteration.

Improve a Prompt Based on the Result

Suppose the AI gives a study plan that contains too much material for one hour per day.

You could refine the prompt:

"Revise the plan so that each daily session can realistically be completed in 45 minutes. Keep the most important topics and remove lower-priority material."

The second prompt uses information learned from the first result.

Ask for Clarification

If a task is unclear, you can ask the AI to identify the missing information.

For example:

"Before creating the plan, ask me the five questions that would help you make the plan more realistic."

This can reduce the need for the AI to guess.

Prompt Engineering Is Not Only About Length

A longer prompt is not automatically a better prompt.

A useful prompt is one that provides the information and instructions needed for the task.

Adding unnecessary details can make a prompt harder to manage.

Focus on relevant clarity rather than maximum length.

Prompt Engineering Is Not a Magic Formula

There is no universal prompt that guarantees a perfect answer from every AI system.

Different systems can have different capabilities, interfaces, limitations, and behaviors.

A prompt that works well for one task may need to be changed for another.

The important skill is understanding the task and communicating the requirements clearly.

Use Natural Language

You do not need to use complicated technical language to write an effective prompt.

Plain and precise language is often enough.

For example:

"Summarize this document in five bullet points. Focus on the main conclusions and exclude minor details."

This is a simple prompt, but it contains a clear task, output format, focus, and constraint.

Separate Instructions From Source Material

When a prompt contains a large amount of source material, it can help to clearly distinguish the instructions from the material.

For example:

"Use the information between the BEGIN TEXT and END TEXT markers to create a summary."

This can make the structure of the request easier to understand.

Ask for a Specific Level of Detail

Sometimes the AI response may be too short or too detailed.

You can specify the desired depth.

For example:

  • "Give me a one-paragraph overview."
  • "Explain this in moderate detail."
  • "Provide a detailed beginner-friendly explanation."
  • "Give me a concise executive summary."

This helps align the response with your needs.

Specify Tone When It Matters

Tone can be important for communication tasks.

You can request a tone such as:

  • Professional.
  • Friendly.
  • Formal.
  • Concise.
  • Persuasive.
  • Neutral.
  • Educational.

For example:

"Write a concise and professional response to this customer complaint."

Specify the Reading Level

You can also specify the expected reading level.

For example:

"Explain this technical concept using language suitable for a complete beginner."

This can make the response more accessible.

Use Step-by-Step Instructions When Appropriate

Some tasks contain several requirements.

Listing the requirements separately can make the request clearer.

For example:

  1. Summarize the document.
  2. Identify the three main issues.
  3. Suggest possible solutions.
  4. Present the result in a table.

This structure makes the expected workflow explicit.

Ask for a Revision

If the first response is close but not quite right, you do not necessarily need to start again.

You can tell the AI what needs to change.

For example:

"Keep the structure, but make the explanation simpler and reduce the length by about half."

This is another form of prompt refinement.

Prompt Engineering and Critical Thinking

Good prompting is not a replacement for critical thinking.

A well-written prompt can produce a more useful response, but the result can still contain errors.

You should continue to evaluate important information and verify important claims.

Prompt Engineering and AI Limitations

A better prompt can improve communication with an AI system, but it cannot remove the fundamental limitations of the system.

A clear prompt does not guarantee:

  • Perfect accuracy.
  • Complete information.
  • Current information.
  • Correct reasoning in every situation.
  • Reliable results for every task.

Prompt engineering should therefore be combined with verification and human judgment.

A Practical Prompt Checklist

Before sending an important prompt, ask:

  • Is my goal clear?
  • Did I provide the necessary context?
  • Did I explain what the AI should do?
  • Did I specify important constraints?
  • Did I explain the desired output?
  • Would an example help?
  • Did I provide unnecessary information?
  • Can I easily evaluate the result?

Your First Prompt Engineering Exercise

Start with a simple task that you already know how to perform.

Write a vague prompt for that task.

Then rewrite it using the five components:

  1. Goal.
  2. Context.
  3. Instructions.
  4. Constraints.
  5. Output.

Run both prompts and compare the results.

Look for differences in relevance, structure, detail, and usefulness.

What You Should Remember

  • A prompt is an instruction or request given to an AI system.
  • Prompt engineering is the practice of designing and refining prompts for better results.
  • Clear goals reduce ambiguity.
  • Relevant context helps the AI understand the situation.
  • Output requirements make results easier to use.
  • Constraints can guide length, tone, format, and scope.
  • Examples can demonstrate the desired pattern.
  • Prompt engineering is iterative.
  • Longer prompts are not automatically better.
  • Good prompting improves communication but does not eliminate AI limitations.
  • Important AI-generated information should still be evaluated and verified.

What Comes Next?

You now understand the basic idea behind prompt engineering.

In the next lesson, we will examine one of the most important parts of a good prompt: giving AI clear instructions.

Key Takeaways

  • Prompt engineering means designing and refining instructions to improve AI results.
  • A useful prompt often contains a clear goal, relevant context, instructions, constraints, and an output requirement.
  • Specific prompts usually give the AI less room to make unnecessary assumptions.
  • Examples can help communicate the desired output pattern.
  • Prompt engineering is an iterative process.
  • A better prompt does not guarantee a correct answer, so verification remains important.

Try It Yourself

Compare a vague prompt with an improved prompt.

Choose a simple task such as writing an email, creating a study plan, summarizing information, or generating a checklist.

First, write a short and vague prompt.

Then create a second prompt containing:

  • A clear goal.
  • Relevant context.
  • Specific instructions.
  • Useful constraints.
  • A defined output format.

Run both prompts through an AI assistant and compare the results.

Identify at least three differences between the two outputs and explain which prompt produced the more useful result.

Test Your Knowledge

You've reached the end of this lesson.

Test what you've learned with the What Is Prompt Engineering? - Quiz.

Take the Quiz
Anatomy of a Good Prompt →
Back to Course