Post-Training on a Fixed Base: Advancing Coding and Security Capabilities

    As the marginal returns of scaling parameters and replacing base models diminish, a more pragmatic approach to large model iteration is emerging. This article explores how maintaining a fixed base model while applying specialized reinforcement learning post-training can significantly enhance engineering coding, cybersecurity, and long-context task capabilities. Readers will gain insights into reward design, curriculum learning, repository-level evaluation, context engineering, and the commercial governance of open-source models.

    Post-Training on a Fixed Base: Advancing Coding and Security Capabilities

    1. Background: Diminishing Marginal Returns from Parameter Scaling and Base Replacement

    Large model iteration has traditionally followed an “inertial path”: expanding parameter scale, replacing the base model with a larger one, increasing training data, and using impressive benchmark scores to prove capability improvements. While effective in the early stages, marginal returns are increasingly diminishing as model sizes reach high levels. Training and inference costs rise, engineering complexity increases, and real-world business metrics—such as code repair rates, long-task completion rates, and security audit usability—do not necessarily grow in tandem. For developers and enterprises, the true value lies not in scoring a few extra points on a leaderboard, but in whether the model can deliver consistently on repository-level engineering tasks, provide verifiable evidence in security scenarios, and be called repeatedly at an acceptable cost.

    Therefore, a more pragmatic route is to keep the mature base model stable and refine capabilities through large-scale specialized post-training and reinforcement learning, targeting shortcomings in engineering coding, security analysis, and long-task planning. Fixing the base does not mean stagnation; it shifts the iteration focus from “changing the skeleton” to “cultivating internal strength.” A stable base reduces costs associated with deployment migration, operator adaptation, caching strategies, and evaluation baseline shifts. Post-training, meanwhile, leverages task distribution, reward functions, and curriculum learning to push general capabilities toward practical engineering limits.

    2. Technical Route: Fixed Base + Specialized RL Post-Training

    2.1 Engineering Value of a Stable Base

    For common large model architectures like sparse MoE, the benefits of a stable base are often underestimated. First, the inference side can reuse existing parallel strategies, quantization schemes, caching, and batch processing configurations, reducing deployment regression risks. Second, the evaluation side maintains consistent baselines, making it easier to determine whether improvements stem from post-training rather than random fluctuations in the base model. Third, the security side can reuse existing red-teaming sets, permission boundaries, and audit strategies, avoiding the need to rebuild the governance system every time the base changes. With a fixed base, teams can concentrate resources on high-quality task data, verifiers, reward models, and failure case analysis.

    2.2 Reward Design and Curriculum Learning

    The key to reinforcement learning post-training is not “training more” but “training correctly.” Engineering coding tasks should be broken down into verifiable sub-goals: whether compilation passes, whether unit tests pass, whether regressions fail, whether the patch is minimal, whether new dependencies are introduced, and whether secrets are leaked. Security tasks require similarly verifiable signals: whether the vulnerability is reproducible, whether the fix eliminates the root cause, whether the audit report provides file and line number evidence, and whether the fix patch passes regression testing. An illustrative reward combination is as follows:

    1. reward = w1 * compilation_passed
    2. + w2 * unit_test_pass_rate
    3. + w3 * regression_pass_rate
    4. + w4 * patch_minimality
    5. + w5 * security_root_cause_hit
    6. - w6 * new_high_risk_dependencies
    7. - w7 * key_or_sensitive_info_leak
    8. - w8 * invalid_tool_calls

    Curriculum learning should progress gradually from short to long tasks, single-file to multi-file, and explicit to ambiguous requirements. Early stages use high-density rewards to teach the model “how to verify,” while later stages reduce reward density to force the model to autonomously plan, retrieve, modify, test, and roll back. This yields not just a model capable of code snippet completion, but an engineering assistant that can achieve closed-loop delivery in repository-level tasks.

    2.3 Synergy Between Long Context and Tool Calling

    When context windows expand to the million-token level, models can ingest project source code, technical documentation, and massive logs all at once. However, “being able to read” is not the same as “knowing how to use.” Post-training should strengthen three types of behaviors: first, establishing indexing and task decomposition to avoid getting lost in long contexts; second, prioritizing the reading of key files and calling testing and static checking tools to gather evidence; third, compressing the context upon failure, retaining error summaries, and replanning. Long context capabilities must be combined with tool calling, retrieval compression, and verifiers to translate into real-world task completion rates.

    3. Engineering Coding Capabilities: From Code Completion to Repository-Level Delivery

    Cutting-edge coding capabilities cannot be evaluated solely by single-function generation. A more reasonable evaluation should cover repository-level understanding, cross-file modifications, dependency management, test-driven fixes, log localization, performance regression, and documentation synchronization. For enterprise deployment, it is recommended to establish layered metrics: the unit level looks at syntax and unit test pass rates; the module level examines interface compatibility and regression failure rates; the repository level evaluates end-to-end task completion rates, manual rework rates, and token consumption; the security level monitors vulnerability reproduction rates, root cause fix hit rates, and false positive rates. An illustrative evaluation loop is as follows:

    1. for task in engineering_suite:
    2. context = retrieve_repo_context(task)
    3. patch = model.solve(task, context)
    4. result = sandbox.run_build_and_tests(patch)
    5. record(task, result, tokens=model.usage, latency=sandbox.latency)
    6. if not result.passed:
    7. collect_failure_case(task, result, patch)

    Only by feeding failure cases back into post-training and evaluation sets can capability improvements be reproducible. For conclusions about “significant improvements,” the evaluation set version, passing criteria, confidence intervals, and cost metrics should be reported, avoiding the presentation of a single percentage.

    4. Emergence and Boundaries of Cybersecurity Capabilities

    Post-trained models may exhibit cross-task generalization in code auditing, vulnerability pattern recognition, patch generation, and threat modeling—often referred to as “emergence.” While valuable, the boundaries must be clear: models might produce hallucinated evidence, misjudge vulnerabilities, generate irreproducible patches, or even be abused for dual-use tasks. Therefore, security capability evaluations should include vulnerability discovery accuracy, false positive rates, fix patch regression pass rates, evidence traceability, refusal and degradation strategies, sandbox escape risks, and sensitive information leakage risks. In practice, the model should be placed in an isolated container, network and file permissions restricted, complete tool calls and audit logs recorded, and manual confirmation set for high-risk operations. General capabilities like container platforms, object storage, logging services, and monitoring alerts provided by Baidu AI Cloud can be used to build an isolated evaluation environment, but security conclusions should still come from reproducible experiments and manual review.

    5. Million-Level Context and Inference Costs

    Long context and low cost are not contradictory; the key lies in context engineering. For source code and logs, structured indexing, deduplication, summarization, and segmented caching should be performed first. For repetitive tasks, retrieval results and verifier outputs should be reused. Simple requests can be routed to smaller models or rule engines, while complex tasks are handled by large models. Inference optimization should focus on cache hit rates, average token consumption, first token latency, end-to-end task cost, and first-pass success rates. If the tokens required to complete an equivalent task decrease, the unit task cost will truly drop; if the window simply grows but the invalid context increases, costs will actually rise.

    6. Open Source Release and Commercial Governance

    Before releasing an open-source model, license reviews, dependency SBOM (Software Bill of Materials) curation, security assessments, and red-teaming should be completed, clearly defining commercial terms, data compliance boundaries, and liability limitations. For enterprise private deployments, mechanisms for model version freezing, evaluation regression, grayscale release, rollback, and auditing should be established. Open source does not mean no governance, and being business-friendly does not mean exemption from review. Only by integrating evaluation, guardrails, logging, and permissions into the delivery process can coding and security capabilities move from demonstration to production.

    7. Implementation Checklist

    1. Establish a stable baseline with a fixed base, focusing post-training on engineering, security, and long-task shortcomings.
    2. Replace subjective scoring with verifiable rewards, incorporating compilation, unit tests, regressions, root causes, and minimal patches into the reward function.
    3. Build repository-level and security-level evaluation matrices, reporting passing criteria, failure cases, and costs.
    4. Set up sandboxes, permissions, auditing, and manual review for security capabilities to prevent dual-use abuse.
    5. Control token costs using context indexing, caching, routing, and verifiers.
    6. Complete license, SBOM, security assessment, and red-teaming loops before release.

    Overall, combining a fixed base with specialized reinforcement learning post-training is a more pragmatic engineering route. It does not rely on exaggerated parameter narratives but grounds capability improvements in verifiable tasks, reproducible evaluations, and controllable costs. For developers, this means a more stable repository-level coding assistant; for enterprises, it means a more governable security analysis and private deployment path.