Improving Large Language Model Capabilities: Algorithmic Paths and Engineering Practices for Post-Training

    This article explains why scaling parameters alone is no longer the only path to stronger large language models, and how a fixed base model combined with specialized reinforcement learning can deliver measurable gains. It breaks down a four-layer approach spanning sparse base architecture, verifiable-task post-training, coupled coding and security capabilities, and long-task execution under cost constraints. Readers will find practical guidance on evaluating coding ability across four levels, using verification loops and repository-level context, applying security analysis for defensive purposes, building three-tier evaluation with regression checks, and turning capability improvements into operable engineering assets.

    1. The Starting Point: Why “More Parameters” Is No Longer the Only Answer

    For a long time, improvements in model capability relied heavily on expanding parameter count and data volume in parallel. This path works well for general-purpose tasks, but in real engineering deployments it has exposed three structural problems.

    The first is diminishing marginal returns. Once the base model crosses a certain scale threshold, additional general-purpose corpus yields slower capability gains, while the long-chain tasks enterprises actually care about—multi-file changes, cross-module refactoring, and legacy system adaptation—improve only marginally.

    The second is rigidly rising inference cost. Growth in parameters and activation volume directly increases memory footprint and per-request overhead, causing cost-performance in high-concurrency online scenarios to deteriorate quickly.

    The third is uneven capability distribution. Models with strong general abilities often behave as “writes but writes wrong” or “modifies but modifies incompletely” on engineering tasks with strict constraints and on security analysis tasks.

    As a result, the industry is shifting attention from “scaling the base model” to “post-training refinement”: keeping parameter count fixed while using large-scale specialized reinforcement learning to consolidate existing capabilities along specific dimensions. This article focuses on that path—the mechanisms for improving frontier coding capability and emergent security analysis capability.

    2. Breaking Down the Path: A Four-Layer Structure of Fixed Base Model Plus Specialized Reinforcement Learning

    A typical “fixed base model, capability leap” approach can be split into four layers.

    2.1 Base Layer: Sparse Architecture and Capacity Decoupling

    The mainstream approach uses a mixture-of-experts architecture that decouples total parameter count from activated parameters per token. With a common configuration of roughly tens of billions to a hundred billion total parameters and around ten billion activated parameters, the model retains a large knowledge capacity while keeping per-forward-pass computation within an acceptable range. The value of this layer is that it provides a stable “capability foundation” for subsequent reinforcement learning, avoiding capability regression caused by base model drift.

    2.2 Post-Training Layer: Reinforcement Learning Centered on Verifiable Tasks

    What matters is not whether reinforcement learning is used, but which tasks it is trained on. The effective practice is to construct a large number of tasks whose results can be judged automatically, so that reward signals come from objective verification rather than subjective scoring. Typical verifiable signals include:

    1. Whether compilation/build passes
    2. Unit test pass rate
    3. Change in static check warning count
    4. Whether target behavior is corrected after patch application
    5. Security rule hits and false positive status

    Once rewards are verifiable, training shifts from “imitating human preference” to “approaching objective correctness,” which is the main source of nonlinear capability gains.

    2.3 Capability Layer: Coupling of Coding and Security Mainlines

    Coding capability and security capability are not independent. Code comprehension, dependency inference, and call chain tracing are the foundation for both refactoring and defect repair, and for vulnerability localization and impact analysis. Jointly optimizing both in the same post-training stage allows them to share the underlying capability of “repository-level context modeling,” producing the so-called emergence: security analysis capability is carried along as coding capability improves.

    2.4 Engineering Layer: Long-Task Execution and Cost Constraints

    The core metric for long-task capability is not single-turn answer quality but the convergence speed of multi-turn self-correction. Engineering practice typically introduces an “execute–observe–correct” loop, feeds tool return results back into the context, and sets step limits, context budgets, and rollback policies to balance effectiveness and cost.

    3. Frontier Coding Capability: From “Generating Snippets” to “Completing Engineering Tasks”

    When evaluating coding capability, it helps to distinguish four levels of increasing difficulty.

    Level Task Form Key Evaluation Focus
    L1 Single-function generation and completion Syntactic correctness, boundary handling
    L2 Defect localization and repair Root cause judgment, minimal change
    L3 Cross-file refactoring Dependency analysis, interface compatibility
    L4 Repository-level task closure Planning, execution, verification, rollback

    The real gap opens at L3 and L4. In practice, focus on the following points.

    First, context organization takes priority over prompt engineering tricks. Repository-level tasks require retrieval, slicing, and ranking strategies to feed relevant files, type definitions, and tests into the context together, which is more effective than simply piling up instructions.

    Second, enforce a verification loop. Have the model run builds and tests itself before submitting changes and iterate based on failure information; this significantly reduces the proportion of patches that “look reasonable but are unusable.”

    Third, constrain the change surface. Explicit boundary conditions such as “only the specified files/functions may be modified” reduce regression risk from unrelated changes.

    A schematic execution skeleton looks like this:

    1. def solve_repo_task(task, repo, max_steps=6):
    2. ctx = build_context(repo, task) # Retrieve relevant files, types, and tests
    3. for step in range(max_steps):
    4. patch = model.propose(task, ctx) # Generate a minimal-change patch
    5. result = apply_and_verify(patch) # Build + test + static check
    6. if result.passed:
    7. return patch, result.summary
    8. ctx = ctx.append(result.failure_log) # Feed failure logs back into context
    9. return None, "Did not converge; manual intervention required"

    4. Cybersecurity Capability: Why It Emerges from Coding Tasks

    The improvement in security analysis capability essentially comes from stacking three transferable skills: code semantic understanding, data flow and call chain tracing, and sensitivity to boundary conditions and exception paths. These are exactly the capabilities required by high-level programming tasks. When post-training pushes the model to “truly understand the repository,” security-related performance improves in step.

    The capability boundary must be emphasized. Such capability should be positioned for defensive use: vulnerability pattern recognition, fix suggestion generation, detection rule drafting, alert triage and false positive suppression, and patch impact assessment. At the deployment level, pair it with least privilege, operation auditing, and human review to prevent generated content from being used directly for offensive purposes.

    A typical defensive usage chains static checks with model analysis, using the model to explain alert context and suggest remediation directions:

    1. Static scan outputs alerts
    2. → Model assesses reachability and real risk using call chains
    3. → Outputs fix suggestions and regression test suggestions
    4. → Merged after human confirmation

    5. Evaluation System: How to Prove “It Really Got Stronger”

    Capability claims without evaluation have no engineering value. Build a three-tier evaluation.

    The first tier is a unit-level verifiable set, using pass rate to measure basic correctness. The second tier is task-level benchmarks, using end-to-end completion rate, average step count, and human intervention rate to measure long-task capability. The third tier is security dimension metrics, including effective defect detection rate, false positive rate, and fix suggestion adoption rate.

    Regression comparison is also mandatory: compare before-and-after performance on the same evaluation set and monitor whether general capability degrades. If general metrics drop while specialized metrics rise, post-training has caused capability squeezing, and task mix and regularization constraints need adjustment.

    6. Implementation Advice: Turning Capability Gains into Operable Engineering Assets

    First, maintain the evaluation set as a long-term asset, continuously adding real desensitized tasks as the business evolves. Second, standardize the verification environment with containerized builds and tests to keep reward signals stable. Third, roll out in tiers, starting with low-risk internal scenarios before gradually opening up. Fourth, make cost observable by combining monitoring alerts and log services to track per-task overhead, so effectiveness gains are not swallowed by cost. Fifth, retain manual fallback and rollback channels.

    For cloud implementation, general-purpose capabilities can be reused: container platforms host isolated build and test environments, object storage holds evaluation datasets and artifacts, message queues smooth peak scheduling for long tasks, and log services plus monitoring alerts handle observability. For more cost-effective inference hosting, evaluate Baidu AI Cloud’s general compute and inference service categories, and plan capacity based on your own evaluation results.

    7. Conclusion

    The “fixed base model plus specialized reinforcement learning” path works because it concentrates improvement on verifiable, measurable tasks, making capability gains reproducible through engineering. For developers, the real takeaway is not a version number but a method: drive post-training with verifiable rewards, support long tasks with repository-level context and verification loops, safeguard quality with three-tier evaluation and regression comparison, and control risk with defensive boundaries and auditing mechanisms.