
Answer-first summary for fast verification
Answer: Prompt chaining
## Detailed Explanation Based on the question's description of breaking a complex task into smaller subtasks that are processed sequentially by an LLM, the correct technique is **Prompt Chaining**. ### Why Prompt Chaining (Option B) is Correct: **Prompt Chaining** is specifically designed to decompose complex problems into manageable steps that are executed in sequence. In this approach: 1. The overall task is divided into logical subtasks or steps 2. Each subtask is formulated as a separate prompt for the LLM 3. The output from one step becomes the input for the next step 4. This creates a chain of prompts where results flow sequentially through the process This technique is particularly valuable for tasks that require: - Multi-step reasoning - Intermediate validation or transformation - Building upon previous results - Maintaining context across related operations ### Analysis of Other Options: **A: One-shot prompting** - This involves providing a single example along with the prompt to guide the LLM's response. It doesn't inherently involve breaking tasks into sequential subtasks. **C: Tree of thoughts** - This technique explores multiple reasoning paths simultaneously, creating a tree-like structure of possibilities. It's more about parallel exploration rather than sequential processing of subtasks. **D: Retrieval Augmented Generation (RAG)** - This approach enhances LLM responses by retrieving relevant information from external knowledge sources. While it can be part of a larger workflow, it's not specifically about breaking tasks into sequential subtasks. ### Key Distinction: The defining characteristic of prompt chaining is the **sequential dependency** between steps, where each subsequent prompt depends on the output of the previous one. This makes it ideal for complex tasks that naturally decompose into ordered steps, such as multi-stage analysis, step-by-step problem solving, or progressive refinement of outputs. In AWS AI/ML practice, prompt chaining aligns with best practices for managing complex LLM workflows, allowing for better error handling, intermediate validation, and more controlled processing of sophisticated tasks.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.