Course contentsShow
← AI Engineering
Lesson 173 of 1,8865. Advanced Prompting TechniquesFree lesson

Least-to-Most Prompting

Decomposing complex problems into simpler sub-problems solved sequentially, building toward the final solution.

Least-to-Most Prompting

What you'll learn: How to break down complex problems into simpler sub-problems that are solved sequentially, with each solution building toward the final answer.


The Core Idea

Least-to-Most Prompting is an advanced technique where you guide the LLM to solve a hard problem by first tackling the easiest parts, then using those solutions to solve progressively harder parts. Unlike Chain-of-Thought (which shows all reasoning at once), Least-to-Most explicitly decomposes the problem into ordered sub-tasks.

Think of it like building with LEGO: you don't start with the completed castle. You first build the foundation blocks, then the walls, then the towers—each step relies on the previous one.

How It Works

  1. Decomposition prompt: Ask the LLM to break the problem into smaller, ordered steps
  2. Sequential solving: Solve the simplest sub-problem first
  3. Context building: Feed the first solution into the prompt for the next sub-problem
  4. Repeat: Continue until you've solved all sub-problems and reached the final answer

Example Flow

For a complex question like "How many unique programming languages were used to build the top 3 web browsers in 2020?":

Step 1 (Decomposition): "What are the sub-questions we need to answer?"

  • What were the top 3 web browsers in 2020?
  • What languages does each use?
  • How many unique languages total?

Step 2-4: Solve each question in order, feeding previous answers forward.

When to Use It

Least-to-Most shines for problems that have natural dependency chains—where answering question B requires knowing answer A. It's especially powerful for multi-step reasoning, planning tasks, and problems requiring background information lookup.

Key Takeaway: Least-to-Most Prompting breaks complex problems into ordered sub-problems, solving from simplest to hardest while building context sequentially—ideal for tasks with clear dependencies.