# Source: https://docs.helicone.ai/guides/prompt-engineering/use-least-to-most-prompting.md

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.helicone.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Least-to-Most prompting

> Break down complex problems into smaller parts, starting with the least amount of information.

## What is Least-to-Most (LtM) prompting

Least-to-Most (LtM) prompting is a method that breaks down problems into simpler subproblems and solves them sequentially. This approach differs from [Chain-of-Thought prompting](use-chain-of-thought-prompting), where each step is independent, as LtM utilizes the output of previous subproblems as input for the next.

Notably, LtM has demonstrated significantly higher accuracy than standard and Chain-of-Thought approaches in various tasks.

## How to implement Least-to-Most prompting

1. Break down the complex task into smaller, simpler parts and identify the key steps needed to solve it.
2. Create a series of prompts that break down the problem into smaller, connected tasks.
3. Guide the AI through each task in order, using previous answers to help with the next step.
4. Check that each task's output is accurate and makes sense before moving on.
5. Combine all the task results into a complete solution that solves the original problem.

## Example

**Customer Inquiry:**

> I purchased a wireless noise-canceling headphone from your Premium Sound line last December during a holiday sale. The original price was 299, and I got them for 199. I noticed you're now offering a trade-in program where you give full credit for old headphones towards a new pair. My current headphones have a small scratch on the right ear cup. I'm wondering if I can trade these in and get the newest model, which is priced at \$349.

**Instructions:**

> You are a customer service agent. Trade-in program offers 50% credit for headphones in good condition with minor wear. Trade-in credit cannot exceed 80% of the original product price. The current date is March 29th. Headphone models are typically valid for trade-in up to 18 months from purchase date. **What subproblems must be solved before answering the inquiry?**

**Output:**

> 1. Determine if the customer is within the 18-month trade-in window.
> 2. Calculate the amount of store credit the customer would receive if they trade in their headphones.
> 3. Determine if the customer's trade-in credit exceeds 80% of the cost of the original product.

**Now, let's solve the first subproblem:**

> Determine if the customer is within the 18-month trade-in window.

**Output:**

> Yes, the customer is within the 18-month trade-in window. The customer purchased the headphones on December 1st, and today's date is March 29th, which is within the 18-month trade-in window.

If the model doesn't provide the final answer right away, we can continue to solve the next subproblem. In some cases, solving just the first subproblem may give us enough information to address the customer's inquiry.

## Why use Least-to-Most prompting

* Reduces errors by breaking down complex tasks into smaller parts
* Provides clear, step-by-step explanations of the reasoning process
* Makes difficult tasks easier to understand
* Works well across a variety of problems

## Tips for effective Least-to-Most prompting

* Make sure the logic flows between subtasks, and gradually increase complexity.
* Make sure your instruction for each subtask is clear.
* Decide how granular to break down the problem based on the AI's capabilities and your problem complexity.
* Regularly verify the output of each subtask for accuracy.
* Find the right balance between too many and too few steps.

***

<Accordion title="Need more help?">
  Additional questions or feedback? Reach out to
  [help@helicone.ai](mailto:help@helicone.ai) or [schedule a
  call](https://cal.com/team/helicone/helicone-discovery) with us.
</Accordion>