Key Factors in Post-Training for LLM Agent Capabilities

    LLMs are now used for multi-step, tool-driven workflows, so agent capability has become a deciding factor for production success. This article explains why post-training is central to tool selection, planning, and error recovery, then breaks agent capability into six measurable dimensions. It also covers evaluation pitfalls such as data contamination and version drift, practical implications of sparse-activation architectures, and a reusable agent execution loop with validation, step limits, permissions, and secret handling.

    As large language models (LLMs) move from single-turn question answering to multi-step task execution, agent capability has become one of the metrics developers care about most. The model must understand the user’s goal, choose the right tool, parse the tool result, and adjust its own plan when something fails. This ability depends on model scale, training approach, and supporting engineering. This article reviews where the improvements come from, how to evaluate them, and a reusable engineering framework.

    Why Agent Capability Is Now a Top Iteration Priority

    Early LLM evaluation often focused on text generation quality and knowledge-based question answering. Once applications reach deployment, enterprises care more about whether the model can complete an entire business workflow. For example, a customer-service automation task may need to look up an order, verify refund eligibility, call a payment API, and then generate a reply. Each step can fail, and any single failure can interrupt the entire flow.

    The focus has therefore shifted from “how good is the answer” to “can the task complete reliably.”

    Where Capability Changes Come From: Pretraining vs. Post-Training

    Pretraining largely determines knowledge coverage and basic language capability. Post-training determines how the model follows instructions, emits required formats, and uses tools correctly. If the architecture and parameter count stay fixed and only post-training is repeated, most visible capability changes come from data mix, training objective, and optimization strategy.

    Common post-training approaches include:

    • Supervised fine-tuning (SFT): Use high-quality instruction data and demonstration trajectories to teach the model to produce structured outputs, such as well-formed tool-call arguments.
    • Preference optimization: Use paired candidate responses so the model learns to favor the answer that better satisfies the requirements.
    • Reinforcement learning (RL): Provide reward signals in automatically verifiable environments—for example, whether code passes tests or whether a tool call returned the correct result.
    • Rejection sampling and data synthesis: Have the model generate many candidate trajectories, keep the correct ones, and feed them back into training.

    These methods are not mutually exclusive. In practice, teams typically use supervised data to establish basic behavior patterns and then use preference optimization or RL to improve decision quality. For downstream users, the most direct effect is that the same base model can show clear differences in tool-call formatting, long-task stability, and error handling, so every version update needs revalidation.

    Decomposing Agent Capability into Measurable Metrics

    Saying “the agent is capable” is too vague to guide engineering decisions. A better approach is to break agent capability into six measurable dimensions:

    • Tool selection accuracy: Whether the model picks the correct tool from the given tool set.
    • Argument construction correctness: Whether argument names, types, and value ranges match the interface definition.
    • Multi-step planning completeness: Whether the model decomposes the goal into ordered subtasks without omitting critical steps.
    • State-tracking consistency: In multi-turn or multi-call tasks, whether the model retains previous results and constraints, avoiding duplicate execution or forgotten limits.
    • Error recovery: After receiving an error, whether the model can identify the cause and choose a retry or a different strategy.
    • Termination judgment: Whether the model stops promptly after task completion to avoid ineffective loops.

    When evaluating, the task set must be representative. Public leaderboards typically cover generic scenarios and may not match internal workflows. Extract tasks from real business logs and build a test set that includes normal paths, edge cases, and failure paths. Keep enough samples in each category and record task success rate, average call count, end-to-end latency, and per-task cost.

    The following is an example evaluation case:

    1. test_case = {
    2. "task_description": "Check logistics status for order A123",
    3. "expected_tool": "query_logistics",
    4. "expected_arguments": {"order_id": "A123"},
    5. }
    6. def score(test_case, model_call):
    7. tool_correct = model_call["name"] == test_case["expected_tool"]
    8. arguments_correct = all(
    9. normalize(model_call["arguments"].get(k)) == normalize(v)
    10. for k, v in test_case["expected_arguments"].items()
    11. )
    12. return tool_correct and arguments_correct

    The normalization function is important. It should handle case differences, extra whitespace, and differences between numeric and string values. Without it, arguments that are semantically correct but written slightly differently will be counted as wrong, making scores lower than they should be.

    What Sparse-Activation Architectures Mean in Practice

    An increasing number of large models use sparse Mixture-of-Experts (MoE) architectures. The total parameter count is large, but only a subset of parameters is active in each forward pass. The main benefit is that inference compute is not proportional to total parameter count, so the same compute budget can deliver higher throughput.

    However, there are important caveats:

    1. All weights usually still need to be held in GPU memory or RAM, so the deployment barrier may not drop as much as expected.
    2. Routing affects per-request latency. Under high concurrency, tail latency may deserve more attention than average latency.
    3. Parameter count alone does not represent capability; final quality must be confirmed through task evaluation.

    For these models, measure throughput and latency distributions at the target concurrency and context length, rather than doing capacity planning from parameter counts alone.

    Common Mistakes in Model Selection and Upgrade Evaluation

    When choosing a model or evaluating a version upgrade, these mistakes often lead to bad decisions:

    1. Relying on one leaderboard ranking. Different benchmarks emphasize different capabilities, so a single score cannot cover business needs.
    2. Ignoring evaluation configuration differences. Prompt templates, sampling temperature, tool description detail, and whether reasoning output is enabled all affect results. Keep them consistent across comparisons.
    3. Ignoring data contamination. Public benchmark questions may already exist in training data, so scores can be higher than real-world performance. Cross-check with private test sets.
    4. Ignoring version drift. API or model version updates can change behavior of existing prompts and workflows. Build regression tests.
    5. Counting only successful samples. Retry counts on failed requests, human intervention cost, and the blast radius of bad output are also part of the total cost of model selection.

    Engineering an Agent Loop with Validation

    The core of an agent is a loop: the model proposes the next action, the system validates and executes it, then returns the result to the model. This repeats until the task is complete or a limit is reached.

    The following example code shows the key parts:

    1. max_steps = 8
    2. def run_agent(model, tool_registry, user_goal):
    3. messages = [{"role": "user", "content": user_goal}]
    4. for _ in range(max_steps):
    5. response = model.generate(messages, tools=tool_registry)
    6. if response["type"] == "final":
    7. return response["content"]
    8. name = response.get("tool")
    9. arguments = response.get("arguments", {})
    10. if name not in tool_registry:
    11. messages.append({"role": "system", "content": f"Unknown tool: {name}"})
    12. continue
    13. valid, error_message = validate_arguments(
    14. tool_registry[name]["schema"], arguments
    15. )
    16. if not valid:
    17. messages.append(
    18. {"role": "system", "content": f"Argument error: {error_message}"}
    19. )
    20. continue
    21. result = tool_registry[name]["func"](**arguments)
    22. messages.append({"role": "tool", "name": name, "content": str(result)})
    23. raise RuntimeError("Exceeded max steps; task not completed")

    This structure has several design points worth noting:

    1. Validate before execution. Tool arguments must conform to a defined schema. If validation fails, feed the error message back to the model so it can correct the call instead of aborting the loop.
    2. Set a step limit. The model may get stuck in repeated calls. A limit bounds both cost and wait time.
    3. Control tool permissions. Separate read-only and write tools, follow the principle of least privilege, and require user confirmation before irreversible actions such as deletion, payment, or sending messages.
    4. Never place credentials in code or logs. Read secrets from environment variables or a dedicated secret manager.