How Post-Training Reshapes AI Agent Cost Efficiency

    This article explains why a model can deliver a major capability jump without any change in architecture or parameter count, and why post-training has become the main source of that gain. It breaks a model iteration into four layers, details the post-training data and verifiable rewards that turn fluent answers into completed agent tasks, and shows how train-inference consistency, standardized API protocols, and cache-friendly pricing together determine real cost per task. You will also find a reproducible three-tier evaluation approach and practical selection advice for balancing performance and cost.

    1. The Phenomenon: Same Parameters, Noticeably Better Capability

    A typical model iteration pattern has recently emerged: the production release keeps exactly the same architecture and parameter scale as the preview (for example, a sparse design with roughly 284B total parameters and 13B activated parameters) and only reruns the post-training pipeline, yet real-world experience and multiple benchmark scores improve significantly. The gains are especially clear on agent tasks, where some core evaluations now surpass same-generation competitors and approach the top tier.

    This suggests that as sparse architectures converge, marginal capability gains depend more on data and training strategy than on adding parameters. A complete iteration can be broken into four layers:

    1. Architecture: attention design, sparse activation ratio, context length, and similar choices, which usually change the slowest.
    2. Pre-training: corpus mix and scale, which are expensive and slow.
    3. Post-training: supervised fine-tuning, preference optimization, reinforcement learning with verifiable rewards, and tool-call trajectory training.
    4. Engineering: inference engine, sampling strategy, interface protocols, caching, and scheduling.

    A production release often touches only layers 3 and 4, yet that is enough to turn “can answer” into “can act,” which is exactly where the agent capability jump comes from.

    2. Post-Training: From Fluent Language to Completed Tasks

    Agent scenarios demand very different things from a model than chat scenarios do. The core is multi-step decision making and state consistency:

    • Long-range consistency: remembering the goal and constraints after a dozen or more tool calls.
    • Failure recovery: reading a stack trace after a command fails and revising the plan instead of repeating the same action.
    • Cost awareness: preferring fewer steps and shorter intermediate output to finish a task.
    • Format compliance: reliably producing structured results that external systems can parse.

    Post-training typically achieves these goals with three kinds of data: high-quality tool-call trajectories labeled by humans or models, tasks that can be verified automatically (code execution, unit tests, format checks), and alignment data based on preference ranking. Verifiable rewards are especially important because they turn correctness into an automatically judgeable signal, which is what makes large-scale reinforcement learning possible.

    An illustrative training data layout (pseudocode, structure only):

    1. # One verifiable agent training sample
    2. sample = {
    3. "instruction": "Fix the failing unit test in the repo; do not add dependencies",
    4. "trajectory": [
    5. {"role": "assistant", "action": "list_files", "args": {"path": "."}},
    6. {"role": "tool", "result": "tests/test_parse.py ..."},
    7. {"role": "assistant", "action": "apply_patch", "args": {"diff": "..."}},
    8. {"role": "tool", "result": "3 passed"},
    9. ],
    10. "verifier": "run_pytest", # automatically decides whether it succeeded
    11. "reward": 1.0,
    12. "constraints": ["no_new_dependency", "max_steps=20"],
    13. }

    One hidden metric also needs engineering attention: output length must not balloon. If a capability gain comes with a surge in intermediate reasoning tokens, the actual bill cancels out the benefit. Mature iterations constrain task success rate and average output length at the same time.

    3. Train-Inference Consistency: The Long-Term Value of a Self-Built Execution Framework

    The original text mentions that the evaluation used a self-built agent execution framework that will be open-sourced, and the technical motivation is worth unpacking. Train-inference consistency means the prompt templates, tool descriptions, result-return formats, truncation and retry policies used to construct trajectories during training are identical to those used in online inference.

    Inconsistency causes typical problems:

    • Tool returns are simplified during training but come with extremely long logs in production, shifting the model distribution.
    • There are no timeouts or retries during training but frequent interruptions in production, so the model never learns to recover.
    • Training uses greedy decoding while production uses high-temperature sampling, and format compliance drops sharply.

    Unifying the execution framework, sandbox environment, evaluation set, and training pipeline is therefore a prerequisite for agent iteration. A minimal controllable framework usually includes tool registration and descriptions, permissions and sandboxing, step and budget limits, structured logs, and a reproducible evaluation task set.

    1. class AgentLoop:
    2. def __init__(self, model, tools, max_steps=20, budget_tokens=200_000):
    3. self.model, self.tools = model, tools
    4. self.max_steps, self.budget = max_steps, budget_tokens
    5. def run(self, task: str):
    6. state = {"task": task, "history": []}
    7. for step in range(self.max_steps):
    8. out = self.model.act(state) # structured output: action + args
    9. if out.type == "final":
    10. return out.answer
    11. result = self.tools.call(out.name, out.args, timeout=10)
    12. state["history"].append((out, result)) # exactly the same return format as in training
    13. return {"status": "budget_exceeded"}

    4. Interface Protocols and Tool Ecosystem Adaptation

    The production release natively supports a standardized Responses-style interface format and has been optimized for mainstream AI coding tools. These two points directly determine adoption cost. Practical recommendations:

    • Protocol layer: prefer an interface shape that supports unified multi-turn state plus built-in tool calls, reducing the error surface of assembling conversation history yourself.
    • Migration layer: add an adaptation layer at the gateway that maps internal abstractions to different protocols, so business code is not locked to a single format.
    • Observability: log each step’s action, latency, tokens, and failure reason to form a traceable chain.
    1. # Gateway adaptation sketch: the business side depends only on a unified abstraction
    2. def to_responses(messages, tools):
    3. return {"input": messages, "tools": tools, "stream": True}
    4. def from_responses(resp):
    5. return {"text": resp["output_text"], "calls": resp.get("tool_calls", [])}

    5. The Right Way to Calculate Cost Efficiency: Unit Price, Caching, and Cost per Task

    Comparing price per million tokens alone leads to wrong conclusions. A more reasonable metric is the total cost of completing one unit of intelligent work. A certain class of models has public pricing of about 1 CNY per million input tokens and about 2 CNY per million output tokens, and offers a high cache-hit discount (around 98%), so at the same level of intelligence the cost per task can drop to roughly 40% of an alternative.

    The cost formula can be written as:

    1. task cost = (uncached input x input price) + (cached input x input price x (1 - discount))
    2. + (output x output price) + overhead from failed retries

    Three implications follow. First, input far exceeds output in agent scenarios, so cache hit rate is the first lever. Second, reducing retries and wasted steps is more effective than pushing unit price down. Third, an iteration that keeps output length from ballooning is equivalent to an implicit price cut.

    6. A Reproducible Evaluation Method

    Build a three-tier evaluation in-house instead of trusting a single leaderboard:

    1. Static benchmarks: general sets for knowledge, reasoning, and code generation.
    2. Interactive benchmarks: frontend generation, repository-level fixes, and multi-tool collaboration, measured on both success rate and step count.
    3. Business regression: a small set (50 to 200 items) built from real, anonymized tasks, run after every model upgrade.
    1. eval:
    2. tasks: [repo_fix, frontend_gen, multi_tool]
    3. metrics: [success_rate, avg_steps, avg_output_tokens, cost_per_task]
    4. reasoning_effort: [low, medium, high] # the middle tier is often enough and costs less

    Note that the reasoning effort tier has a large effect on rankings. The middle tier covers most business needs, and you only raise it for complex refactoring.

    7. Conclusion and Selection Advice

    A better experience with unchanged parameters shows that post-training and engineering adaptation have become the main sources of incremental gains. A train-inference-consistent execution framework, standardized interface protocols, and a cache-friendly pricing structure together determine both agent adoption results and the bill. When selecting a model: rely on your own business regression set, calculate cost per task rather than unit price, keep a gateway adaptation layer to preserve portability, and set budget caps on output length and step count. If the current model still falls short, position it as a cost-efficient default tier and reserve the strongest capability for a few high-difficulty tasks, balancing performance against cost.