Merging General Chat and Code Models: A Technical Guide to Upgrading Large Language Models

    This article explains why general chat and code models were combined into one model. It covers parameter-level merging, joint fine-tuning, and unified preference alignment. It also describes the final post-training release, which strengthened math reasoning, code generation, and creative writing, and it outlines the web search and file upload components. The article closes with practical guidance for developers choosing and building similar systems.

    1. Background: Why Merge Models

    In the evolution of large language models, a common pattern is “capability divergence.” Models built for general conversation excel at open-ended Q&A, writing, and instruction following. Models built for code excel at code completion, bug fixing, and algorithm implementation. Both usually start from the same base model, then follow different paths through instruction tuning data and preference alignment strategies, each pushing toward its own strengths.

    This divergence creates problems for end users. Real usage is often mixed. A developer may want a model that explains an error log and also writes the fix. A marketing team may want a model that drafts copy and also generates a data processing script. Users end up switching between models, which causes several typical pain points:

    1. Fragmented context: Conversation history and code context live in separate model sessions, so information cannot be shared, and interaction becomes inefficient.
    2. Uneven capability: General models tend to be weak at code, while code models often produce stiff natural language. A single model rarely covers compound tasks well.
    3. High maintenance cost: For platform providers, maintaining two model product lines doubles the investment in training, evaluation, and deployment.

    Merging general conversation and code capabilities into one model is therefore a natural next step. The upgraded version of this model series applies that idea. It combines the previous general conversation model and the code model into one. After merging, it further aligns with human preferences, with a focus on improving writing tasks and instruction-following scenarios.

    2. The Core Technical Approach

    2.1 Model Merging, Not Simple Ensembling

    The merge happens at the parameter level. It is not a multi-model routing system or an ensemble that calls several models. Common techniques include:

    • Weight merging from a shared base: When two branch models come from the same base, their weights can be combined through interpolation or task vector merging. This adds the “capability deltas” from each fine-tuning run into one shared parameter space.
    • Joint fine-tuning on mixed data: General instruction data and code instruction data are mixed at a set ratio. The merged model then undergoes light joint fine-tuning to reduce capability conflicts and forgetting.
    • Unified alignment training: One round of human preference alignment runs on the merged model. This keeps conversation style and safety policies consistent across both capability types.

    Parameter-level merging keeps inference cost identical to a single model. Both capabilities also live in the same representation space, where they can reinforce each other. For example, code reasoning can transfer positively to logical writing.

    2.2 Deeper Human Preference Alignment

    This merged version includes targeted reinforcement of alignment. A common alignment pipeline in the industry includes two stages: supervised fine-tuning (SFT) and reward-model-based preference optimization.

    1. Base model
    2. ├── SFT (instruction tuning, mixed general and code data)
    3. ├── Reward model training (based on human preference annotation data)
    4. └── Preference optimization (DPO/PPO-style algorithms, iterated over multiple rounds)

    Alignment results are typically measured against industry-recognized public benchmarks. On a challenging adversarial dialogue benchmark, the model’s win rate rose from about 68% to about 76%. Its score on open-ended instruction-following evaluation also reached a top level in the industry. These results show that deeper preference alignment did more than improve subjective impressions of conversation. It produced consistent gains on reproducible automated metrics.

    Developers should treat benchmark scores as a reference, not as the only basis for decisions. When selecting a model, build an evaluation set that reflects your own business. It should cover real task distributions, input lengths, and style requirements.

    3. The Final Release: Post-Training and Feature Expansion

    In the last stage of this series, the official team released a final fine-tuned version in December of the same year. This release marked the end of this generation’s iteration. It shows that post-training can keep delivering gains late in a model’s lifecycle.

    3.1 Targeted Capability Reinforcement

    The final version strengthens several high-frequency scenarios:

    • Mathematical reasoning: Training data with complete reasoning chains helps the model perform better on step-by-step derivations and formula calculations. This reduces errors caused by skipped steps.
    • Code generation: More instruction samples across multiple languages and frameworks improve performance on complex engineering tasks, such as understanding cross-file context and generating unit tests.
    • Writing and role-play: Additional data on stylized writing and persona consistency helps the model keep settings stable and tone coherent in long-form creation. This matters most for content production applications.

    The lesson from this stage is that post-training is not a one-time step. It can be a continuous process, run in batches by capability area. Each targeted fine-tuning run should include regression evaluation to prevent gains in one area from degrading others.

    3.2 Web Search Integration

    The final version adds web search. In essence, this is a server-side, systematic implementation of retrieval-augmented generation (RAG). A typical architecture works as follows:

    1. Query rewriting: The model rewrites the user’s question into one or more search queries based on the conversation context.
    2. Real-time retrieval: A search service fetches time-sensitive web content.
    3. Content fusion: The retrieved results are added to the context, and the model generates an answer with sources.

    This capability reduces the inherent limitation of a model’s knowledge cutoff. Answers can cover events and data published after the training data was collected. Enterprise developers who want to build similar functionality can assemble their own retrieval-augmented pipeline. They can use general search APIs, object storage, and vector retrieval services. They can also monitor retrieval hit rate and citation accuracy through logging services and monitoring and alerting tools.

    3.3 File Upload Module Improvements

    Improvements to file handling also deserve attention. In engineering terms, this module usually covers document parsing (converting various formats into structured text), long-text chunking, and context window management. The improvements focus on parsing accuracy for documents with complex layouts and on recall completeness for question answering over long documents. For teams building their own applications, document parsing quality is often the most underestimated bottleneck in the pipeline. Test it on the document types your business uses before integrating.

    4. Practical Lessons and Selection Guidance

    Looking back at this generation’s full iteration, from separate general and code models to a merged version and then a final post-training release, several lessons apply broadly to developers and enterprise users:

    1. Capability merging is a major trend: For compound task scenarios, a single merged model usually offers a better overall experience and lower deployment cost than a combination of multiple models.
    2. Preference alignment sets the experience ceiling: Beyond base capability, alignment quality directly determines performance on subjective tasks such as writing and instruction following.
    3. Post-training is an ongoing investment: Staged, targeted fine-tuning can extend a model’s capabilities without retraining the base model.
    4. Engineering infrastructure matters as much as the model: Peripheral capabilities such as web retrieval and file parsing often determine the minimum usability of a model in real business settings.

    Teams that want to deploy these capabilities quickly on the cloud can use the general large model inference services, container platforms, and object storage that cloud providers offer. They can then build retrieval augmentation and evaluation systems on their own data, forming a loop that supports continuous iteration.

    5. Conclusion

    The path from merging two models to the final post-training release shows a clear pattern in modern large models: merge, align, then enhance. The technical logic behind this pattern includes parameter-level merging, preference alignment, targeted post-training, and retrieval augmentation. Understanding that logic is more valuable over time than focusing on the benchmark scores of any single release. These methods also apply when developers evaluate and select models, or build their own. They are worth testing and refining in practice.