Applied AI & Prompt Engineering · Module 2: Prompt Engineering Fundamentals · Lesson 11 of 55

Instruction Prompting: How to Give AI Clear and Precise Instructions

Instruction Prompting

Instruction prompting is the practice of giving an AI system clear and specific directions about what it should do, how it should perform the task, and what the expected result should look like.

While context prompting provides background information, instruction prompting focuses primarily on the actions and requirements the AI should follow.

Simple Definition:

Instruction prompting means telling AI clearly and precisely what you want it to do and what requirements it should follow.

Why Are Clear Instructions Important?

An AI system may understand the general subject of a request without understanding the exact outcome the user expects.

Vague Instruction

Explain Python.

Clear Instruction

Explain Python to a Class IX beginner.

Cover:
- What Python is
- Why it is used
- Three common applications
- A simple Python program

Use simple language and keep the explanation
under 400 words.

The second instruction gives the AI a much clearer definition of the expected task and output.

Instruction vs Context

Instruction and context are complementary but different.

Component Main Question Example
Context What is the situation? The students are Class XI beginners.
Instruction What should AI do? Explain Python functions.
Constraint What boundaries should AI follow? Use simple language.
Output Format How should the result look? Use headings and examples.

Use Action Verbs

Strong instructions often begin with a clear action verb.

Action Example Instruction
Explain Explain how Python functions work.
Compare Compare lists and tuples.
Analyze Analyze the examination dataset.
Summarize Summarize the document in ten bullet points.
Generate Generate five practice questions.
Rewrite Rewrite the paragraph in professional language.
Extract Extract all dates from the document.
Classify Classify the responses by category.
Evaluate Evaluate the proposed database design.
Create Create a 45-minute lesson plan.

Be Specific About the Desired Action

Compare the following instructions:

Weak Specific
Tell me about SQL. Explain SQL JOINs using simple examples.
Help with this code. Identify the logical errors in this Python code and explain how to fix them.
Make questions. Generate 15 Class X questions on HTML tables.
Improve this. Rewrite this paragraph in concise, professional language.

Use Numbered Instructions for Multi-Step Tasks

When a task contains several actions, numbered instructions can make the expected sequence easier to understand.

Analyze the student performance dataset.

Follow these steps:

1. Check for missing values.
2. Calculate subject-wise averages.
3. Identify the highest-performing subject.
4. Identify the lowest-performing subject.
5. Find students below the selected threshold.
6. Summarize the major findings.

Breaking a complex task into explicit steps can make the requested workflow easier to follow.

Sequential Instructions

Some tasks require the AI to perform actions in a particular order. In such cases, explicitly communicate the sequence.

First summarize the document.

Next identify the major decisions.

Then extract the action items.

Finally present the action items in a table
with columns for Action, Owner, and Deadline.

Conditional Instructions

Conditional instructions tell AI what to do when a particular condition is met.

Review the following student answers.

If an answer is correct, mark it as "Correct".

If it is partially correct, identify the missing
concept.

If it is incorrect, explain the misconception
in one or two sentences.

Conditional instructions are useful when the response depends on the characteristics of the input.

Positive Instructions

Positive instructions tell the AI what it should do.

Use simple language suitable for Class IX students.

This is often clearer than relying entirely on negative instructions.

Negative Instructions

Negative instructions tell the AI what it should not do.

Do not use advanced programming terminology.

Negative constraints can be useful, but they should normally be combined with a positive description of the desired behavior.

Use beginner-friendly language and short explanations.
Avoid advanced programming terminology unless it
is necessary, and define any technical term you use.

Instruction Priority and Consistency

A prompt may contain several instructions. These instructions should be consistent with each other.

Avoid Contradictory Instructions:

For example, asking AI to produce a "detailed 2,000-word report" and simultaneously requiring it to "use no more than 100 words" creates conflicting requirements.

Review complex prompts for contradictions before submitting them.

Instruction Specificity

The appropriate level of specificity depends on the task.

Task Instruction
Simple Define machine learning.
Moderate Explain machine learning to Class X students using two everyday examples.
Complex Compare supervised and unsupervised learning, provide examples, identify common applications, and present the comparison in a table.

Instruction Prompting for Education

Teachers can use instruction prompting to specify exactly how educational material should be created.

Create a 40-minute lesson on Python dictionaries
for Class XI students.

Follow these instructions:

1. Begin with a simple definition.
2. Explain dictionary syntax.
3. Show three practical examples.
4. Explain four commonly used methods.
5. Include one classroom activity.
6. End with five assessment questions.

Use beginner-friendly language.

Instruction Prompting for Examination Preparation

Create a Class XII Computer Science revision sheet.

Follow these instructions:

1. Cover Python functions and file handling.
2. Include important definitions.
3. Include common programming mistakes.
4. Provide five short-answer questions.
5. Provide five programming questions.
6. Include answers at the end.
7. Keep the questions examination-oriented.

Instruction Prompting for Coding

Coding instructions should clearly communicate the expected technology, functionality, restrictions, and behavior.

Create a Python program for calculating student results.

Follow these instructions:

1. Accept marks for five subjects.
2. Validate that every mark is between 0 and 100.
3. Calculate total marks.
4. Calculate the average.
5. Display the result clearly.
6. Handle invalid input gracefully.
7. Use functions to organize the program.
8. Add comments explaining important sections.

Instruction Prompting for PHP/MySQL

Modify the existing PHP/MySQL application.

Follow these instructions:

1. Use PHP 8 and PDO.
2. Preserve the existing database structure.
3. Add a student-search feature.
4. Use prepared statements.
5. Validate user input.
6. Do not modify unrelated modules.
7. Explain every database query introduced.
8. Identify any security considerations.

Instruction Prompting for Data Analysis

Analyze the provided examination dataset.

Follow these instructions:

1. Inspect the column names and data types.
2. Check for missing values.
3. Check for duplicate records.
4. Calculate subject-wise averages.
5. Identify unusual values.
6. Identify the highest and lowest performing subjects.
7. Summarize the important findings.
8. Present the results using tables where appropriate.

Instruction Prompting for Research

Analyze the provided research material about
generative AI in education.

Follow these instructions:

1. Identify the major themes.
2. Summarize the main findings.
3. Identify potential benefits.
4. Identify potential risks.
5. Identify research gaps.
6. Separate evidence from assumptions.
7. Do not present unsupported claims as established facts.
8. Present the findings using clear headings.

Instruction Prompting for Business

Analyze the following project proposal.

Follow these instructions:

1. Summarize the proposal.
2. Identify the main objectives.
3. Identify strengths.
4. Identify risks.
5. Identify resource requirements.
6. Identify implementation challenges.
7. Recommend the next three actions.

Present the final analysis in a professional table.

Instruction Prompting for Content Creation

Write an educational article about generative AI.

Follow these instructions:

1. Start with a clear introduction.
2. Explain the concept for beginners.
3. Use practical examples.
4. Include relevant headings.
5. Explain important terminology.
6. Add a short FAQ section.
7. Avoid unnecessary technical jargon.
8. End with a concise summary.

Instruction Order

Organizing instructions logically can make complex prompts easier to understand and maintain.

A practical sequence is:

Context → Task → Steps → Requirements → Constraints → Output

This structure is particularly useful for complex educational, technical, research, and business workflows.

Instruction Groups

Long prompts become easier to manage when related instructions are grouped together.

Task:
Create a lesson on Python functions.

Content:
- Definition
- Syntax
- Parameters
- Return values
- Examples

Teaching Requirements:
- Class XI level
- Beginner-friendly language
- Practical examples

Output:
- Headings
- Code blocks
- Practice questions
- Revision summary

Instruction Precision: "What" and "How"

A useful distinction is between instructions describing what should be done and instructions describing how the result should be presented.

Instruction Type Example
What Compare Python lists and tuples.
How Present the comparison in a five-column table.
What Analyze the examination results.
How Show the findings using percentages and tables.

Instruction Prompting and Output Control

Instructions can specify practical characteristics of the output, including length, organization, tone, number of examples, and formatting.

Explain SQL JOINs.

Instructions:
- Use approximately 500 words.
- Include four types of JOINs.
- Give one example for each.
- Use beginner-friendly language.
- Include a comparison table.
- End with three practice questions.

Instruction Prompting Does Not Guarantee Correctness

Clear instructions can improve task alignment, but they cannot guarantee that every generated statement is factually or technically correct.

Remember:

Instruction quality and factual accuracy are different concerns. A perfectly written instruction can still produce an incorrect answer if the AI lacks the necessary information or makes an error.

Instruction Prompting and Verification

For important tasks, instructions can explicitly ask the AI to identify uncertainty or distinguish known information from assumptions.

Analyze the following information.

Instructions:
1. Identify the main claims.
2. Distinguish factual statements from assumptions.
3. Identify information that may require verification.
4. Do not present uncertain information as established fact.
5. Clearly state any limitations in the analysis.

Common Instruction Prompting Mistakes

Mistake Problem Better Approach
Vague action AI has to infer what should be done. Use a clear action verb.
Too many unrelated instructions The task becomes difficult to follow. Group related instructions.
Contradictory requirements The AI receives conflicting objectives. Review instructions for consistency.
Missing output requirements The result may not be directly usable. Specify the desired format.
Overly restrictive instructions Useful information may be unnecessarily excluded. Restrict only what needs to be restricted.
No task sequence Multi-step workflows may be unclear. Number the steps when sequence matters.

Instruction Prompting vs Context Prompting

Context Prompting Instruction Prompting
Provides background information Provides directions
Explains the situation Explains the required action
Answers "What does AI need to know?" Answers "What should AI do?"
Example: Students are beginners. Example: Explain the topic using simple language.

Combining Role, Context, and Instructions

The techniques covered in Lessons 2.3, 2.4, and 2.5 can be combined into a single structured prompt.

ROLE:
Act as an experienced Class XI Computer Science teacher.

CONTEXT:
Students already understand Python variables,
conditions, loops, and lists.

INSTRUCTIONS:
1. Explain Python functions.
2. Begin with a simple definition.
3. Explain parameters and return values.
4. Provide three practical examples.
5. Include common mistakes.
6. Add five practice questions.
7. Use beginner-friendly language.
8. Present the final answer using headings and code blocks.

Practical Activity 1 — Convert Vague Instructions

Improve each of the following instructions.

Vague Instruction Your Improved Instruction
Explain Python. Write a specific instruction for beginners.
Make questions. Specify class, topic, quantity, and difficulty.
Analyze this data. Specify the analytical steps and expected findings.
Improve this code. Specify what aspects should be reviewed.

Practical Activity 2 — Create Sequential Instructions

Write instructions for an AI assistant to analyze a student examination dataset.

Your instructions should contain at least six sequential steps, beginning with data inspection and ending with a summary.

Practical Activity 3 — Create Conditional Instructions

Create a prompt that asks AI to evaluate student answers.

Include separate instructions for:

  • Correct answers
  • Partially correct answers
  • Incorrect answers
  • Unanswered questions

Practical Activity 4 — Build a Complete Instruction Prompt

Create a prompt for generating a lesson on Python exception handling.

Include:

  • Role
  • Context
  • Task
  • Sequential instructions
  • Requirements
  • Constraints
  • Output format

Interview Questions

Q1. What is instruction prompting?

Instruction prompting is the practice of giving AI clear and specific directions about what it should do and what requirements it should follow.

Q2. What is the difference between context and instruction?

Context provides background information, while an instruction tells the AI what action it should perform.

Q3. Why are action verbs useful?

Action verbs clearly communicate the intended operation, such as explain, analyze, compare, summarize, generate, or evaluate.

Q4. Why use numbered instructions?

Numbered instructions can make multi-step tasks clearer and help communicate the intended sequence.

Q5. What are conditional instructions?

Conditional instructions tell AI what to do when specific conditions or characteristics of the input are present.

Q6. Should prompts contain only positive instructions?

No. Negative instructions can also be useful when there is something specific the AI should avoid. They should be clear and consistent with the desired outcome.

Q7. Can clear instructions guarantee correct answers?

No. Clear instructions can improve task alignment but do not guarantee factual or technical accuracy.

Examination MCQs

Q1. What is instruction prompting?

  1. Giving AI clear directions for performing a task
  2. Installing an AI model
  3. Changing computer hardware
  4. Creating a database

Answer: A

Q2. Which is a clear instruction?

  1. Python
  2. Tell me something
  3. Compare Python lists and tuples in a table.
  4. Help

Answer: C

Q3. Which type of word is commonly useful at the beginning of an instruction?

  1. Action verb
  2. Random number
  3. File extension
  4. Computer brand

Answer: A

Q4. What is the benefit of numbered instructions?

  1. They can clarify multi-step tasks.
  2. They increase internet speed.
  3. They install software.
  4. They increase storage.

Answer: A

Q5. What is a conditional instruction?

  1. An instruction that applies when a specified condition is met
  2. A computer command
  3. A database query
  4. A hardware instruction

Answer: A

Q6. Which is an example of a negative instruction?

  1. Use simple language.
  2. Include three examples.
  3. Do not use unnecessary technical jargon.
  4. Create a table.

Answer: C

Q7. What should be avoided in a complex prompt?

  1. Clear requirements
  2. Relevant context
  3. Contradictory instructions
  4. Output specifications

Answer: C

Q8. Which instruction is more precise?

  1. Make questions.
  2. Create 15 Class X questions on HTML tables.
  3. Questions please.
  4. Give me something to study.

Answer: B

Q9. Can instruction prompting guarantee factual accuracy?

  1. Yes
  2. No
  3. Only for coding
  4. Only for mathematics

Answer: B

Q10. Which sequence is useful for a complex prompt?

  1. Output → Context → Task
  2. Context → Task → Steps → Requirements → Constraints → Output
  3. Random information → Output
  4. Task → Nothing else

Answer: B

Key Terms

Term Meaning
Instruction Prompting Giving AI clear directions about what it should do.
Action Verb A word that clearly identifies an operation such as explain, analyze, compare, or create.
Sequential Instruction Instructions arranged in a specific order.
Conditional Instruction An instruction that applies when a specified condition is met.
Constraint A boundary or restriction placed on a task or output.
Output Format The requested structure in which the result should be presented.
Task Alignment The degree to which the AI response matches the requested objective and requirements.

Self-Assessment Checklist

  • ☐ Define instruction prompting.
  • ☐ Distinguish instructions from context.
  • ☐ Use clear action verbs.
  • ☐ Write specific instructions.
  • ☐ Create sequential instructions.
  • ☐ Create conditional instructions.
  • ☐ Use positive and negative instructions appropriately.
  • ☐ Identify contradictory instructions.
  • ☐ Organize instructions into logical groups.
  • ☐ Specify output requirements.
  • ☐ Create educational instruction prompts.
  • ☐ Create coding, research, and business instruction prompts.
  • ☐ Combine role, context, and instructions.

Key Takeaway

Instruction prompting tells AI precisely what action to perform and what requirements to follow. Clear action verbs, sequential steps, conditional instructions, constraints, and output requirements can make complex tasks easier to communicate.

Clear Action + Requirements + Constraints + Output = Precise Instruction

The best instruction is not necessarily the longest one. It is the one that communicates the intended task clearly, consistently, and without unnecessary ambiguity.