---
title: "What is a task decomposition optimization?"
answer: "A task decomposition optimization is an automated recommendation from Coolhand that suggests restructuring an LLM prompt template into smaller, more efficient stages. These proposals recommend splitting multi-purpose prompts into discrete steps, switching simpler subtasks to smaller models, or handling deterministic logic in application code rather than burning model tokens."
category: "Feedback \u0026 prompts"
tags: ["optimizations","prompt-engineering","workloads","cost-reduction"]
published: 2026-11-27T01:07:24Z
updated: 2026-11-17T17:01:22Z
canonical_url: https://coolhandlabs.com/help/what-is-a-task-decomposition-optimization
index_url: https://coolhandlabs.com/help.md
---

# What is a task decomposition optimization?

A task decomposition optimization is an automated recommendation from Coolhand that suggests restructuring an LLM prompt template into smaller, more efficient stages. These proposals recommend splitting multi-purpose prompts into discrete steps, switching simpler subtasks to smaller models, or handling deterministic logic in application code rather than burning model tokens.

A task decomposition optimization is an automated recommendation generated by Coolhand to help you restructure complex LLM workflows into modular, cost-effective stages. Instead of routing an entire task through a single monolithic prompt on an expensive frontier model, task decomposition identifies opportunities to treat your AI workflows as composable functions with bounded scopes.

These optimizations appear in your Coolhand dashboard and via the API with the category `task_decomposition`.

## The three decomposition strategies

When Coolhand analyzes your active prompt templates and workloads, it evaluates your prompt structure, token volume, model choices, and quality metrics against three optimization strategies:

### 1. Splitting complex prompts into specialized steps
Monolithic prompts often ask a single model call to interpret instructions, extract structured data, reason through constraints, and format the final response. Splitting a sprawling prompt into discrete stages allows each step to perform one narrow, well-defined task:
* **Chained stages:** An extraction step can parse raw unstructured inputs into clean JSON, followed by a generation step that crafts the user-facing response using the extracted fields.
* **Specialized decision steps:** Classification, intent detection, or routing choices can be separated from generative tasks, sending fast categorical decisions to dedicated decision models (see [LLMs vs. System One models](https://coolhandlabs.com/help/llms-vs-system-one-models.md)).
* **Improved reliability:** Narrower prompts reduce hallucination and allow you to evaluate and debug each stage independently.

### 2. Right-sizing models for subtasks
Not every step in an AI pipeline requires the reasoning capacity of a flagship frontier model. When a prompt performs simpler subtasks alongside heavy reasoning, Coolhand identifies opportunities to route simpler components to smaller, faster, and less expensive models:
* Reserving premier models for creative generation, complex synthesis, or ambiguous reasoning.
* Shifting classification, data translation, schema conformity, or summarization to lightweight models.
* Preserving overall response quality while reducing token costs and end-to-end latency.

### 3. Offloading deterministic operations to application code
LLMs are frequently tasked with operations that standard application logic can perform faster, cheaper, and with guaranteed consistency:
* **Deterministic transformations:** String formatting, date parsing, regex validation, mathematical calculations, and schema enforcement should happen in your application code rather than inside an LLM prompt.
* **Input trimming:** Removing repetitive boilerplate, irrelevant metadata, or redundant conversation history before submitting inputs to the model.
* **Caching and conditional skipping:** Skipping model calls entirely when input payloads have not changed between requests.

## How Coolhand generates decomposition suggestions

Coolhand periodically scans your active prompt templates across your workloads (see [What is a workload?](https://coolhandlabs.com/help/what-is-a-workload.md)). The analysis inspects prompt structure, recent traffic patterns, token percentiles, error rates, and quality feedback:

* **Production evidence:** Each suggestion references real production request logs from your workload where the pattern was detected.
* **Modeled savings:** Coolhand calculates projected savings from the difference in token consumption, avoided calls, or cheaper target model pricing against your recent request volume.
* **Quality rubrics:** Recommendations are reviewed internally for separation feasibility, coherence, and honest cost estimates before reaching your dashboard.

To prevent suggestion fatigue and give your team time to evaluate architectural proposals, Coolhand prioritizes the highest-value opportunities and limits the number of decomposition proposals delivered in any given week.

## How to interpret a decomposition proposal

Because task decomposition involves architectural changes and application refactoring, Coolhand delivers these proposals as advisory suggestions rather than opening automated pull requests directly into your repository.

When reviewing a task decomposition proposal, examine the following details:

* **Analysis and thesis:** Coolhand explains the specific prompt pattern detected, the proposed restructuring strategy, and the recommended architecture.
* **Linked evidence:** Inspect the linked request logs to see the actual inputs, token distributions, and model responses that triggered the recommendation.
* **Projected savings and impact:** Review the estimated token reductions and cost savings based on your recent traffic volume.
* **Complexity and risks:** The proposal flags implementation considerations, such as managing multi-stage latency or handling intermediate failures in chained calls.

## Acting on a proposal

Once you review a task decomposition recommendation, you can take action directly from your dashboard or through your integration workflow:

1. **Implement the refactor:** Update your application code and prompt templates to reflect the new structure. If you split a prompt into multiple steps, declare each step as a distinct template within the same workload so Coolhand continues tracking aggregate metrics for the feature. Review general best practices in [Prompt engineering best practices](https://coolhandlabs.com/help/prompt-engineering-best-practices.md).
2. **Mark as completed:** Once your updated prompts and code changes are deployed, mark the optimization as completed in the Coolhand dashboard to record the resolution.
3. **Dismiss with feedback:** If a proposal is not feasible due to your domain constraints, system architecture, or latency requirements, dismiss the proposal. Provide a short explanation when dismissing; Coolhand incorporates your dismissal feedback to refine future recommendations for your account.

## Viewing decomposition optimizations via the API

You can list task decomposition proposals programmatically using the private API by filtering on the `task_decomposition` category:

```bash
curl -H "X-API-Key: $COOLHAND_PRIVATE_API_KEY" \
  "https://api.coolhandlabs.com/api/v2/optimizations?category=task_decomposition&status=proposed"
```

A successful response returns an array of matching optimizations:

```json
[
  {
    "id": "opt_9a8b7c6d",
    "title": "Split prompt: separate invoice data extraction from customer reply generation",
    "status": "proposed",
    "optimization_type": "suggestion",
    "category": "task_decomposition",
    "complexity": "medium_complexity",
    "impact": "high_impact",
    "client_name": "Acme Corp",
    "template_id": "tmpl_3f82kd9a",
    "template_name": "Invoice Assistant Handler",
    "workload_name": "Billing Support",
    "created_at": "2026-09-28T08:00:00Z"
  }
]
```

## Related

* [What is a workload?](https://coolhandlabs.com/help/what-is-a-workload.md)
* [Prompt engineering best practices](https://coolhandlabs.com/help/prompt-engineering-best-practices.md)
* [LLMs vs. System One models](https://coolhandlabs.com/help/llms-vs-system-one-models.md)

---

Related:
- [What do the Development, Maturing, Stable, and Dormant labels on a workload mean?](https://coolhandlabs.com/help/workload-maturity.md)
- [How do I list and search optimizations using the REST API?](https://coolhandlabs.com/help/list-and-search-optimizations-api.md)
- [What is a workload?](https://coolhandlabs.com/help/what-is-a-workload.md)
- [What does the Error Rate badge on a prompt template mean?](https://coolhandlabs.com/help/what-does-the-error-rate-badge-mean.md)

[← All help articles](https://coolhandlabs.com/help.md) · [Feedback & prompts](https://coolhandlabs.com/help/category/feedback-and-prompts.md)
