Evaluating and Governing the Cost of LLMs in the Post-Training Era

    This article explains why high benchmark scores often fail to translate into reliable business results, and why cost should be measured per successful task rather than per million tokens. It proposes a production-oriented evaluation index weighted toward coding and agentic capabilities, outlines how post-training drives execution reliability, and shows how context governance, caching, routing, and structured validation reduce effective task cost. A reproducible evaluation and model selection workflow is included.

    1. The Problem: High Benchmark Scores, Disappointing Business Results

    A pattern that keeps recurring in real engineering work: a model ranks near the top of general-purpose leaderboards, yet once it is wired into a real business flow, structured output becomes unstable, tool call arguments go missing, and long multi-step tasks drift off course midway. The result is a pile of prompt patches and retry fallbacks. This shows that traditional evaluation dimensions, built mainly around knowledge question answering and single-turn comprehension, can no longer describe how advanced models behave inside real systems.

    Cost pressure is equally real. Unit price (the price per million tokens) is only a number on paper. What actually determines the budget is the total spend required to complete one effective task, which is driven jointly by retry count, context length, number of tool round trips, and the share of manual rework. A model that scores slightly lower on a leaderboard but succeeds on the first attempt more often is frequently the cheaper option overall.

    This article therefore addresses two core topics: how to build an evaluation system oriented toward engineering deployment, and how to perform quantitative governance of cost and model selection on top of that system.

    2. Shifting the Evaluation Focus: Why Coding and Agentic Ability Should Dominate

    2.1 Reallocating Capability Weights

    A production-oriented composite index can concentrate weight on the dimensions most directly tied to business output, for example:

    1. Composite Index = 0.35 * Coding and engineering ability
    2. + 0.30 * Agentic ability and tool use
    3. + 0.20 * Hard reasoning (capability ceiling)
    4. + 0.10 * Instruction following and structured output
    5. + 0.05 * Knowledge coverage

    Coding and agentic ability together account for more than sixty percent, because these two categories offer the strongest verifiability and transferability: code can be validated by running tests automatically, and agentic tasks can be checked against state and artifacts. Knowledge and instruction following, by contrast, can largely be compensated for in current engineering practice through retrieval augmentation, schema constraints, and external validation, so their marginal return is comparatively lower. Hard reasoning keeps roughly twenty percent, used to measure the model’s capability ceiling and to decide whether it can handle complex planning and long chains of problems.

    2.2 Why Models That Look Good on the Front End Actually Perform

    Effectiveness at the interface and interaction layer is not fundamentally about writing style; it is about execution: whether the model can output strictly according to a schema, hold constraints across multiple rounds of revision, translate natural language requirements into components and styles without loss, and self-correct after an error. This explains why models with strong execution ability achieve a noticeably higher first-pass rate on front-end generation.

    A minimal constraint validation example:

    1. import json, re
    2. def validate_structured_output(text: str, schema: dict) -> bool:
    3. try:
    4. data = json.loads(text)
    5. except json.JSONDecodeError:
    6. return False
    7. return all(k in data for k in schema.get("required", []))
    8. # Constraint prompting + programmatic validation + retry on failure
    9. # is the standard combination for raising the first-pass success rate

    3. Why Post-Training Has Become the Main Engine of Capability Gains

    Pre-training determines the model’s knowledge base and language intuition, but whether a task actually gets done is decided more by post-training. Post-training typically includes supervised fine-tuning, preference alignment, and reinforcement learning on verifiable tasks. Its effects can be summarized in four points:

    1. Behavior shaping: turning “can talk about it” into “does it,” sharply reducing format drift and superfluous explanation;
    2. Long-horizon stability: multi-step task training reduces mid-course loss of the objective and misuse of tools;
    3. Self-correction: learning to read error messages, roll back, and switch approaches instead of repeating ineffective attempts;
    4. Controllable style and safety: achieving a more stable balance between usefulness and boundaries.

    This leads to an important selection judgment: when two models have comparable base capability, differences in post-training quality show up directly in the first-pass success rate, and that rate is the largest lever on total cost. Relying only on raw base capability while ignoring alignment and task training tends to be amplified in real systems into an experience gap users can feel.

    4. Cost Governance: From Unit Price to Cost per Effective Task

    The following metric is recommended in place of unit price for decision making:

    1. Cost per effective task = (input tokens * input price + output tokens * output price) * attempts / successes
    2. + manual rework cost

    In practice, this value can be reduced substantially through engineering means:

    • Context governance: trimming and reranking retrieved snippets, compressing conversation history into summaries, and preprocessing long documents into structured indexes;
    • Cache reuse: applying prefix caching to stable prefixes (system prompts, tool descriptions, specification documents) to cut repeated billing;
    • Tiered routing: sending simple classification and extraction to small models, and complex planning and code generation to large models;
    • Structured constraints: replacing repeated verbal reminders with schema validation, cutting retries from three to one;
    • Observability: building logs, monitoring, and alerting dashboards for token consumption, tool call rounds, and failure causes, with cost accounted per scenario.

    Suppose a customer service scenario measures an average of 6k input tokens and 800 output tokens per task, a first-pass success rate of 0.55, and 1.8 attempts on average. After introducing schema validation and retrieval trimming, the success rate rises to 0.82 and attempts drop to 1.22. Even with unit price unchanged, the cost per effective task falls by more than thirty percent. This shows that “expensive or not” must be viewed against the denominator of success rate.

    5. A Reproducible Evaluation and Selection Workflow

    1. Build a business task set: sample 200 to 500 cases from real logs, covering typical and boundary scenarios, and annotate acceptance conditions that can be judged automatically;
    2. Score in layers: separately record code pass rate, tool call accuracy, format compliance rate, task completion rate, and manual rework time;
    3. Normalize and weight: combine the weights from Section 2 into a composite index, while keeping per-dimension radar charts to locate weak spots;
    4. Backfill cost: plug each scenario’s attempt count and token consumption into the cost formula to produce a value-for-money ranking;
    5. Validate with a canary release: run a small traffic canary, observe the online first-pass success rate and complaint rate, then decide on full rollout;
    6. Run continuous regression: automatically rerun regression after any model or prompt change to prevent capability regression.

    6. Engineering Deployment Recommendations

    • Make “verifiable” the first principle: whatever can be decided by tests, schema validation, or a state machine should not be left to subjective judgment;
    • Design explicit state and rollback mechanisms for agents, and cap the maximum number of tool rounds to avoid cost blowups from infinite loops;
    • Route model access through a unified gateway to simplify routing, rate limiting, caching, and cost accounting;
    • Use a container platform to host inference and task orchestration, object storage to hold datasets and artifacts, and logging plus monitoring and alerting services to close the loop;
    • On platforms such as Baidu AI Cloud, the general capability categories above can be used first to build evaluation and cost dashboards, keeping them decoupled from any specific model and avoiding lock-in to a single supplier.

    7. Conclusion

    The center of gravity in evaluation is shifting from knowledge coverage to task completion, and post-training has become the key variable determining that metric. Cost, meanwhile, must be measured per effective task and brought down systematically through context governance, caching, routing, and structured constraints. Turning both into a routine pipeline is what makes it possible to keep making the right technical selection decisions in an environment where models iterate rapidly.