A Practical Guide to Capability Fusion and Preference Alignment in General-Purpose LLMs

    This article explains why general-purpose LLMs need capability fusion rather than simply stacking separate chat and code models, and walks through the key engineering steps: fixing baselines, balancing data mixtures, aligning outputs with human preferences, and building a layered evaluation system. It also covers final-stage fine-tuning, regression testing, and practical rollout tips for turning model upgrades into stable user experiences.

    1. Why Capability Fusion Beats Simply Stacking Models

    In LLM engineering, teams often run into a familiar problem. A general-purpose chat model feels natural at open-ended writing and multi-turn Q&A, but it struggles with stability on code completion, cross-file understanding, and strict syntax constraints. A code-specialized model is strong at structured generation, yet it can feel rigid in natural language fluency and instruction generalization. The early workaround was usually to maintain two separate models per scenario and let the business layer handle routing. That approach has clear drawbacks: routing rules are brittle, maintenance costs add up, and the user experience feels fragmented.

    The goal of capability fusion is to preserve both general conversation ability and code handling ability inside a single model, and then align its behavior with human preferences on top of that. Fusion is not a simple addition of parameters. It reorganizes the training and fine-tuning pipeline around two objectives: capability retention and preference optimization. At minimum, engineering has to answer three questions: which capabilities must be preserved, which behaviors need to be suppressed, and what metrics prove that fusion has not caused capability regression.

    2. Key Technical Steps in a Fusion Upgrade

    2.1 Capability Inventory and Baseline Lock-In

    Before making changes, lock in two baselines: a general conversation baseline and a code baseline. The baselines should cover writing, instruction following, code generation, code explanation, and math reasoning, along with a documented evaluation methodology. Without baselines, you cannot tell where later gains actually come from.

    2.2 Data Mixing and Conflict Resolution

    General text and code differ sharply in distribution, and mixing them directly can dilute one side’s capability. A common strategy is staged mixing: start with a larger share of general data to maintain general ability, then gradually raise the weight of code samples. At the same time, introduce mixed instruction samples, such as asking the model to explain the intent of a piece of code in natural language, so it learns to switch expression modes within the same context.

    2.3 Preference Alignment and Instruction Following

    Preference alignment aims to make outputs fit human review habits, not just sound fluent. In practice, teams use a closed loop of candidate generation, preference ranking, and iterative optimization: generate multiple candidates for the same prompt, have humans or rule-based reviewers produce a preference order, and adjust model behavior accordingly. Instruction-following optimization focuses on strictly respecting format constraints, not expanding task scope on its own, and proactively asking for clarification when information is insufficient.

    2.4 Evaluation System Design

    Split evaluation into three layers:

    • Capability layer: writing quality, instruction-following rate, code runnable rate.
    • Safety layer: interception of unauthorized instructions, sensitive content, and incorrect advice.
    • Experience layer: multi-turn consistency and clarity of response structure.

    An illustrative evaluation record can look like this:

    1. {
    2. "task_type": "code_explain",
    3. "instruction_following": 0.92,
    4. "runnable_rate": 0.88,
    5. "human_preference_win_rate": 0.76,
    6. "notes": "Format constraints well respected; minor omissions in long context"
    7. }

    3. Final Fine-Tuning: From Usable to Good

    The final release in a model series usually does not add new capabilities. It fills gaps. Typical updates include improving the step completeness of math reasoning, raising the runnable rate of generated code, improving structure in writing tasks, and strengthening persona consistency in role-play tasks. Meanwhile, the product side often improves file upload parsing and web retrieval in parallel, so the model can bring in external information for time-sensitive questions instead of relying on parametric memory.

    For developers, the most important part of this stage is regression testing. Any fine-tuning run can cause capability regression, so keep a fixed evaluation set and a fixed prompt set, compare version by version, and avoid fixing A while breaking B.

    4. Practical Recommendations

    1. Start with a small-scale canary, build a regression set from real business prompts, then ramp up gradually.
    2. Automate instruction-following and format-compliance checks to reduce manual sampling costs.
    3. Add executability validation for code outputs, such as syntax checks and unit test skeleton generation.
    4. For web retrieval, make citation sources and freshness boundaries explicit to reduce hallucination risk.
    5. Maintain a version ledger that records evaluation deltas for each fine-tuning run, forming a traceable iteration loop.

    5. Conclusion

    Fusing general conversation and code capabilities is essentially a careful balance of capability retention and preference optimization within limited model capacity. Once a team understands the four pillars of baseline lock-in, data mixing, preference alignment, and regression evaluation, it can complete model selection and integration with lower trial-and-error cost and turn technical upgrades into a stable user experience.