LLM Engineering: Balancing Cost-Effectiveness and Hard Problems
This article examines how LLM engineering teams can balance cost-effectiveness with work on extremely hard problems rather than treating the two as mutually exclusive. It proposes a governed portfolio approach built on task tiering, planning-execution-verification routing, expected total cost measurement, tiered evaluation gates, and separate budgets for exploratory work. Readers get a practical framework for controlling costs while preserving the ability to tackle complex, long-chain tasks and turn them into reusable engineering assets.
A common debate in LLM deployment is whether to prioritize cost-effectiveness per unit cost or to concentrate resources on extremely hard problems and do things that have never been done before. On the surface, these goals conflict. In practice, they map to different task tiers and organizational stages. The more reasonable engineering approach is not to choose one side but to build a governed portfolio system: high-frequency, highly deterministic business nodes use lightweight models to control cost; complex reasoning and long-chain tasks are planned and reviewed by strong models; exploratory projects receive separate budgets and gates, and their value is measured by reusable assets. This article presents a neutral technical practice framework around task tiering, routing and orchestration, cost measurement, evaluation gates, and work on hard problems.
1. First, Separate the Problems: Cost-Effectiveness and Hard Problems Use Different Rulers
“Cost-effectiveness” usually focuses on the ratio between cost per task, end-to-end latency, and stable pass rate. It suits high-frequency, batchable business nodes where failures can be rolled back. Examples include information extraction, format conversion, short-text classification, template-based question answering, and initial triage for log attribution. For these tasks, the input distribution is relatively stable and the cost of errors is controllable. Lightweight models plus rule-based validation are often enough to achieve acceptable results.
“Solving extremely hard problems” focuses on whether the system can complete long-chain reasoning, multi-tool collaboration, complex constraint satisfaction, and decision-making in open environments. Its core metric is not cheap per-call cost but task success rate, constraint satisfaction rate, verifiability, and capability accumulation. Such tasks often require a strong model to plan, call external tools, generate intermediate checkpoints, and rely on verifiers or expert feedback as a fallback.
Therefore, an organization should first divide tasks into three categories: high-frequency deterministic tasks, complex but decomposable tasks, and exploratory extremely hard tasks. The three categories should use different budgets, evaluation metrics, and release gates. If exploratory tasks are directly included in production cost-effectiveness reviews, teams tend to do only short, fast, small work. Conversely, routing all high-frequency tasks to strong models causes unnecessary cost and latency waste.
2. Tiered Routing: Replace Single-Model Stacking with Plan-Execute-Verify
The key to multi-model composition is not simply assigning requests randomly to different models, but dividing work by task stage. A practical pattern is “plan-execute-verify”:
- Planning stage: A strong model understands the task, decomposes steps, identifies risk points, and outputs an executable plan or intermediate representation.
- Execution stage: Lightweight models complete deterministic steps in the plan, such as extraction, rewriting, formatting, and candidate generation. When necessary, general tools are called for computation, retrieval, or validation.
- Verification stage: A strong model or rule-based verifier checks whether constraints are satisfied. If verification fails, the system falls back to a stronger configuration or human review.
An illustrative pseudocode example is below:
def handle(task, budget):kind = classify(task)if kind in {"extraction", "formatting", "short_qa"}:return run(light_model, task, max_budget=budget.low)if kind == "complex_decomposable":plan = run(strong_model, task, mode="plan")draft = run(light_model, task, plan=plan)checked = verify(draft, rules=task.constraints)if checked.passed:return checked.outputreturn run(strong_model, task, plan=plan, draft=draft)if kind == "exploratory":return run(strong_model, task, budget=budget.exploration,enable_tools=True, enable_verifier=True)
The value of this pattern is that strong models are used only at nodes that require the most judgment, while lightweight models handle nodes that can be executed at scale. It is important to evaluate the routing classifier itself. A misclassification can mean that tasks which should use a strong model do not, while tasks which should save cost do not. In practice, rules and small models can be used for initial screening, followed by sampled human review to calibrate routing accuracy.
3. Cost, Quality, and Latency: Look Beyond Unit Price to Expected Total Cost
When evaluating a solution, the unit price per call is only the tip of the iceberg. A more reasonable metric is “expected total cost per task”:
Expected total cost = sum over stages (call probability × unit price × usage) + fallback cost + verification cost + human review cost + failed retry cost
At the same time, measure pass rates by tier: simple-task pass rate, complex-task pass rate, constraint satisfaction rate, fallback rate, and human intervention rate. Looking only at overall pass rate hides long-tail failures. In one exploratory record with 150 samples, a low-cost tiered approach reduced per-call cost to about 40% of an all-strong-model approach, but complex constraint pass rate decreased. Step-based routing fell in between. Such data can only serve as a methodological hint; it cannot replace formal evaluation, let alone serve as a performance promise.
In addition, a record of a single complete run (n=1) is suitable as gate material and a retrospective on pitfalls, not for directly deriving production conclusions. Production decisions require at least a fixed evaluation set, multiple repetitions, confidence intervals, failure-sample attribution, and tiered results under different input distributions. Cases such as protocol blocking or failed local small-model trial runs should be retained as gate and pitfall material rather than mixed into the main evaluation table.
4. Evaluation and Gates: Give Hard Problems Phased Acceptance Criteria
Hard problems cannot be proven by a single successful run. A four-level gate system is recommended:
- Capability gate: Whether the required tool calling, long-context management, and constraint verification capabilities are present.
- Quality gate: Whether tiered pass rates and constraint satisfaction rates on a fixed evaluation set meet targets.
- Cost gate: Whether expected cost per task, fallback rate, and human intervention rate are within budget.
- Operability gate: Whether logging, tracing, failure-sample collection, and canary rollback are complete.
Exploratory projects should have independent budgets and be evaluated on reusable assets rather than short-term unit cost: whether the evaluation set expands, whether verifiers are reusable, whether a failure-mode library is accumulated, and whether the toolchain is stable. This allows teams to tackle extremely hard problems while preventing exploratory projects from failing to convert into engineering capability over time.
5. Hosting and Governance: General Cloud Capabilities Serve the Routing and Evaluation System
At the hosting layer, general-purpose categories such as containers, object storage, logging, and monitoring offered by Baidu AI Cloud can be used, but selection should serve the routing and evaluation system described above, not force the architecture to accommodate a single model. For engineering governance, it is recommended to set budget tiers by business domain; apply unified policies for routing, fallback, caching, and concurrency; record task type, model tier, latency, cost, and verification result for each call; and regularly review failure samples and update routing rules and evaluation sets.
Conclusion
Pursuing cost-effectiveness and tackling extremely hard problems are not contradictory. The former requires making high-frequency tasks lean, stable, and measurable. The latter requires breaking complex tasks apart, verifying them, and accumulating assets. Through task tiering, plan-execute-verify, expected total cost measurement, tiered evaluation, and phased gates, organizations can achieve both cost control and a higher capability ceiling. Truly “unprecedented” engineering capability often depends not on how strong a single call is, but on whether the system can reliably decompose, verify, and reuse hard problems.
