Evaluating and Post-Training LLM Agents: A Practical Guide to Benchmarks and Cost
This guide explains why model capability in the agent era is shifting from pre-training scale to post-training quality. It covers how to choose benchmarks after traditional code tests saturate, a framework for analyzing the weak correlation between model size and performance, three actionable post-training practices, how to calculate cost per successful task, and architecture recommendations for deployment.
1. The Problem: Why “Bigger Parameters” No Longer Means “Better at Tasks”
A pattern that keeps showing up in industry discussions is worth noting. After a new-generation general-purpose LLM released its production API, it performed close to or locally better than the previous flagship model on long-horizon agentic coding tasks. Yet it quickly faded from mainstream attention. The reason is not mysterious: its base architecture was top-tier for its generation, but its post-training stage was too tightly bound to a proprietary environment, which noticeably reduced cross-platform generalizability.
This suggests that in the agent era, the deciding factor for model capability is shifting from pre-training scale to post-training quality. This article does not target any specific vendor or product. It focuses only on reusable evaluation methods and engineering practices.
2. Choosing an Evaluation System: What to Look at After Old Benchmarks Saturate
Traditional code benchmarks (such as early function-level completion and repository-level bug-fix sets) show clear saturation and data contamination, with declining score discrimination. A more credible alternative is long-horizon agentic benchmarks, characterized by:
- Real tasks: drawn from real repositories and real tickets, not hand-crafted problems;
- Longer horizons: requiring multiple rounds of tool calls, file reading, test execution, and self-correction based on errors;
- Better contamination control: low probability of overlap between problems and training corpora, with continuous updates;
- Objective scoring: based on hard metrics such as unit test pass rate and patch correctness.
Selection advice: do not rely on a single leaderboard ranking. Cross-validate at least four categories of metrics: long-horizon agentic benchmarks + tool-call correctness + end-to-end task completion rate + cost per task.
3. Weak Correlation Between Scale and Strength: A Reusable Analysis Framework
Plotting several models’ scores on long-horizon benchmarks against their parameter counts yields one conclusion: scale and strength are generally positively correlated, but the slope is weak. The reason is that the current mainstream measurement systems assess “the ability to accomplish a specific thing,” and that thing might be writing code, checking logs, modifying configurations, or executing a business workflow.
A simplified illustrative model helps explain this relationship:
TaskScore ≈ f(architecture efficiency, data quality, post-training method, tool ecosystem fit) + ε(scale)
The marginal contribution of the scale term to the score is diminishing, while the weight of post-training and ecosystem-fit terms keeps rising. The engineering implication is direct: paying several times the cost for “a little bit bigger” is usually not worthwhile.
4. Three Actionable Levers for Post-Training
1) Environment and tool consistency. Inconsistency between the post-training environment and the online execution environment is the primary cause of reduced generalizability. Ensure that training and inference share the same tool signatures, return structures, and error-code semantics.
2) Trajectory quality over trajectory quantity. Long-horizon tasks should retain complete trajectories, including failed attempts and recovery processes, so the model learns “how to locate a problem after seeing an error” rather than only memorizing the correct end state.
3) Verifiable rewards. Use automatically judgeable signals (tests passing, static checks passing, schema validation passing) instead of human scoring to reduce reward noise.
An illustrative way to organize post-training data:
{"task_id": "repo-issue-1024","env": "sandbox-v3","tools": ["read_file", "apply_patch", "run_tests"],"trajectory": [{"step": 1, "action": "read_file", "result": "ok"},{"step": 2, "action": "apply_patch", "result": "tests_failed"},{"step": 3, "action": "run_tests", "result": "passed"}],"reward": 1.0}
5. The Correct Way to Calculate Cost Efficiency
Do not compare models by unit price. Use “cost per successful task”:
CostPerSuccess = (input tokens × input price + output tokens × output price + tool-call and sandbox overhead) / task success rate
For long-horizon agents, output tokens and tool overhead often account for the majority, so a model with a slightly higher unit price but a higher success rate and fewer retries may actually cost less. It is also recommended to record P50/P95 latency and retry rate to avoid using averages that hide the long tail.
6. Deployment Architecture Recommendations
- Build a unified abstraction at the access layer to shield differences between models, making canary release and rollback easier;
- Use a container platform to host sandbox execution, and object storage to store trajectories and artifacts;
- Build an observability loop with logging services and monitoring alerts, aggregating statistics by task dimension rather than request dimension;
- In general-purpose cloud environments such as Baidu AI Cloud, the above capabilities are provided as standard offerings and can be combined as needed.
7. Conclusion
The base architecture determines the starting point; post-training and ecosystem fit determine the endpoint. Developers should shift budget from “chasing the largest parameter count” toward “training the most scenario-fit post-training + building the most credible evaluation loop,” using cost per successful task as the final decision criterion.
