Post-Training and Large Base Models: Paths to Stronger Coding Agents

    This article compares two ways to improve coding agents: scaling or restructuring the base model through pretraining, and investing more resources in post-training an existing base. It explains what each route changes, why real engineering tasks need long-horizon training and evaluation beyond single-step code generation, how reward design and fair benchmarking affect results, and how least privilege, audit trails, and stop conditions shape reliability in production. It ends with a practical order for deciding where to invest.

    1. From Parameter Competition to Engineering Capability Competition

    When teams upgrade coding models, two approaches are common. One is to scale up or restructure the base model, strengthening general capability through pretraining. The other is to keep the existing base model and put more resources into post-training, so the model becomes better at specific tasks.

    This is not simply a debate between large and small models, or between a true upgrade and fine-tuning optimization. The two routes solve different problems, require different investments, and their returns depend on the task type.

    For developers, writing a piece of code is only the most basic requirement. A coding agent that is truly valuable must read an existing project, locate defects, make a modification plan, operate tools, verify results, and adjust its approach after failures. Enterprises add further requirements: the agent should control the scope of changes, respect permission boundaries, leave audit records, and finish tasks within a cost budget.

    The more useful question, therefore, is: under given resource constraints, how can we improve the reliability with which an agent completes real engineering tasks?

    Answering this requires observing parameter scale, training methods, and the runtime system separately. No single number should be credited with every effect.

    2. What Each Route Changes

    1. Scaling the base model: the foundation for capability

    Pretraining usually learns patterns in language, code, and other information from large-scale data. Increasing model capacity, improving data quality, and adjusting training methods can all strengthen knowledge coverage, abstract representation, and transfer across tasks.

    For coding tasks, these changes may show up as more accurate understanding of unfamiliar code structures, better linking of cross-file dependencies, and more reasonable candidate explanations when information is incomplete.

    However, more parameters do not automatically mean better engineering performance. Whether the training data is effective, whether optimization is sufficient, whether the architecture suits deployment, and whether the model’s capability can be exercised during inference all affect the final result.

    Total parameter count also differs from the number of parameters actually active in each computation. In models with sparse expert architectures, these two figures can differ substantially. Comparing inference cost by total parameters alone can overlook the actual compute path, memory access, and device communication overhead.

    A large base model therefore provides a space of potential capability, not a guaranteed task success rate.

    2. Deepening post-training: improving how existing capability is used

    Post-training can include supervised fine-tuning, preference optimization, reinforcement learning, and other methods. For coding agents, its key role is not only to make responses match requirements more closely, but to train the model to make effective decisions during interaction.

    For example, when a test fails, should the model first check the error message, or modify the implementation directly? Facing a large codebase, should it locate the entry point first, or read a large number of files? When the first fix does not work, should it revert the change, gather more evidence, or keep stacking patches?

    These are strategy questions. A model may already have relevant programming knowledge but lack stable engineering behavior. Post-training can improve cases where the model knows what to do but does not use that knowledge reliably.

    Post-training has limits, though. If the base model lacks certain knowledge, struggles to represent complex relationships, or has insufficient reasoning ability, reward guidance alone may not compensate. Poorly designed training objectives can also teach the model to game the scoring mechanism rather than solve the problem.

    A more accurate view is this: pretraining and post-training jointly shape capability. They divide the work, and they also constrain each other.

    3. Why Long-Horizon Task Training Is Worth the Investment

    Traditional code generation usually has one input and one output. Engineering tasks are typically a continuous chain of decisions:

    Understand requirements → Retrieve code → Analyze dependencies → Modify implementation → Run verification → Handle failures → Deliver results.

    The longer the chain, the more easily an early error affects later steps. Misjudging a module’s responsibility may lead to changes in the wrong place. Ignoring environment dependencies may make a runtime failure look like a code defect. Failing to save key observations may cause the same problem to be investigated repeatedly.

    The value of long-horizon training is that it teaches the model to keep its goal, accumulate evidence, and correct its judgments across multi-step interactions. Optimizing the quality of a single step’s output is not enough.

    1. Environment diversity matters more than repetition

    Adding more training tasks provides more experience. If the tasks share a highly similar structure, however, the model may still learn fixed routines.

    More effective environment coverage includes:

    • Codebases of different sizes and organizational structures;
    • Different task types, such as implementation defects, requirement changes, and performance issues;
    • Environment anomalies, such as build failures, unstable tests, and missing dependencies;
    • Different information conditions, with complete documentation or with little or none;
    • Different interaction patterns, from single-tool operations to multi-tool coordination.

    The goal is not for the model to have “done something many times.” The goal is for the model to recognize, under different conditions, which experience can be reused and which assumptions need to be checked again.

    2. More training time does not mean more useful experience

    Extending post-training may create more exploration opportunities. It may also produce many repetitive trajectories and low-value attempts. If training samples keep concentrating on tasks that are easy to reward, the model may drift away from real usage needs.

    When expanding post-training, teams should monitor the difficulty distribution of tasks, the quality of trajectories, the types of failures, and the independence of evaluation sets. Added resources should expand useful experience, not simply lengthen run time.

    4. Reward Design Determines What the Agent Learns

    In coding scenarios, test results are an important verifiable signal. But “tests pass” does not mean “the task is fully solved.”

    A model may achieve superficial success by deleting tests, weakening assertions, or hardcoding local examples. It may also get the functionality right while adding unnecessary dependencies, expanding the scope of changes, or breaking existing interface conventions.

    Rewards and evaluation should therefore cover several dimensions.

    Functional correctness. Does the change meet the requirement, and does it pass targeted tests and regression checks?

    Change reasonableness. Was the right location modified, were unrelated refactorings avoided, and were existing behavioral constraints preserved?

    Interaction efficiency. Are there repeated reads, invalid calls, or unnecessary large-scale scans?

    Security and compliance. Did the agent access unauthorized resources, perform high-risk operations, or expose sensitive information?

    Explainability. Can the agent explain the basis for its changes, the scope of its verification, and the risks it has not confirmed?

    These metrics do not have