Techniques for mastering complex tasks with AI

Two powerful approaches are chain-of-thought prompting and prompt chaining.

Chain-of-thought prompting

Chain-of-thought prompting is a prompting technique that involves requesting an LLM to explain its reasoning process step-by-step, from input to final output. This technique essentially asks the AI to “show its work,” making its response more transparent and structured.

To use chain-of-thought prompting, simply include key phrases in your prompt, like:

  • “Explain your reasoning”

  • “Go step by step”

These additions indicate that the AI needs to trace its thought process, which often leads to more informative and accurate output.

Let’s go through an example when this technique can be useful:

Consider an HR manager who is developing onboarding materials for a specific department. Here’s how chain-of-thought prompting could be used to identify actionable steps to handle the task:

Prompt:

Create a bulleted list outlining the major duties and responsibilities of a new entry-level design hire at an ad agency. Explain your reasoning step by step.

Notice the additional instructions “explain your reasoning step by step”? You can try using this prompt with and without this phrase to see the difference in AI’s response.

By asking the AI to break down the logic and reasoning behind the duties it suggests, the information you get from the output will also have a rationale for why it was suggested. In this case, it may help the HR manager understand each identify potential gaps and make informed decisions about how to improve their current onboarding process.

Prompt chaining

While chain-of-thought prompting focuses on the reasoning within a single prompt, prompt chaining helps you tackle large projects by breaking them into a series of smaller, connected steps that are all in the same chat. It works like a factory assembly line: the output from one prompt is used as the input for the next, linking all your tasks together like a chain.

Recreated - Prompt Chaining Flow

This technique involves three key steps:

  1. Task analysis: Start by breaking down your complex task into a series of smaller, logical steps.

  2. Initial prompting: Craft a focused prompt that asks the AI to complete just the first step.

  3. Input/output flow: Use the output from the first prompt as the context for the second prompt. Continue this iterative flow until you complete the task.

Let’s take a look at an example of a prompt chain:

Consider that you are planning a short vacation to Paris. You want to make sure you create an itinerary of the things you love most in a vacation, while maximizing logistics to be as efficient as possible with your time:

Prompt 1: I’m going to [city name] for 3 days. I like art, historical sites, and parks. Suggest a few well-known places I could visit on my trip.

Prompt 2 (chained from Prompt 1): Using those locations, create a logical, day-by-day itinerary that minimizes travel time.

Prompt 3 (chained from Prompt 2): For each day of the itinerary, suggest a few restaurants located near each of the suggested locations.

By breaking the task into logical, digestible steps and using the output of one prompt as the specific input for the next, you transform the AI from a simple answer-generator into a structured collaborator.

You can combine prompt chaining with chain-of-thought prompting to enhance the quality and accuracy of the problem-solving process at any stage.