LLM Selection by Tier: Let Rework Costs Decide Your Compute Budget
Choosing the right large language model isn't about comparing per-token prices. This article breaks total cost into direct billing, rework, and human review, then introduces a three-tier task classification based on failure cost, three metrics for deciding when to upgrade models, a constraint-based prompt template, and a small-scale A/B testing method to validate your selection. Includes Python code for cost modeling and evaluation.
LLM Selection by Tier: Let Rework Costs Decide Your Compute Budget
1. A Low Unit Price Doesn’t Mean a Low Total Cost
Model services typically charge by input and output token counts and publish a per-million-token price. It’s easy to compare only those prices, but real spending consists of three parts:
- Direct billing: unit price multiplied by token usage.
- Rework cost: when the model’s first output fails, the cost of re-invoking it, re-reading context, and the associated waiting time.
- Verification and correction cost: time spent on human review, fixing files, and re-running tests.
The third part is often the largest. A call that looks cheap can end up costing more than the entire task’s direct fee if it modifies the wrong file or skips a test run.
The following function unifies the three parts into an expected cost, making it easier to compare models:
def expected_cost(unit_price, tokens, retry_rate, avg_retry_tokens, review_minutes, minute_cost):"""unit_price: price per tokentokens: average token usage per taskretry_rate: probability a retry is needed, between 0 and 1avg_retry_tokens: average tokens consumed per retryreview_minutes: average minutes spent on human review and correctionminute_cost: labor cost per minute"""first_pass = unit_price * tokensretry = retry_rate * unit_price * avg_retry_tokensreview = review_minutes * minute_costreturn first_pass + retry + review
The key term in this formula is review. A model priced twice as high as another may still have a lower total cost if its first-pass rate is high and human correction time is short. Conversely, a cheap model that frequently requires rework can be more expensive on complex tasks.
Note that these parameters should come from your own team’s actual records rather than borrowed experience numbers.
2. Classify Tasks into Three Tiers by Failure Cost
The first step in selection is grading your tasks. The criterion is not how difficult a task looks, but how much a failure costs.
| Tier | Typical Tasks | Failure Cost | Recommended Strategy |
|---|---|---|---|
| Tier 1 | Code completion, doc polishing, meeting notes cleanup | Low — errors are easy to spot by eye | Use an economy model, process in batches |
| Tier 2 | Writing unit tests for a module, small logic changes, summarizing reference material | Medium — errors surface only when tests run | Economy model primarily, with automated verification |
| Tier 3 | Cross-service debugging, changes involving database transactions, designs spanning multiple systems | High — errors may cause data inconsistency or production incidents | Prefer a high-capability model, with strict acceptance checks |
After grading, define explicit escalation conditions for each tier. For example, a Tier 1 task that fails twice in a row moves automatically into the Tier 2 workflow; a Tier 2 task that involves data writes is escalated directly to Tier 3.
3. Three Metrics for Deciding Whether to Upgrade
Upgrading to a more capable model should be backed by data. Track these three metrics over time:
First-pass rate. The proportion of tasks where the model’s first output meets acceptance criteria. It directly determines how often rework happens.
Average rework rounds. The average number of interaction rounds per task from request to completion. Excessive rounds usually indicate unclear requirements or that the model misunderstands the context.
Miss rate. The proportion of completed tasks that later need remediation because the model missed something. Common cases include missing a caller that needed updating, skipping regression tests, or modifying files that shouldn’t have been touched.
If, within a given tier, the high-capability model shows a clearly higher first-pass rate and a clearly lower miss rate, the extra cost is usually justified. If the three metrics show little difference, upgrading only adds expense.
4. Use Constraint-Based Prompts to Reduce Risk on Complex Tasks
No matter how capable a model is, vague prompts lead to deviations. Especially when a model tends to confirm intent first, your prompt should proactively state assumptions, boundaries, and acceptance criteria to reduce back-and-forth clarification.
Below is a prompt template suited to Tier 2 and Tier 3 tasks, adjustable per project:
Task goal: <describe the problem to solve in one or two sentences>Context:- Modules involved: <list module names and paths>- Known symptoms: <error messages, reproduction steps, or log excerpts>Scope of changes:- Allowed to modify: <list files or directories that may be changed>- Forbidden to modify: <list files, configs, and database tables that must not be changed>Acceptance criteria:1. All relevant unit tests pass; include the test command and an output summary2. API response structures match the existing documentation3. No files in the forbidden list were modifiedExecution requirements:- First output your analysis and change plan, then wait for confirmation before coding- If information is insufficient, list your assumptions and open questions- Explain the reason for every change
This template serves three purposes. First, it limits scope, reducing the risk of unintended changes. Second, it turns acceptance into executable check items that humans can verify quickly. Third, it requires a plan up front, so wrong judgments surface before any code is written — when fixing them is cheapest.
Also note that asking for “brevity” doesn’t guarantee the result you want. Instead of writing “keep the answer concise,” specify the output structure, e.g., “state the conclusion first, then list three supporting points, and end with a list of modified files.”
5. Distinguish Model Capability from System Configuration
The same model name can behave very differently under different system configurations. Common factors include:
- Whether tools like search, code execution, and file read/write are connected
- Which files are placed in the context window and how they are selected
- Whether multi-agent collaboration is enabled, e.g., planning, coding, and review handled by separate roles
- System prompts and sampling parameters such as temperature
During evaluation, record the “model” and the “system” separately. If you log only the model name, you can’t reproduce results later, nor can you tell whether improvements came from the model itself or from toolchain adjustments.
Multi-agent setups add value on complex tasks: role separation reduces the load on a single context, and a reviewer role can catch what the coder role misses. But they increase token consumption and latency, so reserve them for Tier 3 tasks and account for them separately in your cost model.
6. Validate Your Selection with Small-Scale Comparative Testing
Selection conclusions shouldn’t rest on documentation or other people’s experience. Run a small comparative test using your own historical tasks.
Steps:
- Draw 20 to 50 tasks from historical tickets, with tier proportions roughly matching your actual workload.
- Fix the prompt template, tool configuration, and evaluation criteria.
- Run each task with each candidate model, recording first-pass results, rework rounds, elapsed time, token usage, and human correction time.
- Compute the average cost per passed task using the formula, and compare results by tier.
The skeleton of an evaluation script could look like this:
import statisticsdef evaluate(model_name, tasks, run_task, check_result):records = []for task in tasks:output, usage = run_task(model_name, task)passed, rounds, review_minutes = check_result(task, output)records.append({"task_id": task["id"],"level": task["level"],"passed": passed,"rounds": rounds,"tokens": usage["total_tokens"],"review_minutes": review_minutes,})return summarize(records)def summarize(records):by_level = {}for r in records:by_level.setdefault(r["level"], []).append(r)report = {}for level, items in by_level.items():report[level] = {"pass_rate": sum(i["passed"] for i in items) / len(items),"avg_rounds": statistics.mean(i["rounds"] for i in items),"avg_tokens": statistics.mean(i["tokens"] for i in items),"avg_review_minutes": statistics.mean(i["review_minutes"] for i in items),}return report
After the test, focus not on individual task results but on the per-tier averages. If one model’s miss rate on Tier 3 tasks is clearly lower than another’s while Tier 1 results are similar, a sensible strategy is to use the economy model for Tier 1 and the high-capability model for Tier 3.
7. Practical Recommendations
First, by default route Tier 1 and Tier 2 tasks to economy models, and upgrade Tier 3 tasks as needed — with explicit escalation conditions.
Second, put the prompt template, acceptance checklist, and escalation rules into your team’s standards so no one has to figure it out alone.
Third, rerun the comparative test after every model version update or terms-of-service change. Prices, quotas, and features can all change; old conclusions shouldn’t be trusted indefinitely.
Fourth, treat the provider’s official documentation as the source of truth for pricing, and note the query date and billing details in your team records — including context-length tiers, caching charges, and tool-call fees.
Fifth, include human correction time in cost accounting. Many teams track only token spend and ignore the hidden costs of rework and review, which naturally biases conclusions toward cheaper models. Once this is included, selection results usually align much better with reality.
In short, the core of model selection is comparing total cost, not unit price. Tier tasks by failure cost, measure performance with verifiable metrics, and confirm conclusions with small-scale tests — that’s how you find a reasonable balance between budget and quality.
