AI From Zero · Prompt Engineering

Step-by-Step Reasoning and Structured Tasks

Learn how to structure complex AI tasks into clear, manageable steps so that the requested work is easier to follow and evaluate.

Estimated learning time: 20 minutes

What You'll Learn

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

- Explain why complex AI tasks can benefit from a structured approach.
- Break a large task into smaller steps.
- Define a clear sequence of operations.
- Separate analysis from the final answer.
- Use intermediate outputs when useful.
- Structure multi-stage tasks clearly.
- Identify dependencies between steps.
- Give the AI clear instructions for each stage.
- Review intermediate results before continuing.
- Recognize when a simple task does not need a step-by-step structure.

Why Structure Matters

Some AI tasks are simple enough to complete with one instruction. Other tasks contain several related operations that need to happen in a particular order.

For example, asking an AI to analyze a business report, identify the main problems, recommend solutions, and prepare an executive summary involves several different activities.

Breaking the work into steps can make the task easier to understand and evaluate.

What Is a Structured Task?

A structured task is a task that has been divided into clearly defined stages or steps.

For example:

  1. Read the information.
  2. Identify the important findings.
  3. Group related findings.
  4. Evaluate their significance.
  5. Produce the final recommendations.

Each step has a specific purpose.

Start With the Final Goal

Before breaking a task into steps, identify the result you want.

For example:

Goal: Prepare a short management briefing about declining customer satisfaction.

Once the goal is clear, you can determine which steps are necessary to reach it.

Break Large Tasks Into Smaller Tasks

A large task can often be divided into smaller operations.

Instead of:

Analyze this customer data and tell me what we should do.

you could write:

  1. Identify the main customer complaints.
  2. Group similar complaints.
  3. Identify the most frequent problems.
  4. Explain the potential impact of those problems.
  5. Recommend actions to address them.

The second approach makes the workflow more explicit.

Sequence Matters

Some tasks have a natural order.

For example, you normally need to identify problems before recommending solutions.

A structured prompt can make this dependency clear:

  1. Identify the problems.
  2. Rank them by importance.
  3. Explain the likely impact.
  4. Recommend solutions for the highest-priority problems.

Dependencies Between Steps

A dependency exists when one step relies on the result of an earlier step.

For example:

Step 1: Identify the three largest sales declines.

Step 2: Analyze possible causes of those declines.

Step 2 depends on the results of Step 1.

Use Explicit Instructions

When a sequence matters, make the sequence explicit.

For example:

First identify the key issues. Then rank them by severity. Finally recommend one action for each of the top three issues.

This is clearer than simply asking the AI to analyze the issues and recommend actions.

Use Numbered Steps

Numbered instructions are particularly useful for multi-stage tasks.

  1. Extract the relevant information.
  2. Classify the information.
  3. Identify patterns.
  4. Summarize the findings.

Numbering makes the intended sequence easy to see.

Separate Analysis From the Final Output

A complex task may involve analysis before producing the final result.

You can structure the task by distinguishing the work from the final output.

For example:

First identify the three most important findings. Then provide a concise final summary containing only those findings.

This prevents the final response from becoming unnecessarily detailed.

Do Not Automatically Ask for Hidden Reasoning

When working with AI, you generally do not need to ask the system to reveal private internal reasoning.

Instead, ask for useful outputs such as:

  • Key factors considered.
  • Relevant evidence.
  • Assumptions.
  • Intermediate results.
  • Calculations.
  • A concise explanation of the conclusion.

The goal is to make the task structured and useful, not to require private chain-of-thought content.

Ask for Intermediate Results When Useful

Some tasks benefit from visible intermediate results.

For example:

  1. Extract all dates from the document.
  2. List the extracted dates.
  3. Identify the earliest and latest dates.
  4. Summarize the relevant time period.

The intermediate list makes it easier to check whether the extraction was successful.

Intermediate Results Are Not Always Necessary

Do not add intermediate steps merely to make a prompt look sophisticated.

For a simple task such as translating one sentence, several stages would add unnecessary complexity.

Structured Tasks for Data Analysis

Data analysis often benefits from explicit stages.

For example:

  1. Check the data for missing values.
  2. Calculate the required metrics.
  3. Identify significant changes.
  4. Compare the relevant groups.
  5. Summarize the findings.

This provides a clear workflow.

Structured Tasks for Document Analysis

Document analysis can also be divided into stages.

For example:

  1. Identify the document's main topic.
  2. Extract the important claims.
  3. Identify supporting evidence.
  4. Identify limitations or risks.
  5. Produce a concise summary.

Structured Tasks for Writing

Writing tasks can be structured as well.

For example:

  1. Identify the target audience.
  2. Determine the main message.
  3. Create an outline.
  4. Draft the content.
  5. Review it for clarity and accuracy.
  6. Produce the final version.

Structured Tasks for Research

A research task can be divided into stages such as:

  1. Define the research question.
  2. Identify the relevant information.
  3. Organize the findings.
  4. Compare the evidence.
  5. Identify uncertainties.
  6. Present the conclusion.

Structured Tasks for Decision Making

Decision-making prompts can also benefit from a defined process.

For example:

  1. List the available options.
  2. Define the evaluation criteria.
  3. Compare each option against the criteria.
  4. Identify the main trade-offs.
  5. Recommend the most suitable option.

Define the Output of Each Stage

For complex tasks, it can help to specify what each step should produce.

For example:

  1. Extract the customer complaints — return a list.
  2. Group similar complaints — return category names.
  3. Rank the categories — return them from highest to lowest frequency.
  4. Recommend actions — provide one action per category.

This makes the workflow easier to follow.

Keep Steps Distinct

Each step should have a clear purpose.

A weak structure might contain several unrelated actions in every step.

A stronger structure separates major operations so that the result of each stage is understandable.

Avoid Unnecessary Steps

More steps do not automatically produce a better result.

If two actions can be completed naturally together, they may not need to be separated.

The objective is useful structure, not maximum complexity.

Use Conditions When Necessary

Some workflows depend on what happens in an earlier step.

For example:

If the report contains fewer than three significant risks, list all significant risks instead of inventing additional ones.

This gives the workflow a sensible condition.

Handle Missing Information

A structured task should specify what to do when required information is unavailable.

For example:

If the required information is missing, identify the missing information rather than guessing.

This can reduce unsupported assumptions.

Use Checkpoints

A checkpoint is a point where the result can be reviewed before continuing.

For example:

  1. Extract the relevant figures.
  2. Check that all required figures were found.
  3. Calculate the changes.
  4. Interpret the results.

The second step acts as a checkpoint.

Structured Prompts Can Improve Evaluation

When a task has clear stages, it is easier to determine where a problem occurred.

If the final recommendation is incorrect, you can examine whether the problem came from data extraction, classification, calculation, or interpretation.

Separate Facts From Interpretation

For analysis tasks, it can be useful to separate what the source says from what the AI concludes.

For example:

  1. Extract the relevant facts.
  2. Summarize the evidence.
  3. Interpret what the evidence may mean.
  4. Provide recommendations.

This creates a clearer distinction between evidence and interpretation.

Use Constraints With Structured Tasks

Structured tasks can be combined with constraints.

For example:

  1. Identify the five largest customer complaints.
  2. Group similar complaints.
  3. Recommend one action for each group.

Constraint: Use only information from the supplied customer data.

This combines sequence with a data boundary.

Use Output Format With Structured Tasks

You can also specify how the final result should be presented.

For example:

Complete the analysis in four stages. Present the final findings in a table with columns for issue, evidence, impact, and recommendation.

Use Examples With Structured Tasks

Examples can demonstrate how the result of a multi-stage task should look.

This is particularly useful when the workflow produces a specific structure.

A Complete Example

Consider this prompt:

Analyze the attached customer feedback. First identify the main complaints. Second group similar complaints. Third rank the groups by frequency. Finally recommend one practical action for each of the three most frequent groups. Use only the information in the feedback. Present the final result as a table with columns for complaint group, frequency, evidence, and recommended action.

This prompt combines a goal, sequence, constraint, and output format.

Another Example: Business Analysis

Review the quarterly sales report. First identify regions with declining sales. Next calculate the percentage decline for each affected region. Then rank the regions from largest to smallest decline. Finally summarize the three most significant concerns for management.

The stages create a logical progression from data identification to final interpretation.

Another Example: Learning

Help me learn a new topic. First give me a simple explanation. Then provide three examples. Next ask me five questions to test my understanding. Finally explain any answers I get wrong.

This creates a learning workflow rather than a single response.

Another Example: Writing

Help me prepare a business presentation. First identify the main message. Then create a five-section outline. Next suggest the key point for each section. Finally produce a concise presentation outline using headings and bullet points.

Each stage builds on the previous one.

Review the Structure

Before using a structured prompt, ask:

  • Is the final goal clear?
  • Are the steps necessary?
  • Is the order logical?
  • Does each step have a clear purpose?
  • Are dependencies clear?
  • Are important boundaries stated?
  • Is the final output format clear?

Refine the Workflow

If the result is poor, determine which stage needs improvement.

You might need to:

  • Clarify a step.
  • Change the order.
  • Add a missing stage.
  • Remove an unnecessary stage.
  • Add a checkpoint.
  • Define how missing information should be handled.
  • Clarify the final output.

Simple vs Complex Tasks

Use the simplest structure that reliably accomplishes the task.

Simple task: Translate this sentence into French.

Complex task: Analyze customer data, identify patterns, rank problems, and recommend actions.

The second task benefits much more from explicit structure.

Structure Is a Tool, Not a Rule

Step-by-step prompting is not required for every AI interaction.

Use it when the task has multiple stages, dependencies, checks, or decisions.

For straightforward requests, a concise prompt is usually better.

What You Should Remember

  • Complex tasks can often be made clearer by dividing them into steps.
  • Steps should have clear purposes and a logical order.
  • Dependencies between steps should be explicit when they matter.
  • Intermediate results and checkpoints can help with complex workflows.
  • Structured tasks can be combined with constraints and output formats.
  • Missing information should be handled explicitly rather than guessed.
  • More steps do not automatically mean a better prompt.
  • Simple tasks usually do not need elaborate structures.
  • The goal is useful structure, not unnecessary complexity.

What Comes Next?

The next lesson will focus on asking AI to analyze and compare, building on the structured-task techniques introduced here.

Key Takeaways

  • Break complex tasks into logical stages.
  • Make dependencies between steps clear.
  • Use intermediate results when they provide value.
  • Add checkpoints when verification is important.
  • Combine structured steps with constraints and output requirements.
  • Do not over-engineer simple tasks.

Try It Yourself

Turn a complex request into a structured workflow.

Start with:

Analyze these customer complaints and tell me what we should do.

Rewrite it as a multi-step prompt.

Your prompt should:

  • Define the overall goal.
  • Contain at least four logical steps.
  • Specify what should happen if information is missing.
  • Include one useful constraint.
  • Specify the final output format.

Compare the response from the original prompt with the response from your structured version.

Test Your Knowledge

You've reached the end of this lesson.

Test what you've learned with the Step-by-Step Reasoning and Structured Tasks - Quiz.

Take the Quiz
← Few-Shot Prompting and Examples
Asking AI to Analyze and Compare →
Back to Course