Problem decomposition divides a complex task into smaller, manageable steps. It turns an unclear goal into focused questions that can be handled through one prompt or a sequence of prompts. section 9.5.1
A practical decomposition workflow:
- Break the task into a logical sequence of subtasks. section 9.5.1
- Design a focused prompt for each subtask, encouraging explanation and attention to best practices. section 9.5.1
- Evaluate each response and continue narrowing the problem through follow-up questions. section 9.5.1
Decomposing an API request
For the goal of sending an HTTP GET request with Python’s requests library, separate the work into initializing the request, displaying the response body, and handling network errors or non-200 responses. Ask a focused prompt about each part, then review the results before moving on. section 9.5.1
Figure 9.6 A chain-of-thought prompt gets the model to reason out a problem like a human would. You break down the problem and experiment with answers until you get the results you desire.
Use the figure to visualize decomposition as an experiment: split the problem, try focused prompts, and refine the answers. section 9.5.1









