From Scaling to Post-Training: The Leap in AI Agent Engineering Capabilities
This article examines why post-training is outperforming sheer parameter scaling in enhancing AI agents for software engineering and operations tasks. It outlines how trajectory-level optimization, custom evaluation environments, and robust governance boundaries enable lightweight agents to effectively handle real-world engineering workflows.
Post-training is redefining the criteria for “who can do engineering.” For a long time, the industry consensus was clear: more parameters and larger pre-training corpora equate to a stronger model. While this holds true for open-ended QA and general writing, the marginal returns have visibly flattened for agent tasks that require reading code, modifying repositories, running commands, and reading test failures before iterating. Production-ready capabilities often emerge not from stacking another massive foundation model, but from realigning post-training samples, reward signals, and tool environments with real-world workflows using the same base weights.
The Counterintuitive Insight
A lightweight model outperforming a larger preview model does not violate learning theory. Pre-training solves the problem of “having seen enough distribution to form transferable representations,” whereas post-training addresses “making fewer mistakes on specific decision sequences.” Software engineering and operations automation are exactly these long-chain decisions: a single task might involve reading files, locating symbols, formulating hypotheses, applying patches, executing tests, reading error logs, and rolling back to retry. Any format error, premature abandonment, or invalid tool call along the way can render the entire trajectory a failure.
This leads to a seemingly unreasonable but practically sound outcome: base size, architecture, and context window remain unchanged, yet redoing post-training alone can boost agent scores by an order of magnitude. A larger “omniscient” model with training objectives scattered across writing, QA, reasoning, and tool usage may not exhibit higher single-point execution capability. This mirrors the difference between a general practitioner and a specialist surgeon: a broader knowledge base does not equate to more stability in high-risk, specific procedures.
What Agent Tasks Actually Evaluate
Do not mistake these benchmarks for simply testing “whether the model can write a function.” Typical software repair tasks require the model to handle scales approaching real repositories: tens of thousands of lines of code, incomplete issue descriptions, existing tests, and hidden tests. A qualifying trajectory includes at least:
- Establishing task boundaries: Identifying which modules might be relevant and which logs serve as evidence.
- Locating rather than guessing: Using search, dependency graphs, and failure stacks to narrow the modification surface.
- Providing verifiable patches: Ensuring modifications can be accepted or rejected by existing or new tests.
- Controlling side effects: Refraining from unnecessary refactoring of unrelated code or breaking public APIs.
Terminal-based tasks resemble a day in the life of an on-call engineer: batch cleaning logs, preparing runtime environments, troubleshooting permissions, debugging scripts, and confirming if a service is genuinely running. Many industry models can generate “correct-looking” commands but fail to adjust plans based on non-zero exit codes, permission denials, or missing paths. Stalling near the median score is usually due to a lack of closed-loop capability rather than a lack of knowledge.
Full-stack and challenging evaluations should be viewed separately. Full-process tasks cover requirement breakdown, API design, implementation, testing, and regression. Challenge sets capture scenarios rarely covered by public leaderboards: legacy system refactoring, multi-language hybrid repositories, concurrency and resource contention, and undocumented technical debt. Scoring well only on clean examples does not prove a model can enter a production repository.
Why Post-Training is the Primary Lever
Continuing to scale pre-training still holds value, but it optimizes for the average loss of the next token, not for “whether this patch will pass tests.” Post-training can shift the objective function to the trajectory level:
- Planning: Writing testable steps first, rather than immediately dumping code.
- Action: Calling retrieval, terminal, testing, and patching tools via a unified protocol.
- Observation: Treating tool returns as new evidence rather than ignoring or echoing them.
- Error correction: Narrowing hypotheses after a failure, rather than repeating the same command.
- Stopping: Converging explicitly when evidence is sufficient or the budget is exhausted, avoiding meaningless loops.
Samples should be constructed around these phases, rather than mixing in irrelevant chit-chat. Rewards should not solely depend on whether the final answer resembles the reference text; they must also account for whether tests pass, commands are idempotent, and the change scope is minimal. Process rewards can cover “whether the failure was reproduced first,” “whether relevant files were read,” and “whether identity and paths were checked after a permission error.” With only outcome rewards, models tend to memorize answers; with only process rewards, models might feign diligence without delivering a patch. Both must be used together.
In terms of data composition, it is recommended that failure recovery samples occupy a significant proportion. In real environments, one-shot success is rare; most value comes from second or third attempts. If the training set consists entirely of flawless demonstrations, the model will drift upon encountering the first error in production.
Interface Compatibility Matters More Than Model Scores
For engineering teams, the real switching cost often lies not in the weights, but in the calling protocol. If a model natively supports response and tool-calling formats consistent with existing programming assistants, local command lines, editor plugins, and established automation scripts can simply change the endpoint without rewriting the agent layer or performing field-level protocol conversion. Eliminating a forwarding layer reduces both latency and failure points. In batch tasks, the retry overhead caused by protocol inconsistencies is often more expensive than the model’s generation time.
When deploying, maintain a thin adaptation layer and avoid hardcoding vendor differences into business scripts:
task = load_issue(repo, issue_id)plan = agent.propose_plan(task, tools=repo_tools)for step in plan.bounded_steps(max_rounds=8):obs = tools.run(step.action)if obs.passed_tests:breakstep = agent.revise(step, obs)submit_patch_if_green(repo, plan.diff)
This pseudocode emphasizes boundaries: rounds have a limit, actions are observable, and submission only occurs when tests turn green. No matter how powerful the model is, it should never be granted unaudited direct write access to production.
Calculate Cost by Task, Not by Token Price
Evaluating models solely on input/output pricing leads to misjudgments. An agent’s bill consists of four parts: multi-turn context, tool returns, failure retries, and cache hits. A lightweight model with shorter trajectories and fewer invalid calls can cost less overall than a larger generalist model, even if their single-generation quality appears similar. Caching is particularly effective for repeated repository descriptions, coding standards, and tool schemas. When batch-fixing similar issues, a high cache hit rate further amplifies the cost gap.
It is advisable to track four metrics simultaneously: the median wall-clock time per task, the median number of calls, the test pass rate, and the human handover rate. If two models have similar benchmark scores but vastly different handover rates, they are not “about the same” in production. Conversely, a high demo score that requires dozens of tool calls per task is unsuitable for unattended operations.
Build Your Own Evaluation Instead of Relying on Public Leaderboards
Public leaderboards are good for spotting trends but cannot replace your own repositories. Build a three-tier evaluation suite:
- Smoke set: Dozens of minor defects that can be executed in minutes, used for regression testing after each post-training run.
- Full-stack set: Complete project slices from requirements to testing, assessing whether APIs and documentation are updated simultaneously.
- Challenge set: Legacy modules, cross-language boundaries, concurrency, and permission issues. Allow longer time limits but ensure automated grading.
Judgment criteria must be machine-executable: hidden tests, static checks, build success, patch line limits, and whether forbidden directories were touched. Humans should only review disputed samples, avoiding the trap of substituting “looks reasonable” for actual pass/fail status. The challenge set should be rotated regularly to prevent models or data pipelines from memorizing old questions.
Internal benchmarks also serve an organizational purpose: they force teams to define “tricky” explicitly. Old systems without tests, inconsistent log formats, and scattered configurations—these challenges never appear in clean question banks. Writing them into evaluations ensures post-training optimizes for real engineering, not just leaderboard prose.
Governance Boundaries for Production Deployment
Even with significantly improved execution capabilities, jumping straight to fully automated merging is not recommended. A safer path is: the model handles reproduction, localization, and candidate patches; Continuous Integration (CI) handles rejection; humans handle merging and releasing. Differentiate permissions between read-only inspections, test environment writes, and production changes. Operations tasks should default to a dry run—first presenting the commands to be executed and their blast radius, then letting a policy engine allow low-risk actions, such as log aggregation, read-only diagnostics, and dependency installation in isolated environments.
Prompts should not carry the entire workflow. Stable components belong in system policies and tool permissions: allowed command whitelists, per-call timeouts, writable paths, and ensuring secrets never enter the context. The model should only process the evidence and hypotheses for the current incident. This way, when models are swapped, the security boundaries do not drift with the prompts.
What Teams Can Do Immediately
First, categorize existing tickets into “automatically verifiable” and “human-only judgment.” Only hand the former to the agent; otherwise, you cannot verify if it actually fixed the issue. Second, conduct small-scale post-training or preference optimization experiments using the same base model, drawing samples entirely from your own failure trajectories rather than general chat logs. Third, unify tool protocols to minimize intermediate conversions. Fourth, make selection decisions based on total task cost, pass rate, and handover rate, rather than parameter count or single-shot demos. Fifth, retain human gold standards for difficult problems to prevent automation from silently introducing behavioral changes in legacy systems.
The scaling race is not over, but it can no longer solely explain the leap in engineering capabilities. At this stage, the more effective lever is aligning post-training, evaluation environments, and tool permissions with the same type of work: understanding the context, modifying code, interpreting failures, and knowing when to stop. By doing so, lightweight execution agents can independently handle a large volume of daily repairs and operations within clear boundaries, while larger generalist models continue to handle tasks requiring broad-spectrum judgment. The two are not mutually exclusive; they simply have different objective functions.
