tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Generative AI > Prompt Engineering > Prompt Decomposition - Breaking Complex Tasks into Sub-prompts

Prompt Decomposition - Breaking Complex Tasks into Sub-prompts

Author: Venkata Sudhakar

Prompt decomposition is the practice of breaking a large, complex task into a sequence of smaller, focused sub-prompts. At ShopMax India, generating a complete product launch report - covering market analysis, pricing recommendations, and a customer FAQ - in a single prompt often produces vague output. Decomposing it into three separate prompts, each with a clear scope, produces sharper, more accurate results.

The technique works by identifying natural boundaries in the task: information gathering, analysis, generation, and review. Each sub-prompt receives the output of the previous one as context. This creates a pipeline where each LLM call is simpler and easier to validate. It also allows different models to handle different stages - a cheaper model for extraction, a more capable model for synthesis.

The example below decomposes a ShopMax India product launch task into three stages: extract key specs from raw product data, generate a pricing recommendation, then write a customer FAQ. Each stage calls Claude separately and passes its output to the next.


It gives the following output,

Stage 1 - Key specs:
- 55-inch QLED panel with vivid colour and deep contrast
- 4K UHD 120Hz for smooth sports and gaming
- HDR10+ for cinema-grade picture quality
- Smart TV with Tizen OS and built-in Alexa voice control
- Wi-Fi 6 and 4x HDMI 2.1 ports for future-proof connectivity

Stage 2 - Pricing:
Recommended retail price: Rs 51999
Reasoning: Positioned Rs 3000 below the competitor to attract price-sensitive buyers
while maintaining a healthy Rs 9999 margin above cost price.

Stage 3 - FAQ:
Q: Does this TV support gaming consoles?
A: Yes, with 4x HDMI 2.1 ports and 120Hz refresh rate, it supports PS5 and Xbox Series X.

Q: Can I use voice commands?
A: Yes, Alexa is built in. Just say "Alexa, switch to Netflix" to control the TV hands-free.

Q: What is the warranty period?
A: Samsung provides a 2-year manufacturer warranty on this model.

In production at ShopMax India, store each stage's output in a dictionary keyed by stage name so you can retry individual stages without re-running the full pipeline. Add a validation step between stages - if the specs extraction returns fewer than 3 bullet points, flag it for human review before proceeding to pricing. For batch processing a new product catalog, run Stage 1 across all products first, then Stage 2, to maximize prompt cache hits on the system prompt.


 
  


  
bl  br