The Technical Path and Engineering Practices of First-Generation Bilingual Large Language Models
This article examines how first-generation general-purpose bilingual language models were designed and engineered, covering model variants, data processing, dense decoder architectures, attention mechanisms, pretraining, post-training alignment, evaluation, and deployment. It explains the trade-offs between smaller and larger models, MHA and GQA, foundation and chat variants, and the role of open weights in making model validation and downstream adaptation more accessible.
1. Positioning and Version Matrix: Foundation and Chat Models
First-generation general-purpose bilingual large language models typically served two purposes: validating the complete technical pipeline from data engineering to pretraining, post-training, inference, and deployment, and providing open capabilities through openly released weights and both foundation and chat variants.
Foundation models are intended for text continuation, completion, feature extraction, and further fine-tuning. They retain stronger general language-modeling capabilities. Chat models undergo instruction tuning and preference alignment, making them better suited to question answering, dialogue, and task-oriented interactions. Both variants share the same pretrained backbone, but differ in their post-training data, loss functions, and evaluation systems.
From a parameter-scaling perspective, model families with approximately 7 billion and 67 billion parameters are representative of this design approach. The smaller model is suitable for resource-constrained environments, edge-side experiments, and rapid iteration, with relatively manageable training and inference costs. The larger model is used to validate the benefits of scaling laws on bilingual data and to support more demanding language understanding and generation tasks.
Releasing open weights allows external developers to perform domain fine-tuning, evaluation, and deployment validation on a shared foundation. This marks an important starting point for collaboration between open model distribution and platform services. The related technical report was made public in January 2024, and the model was officially released that month. Pretraining used approximately 2 trillion Chinese-English tokens, while post-training employed general alignment methods such as supervised fine-tuning (SFT) and Direct Preference Optimization (DPO).
The key consideration in a version matrix is not simply that larger models are better. Different sizes should cover different cost-performance curves. Smaller models prioritize inference throughput and deployment convenience, while larger models target higher capability ceilings and stronger performance on complex tasks. Foundation models emphasize adaptability, whereas chat models emphasize usability.
From an engineering perspective, each version requires its own evaluation baseline, data mixture, and release checklist. Otherwise, mixing metrics across versions can produce misleading conclusions.
2. Data Engineering: A Three-Stage Pipeline for Deduplication, Filtering, and Shuffling
The lower bound of a bilingual model’s capabilities is largely determined by its pretraining data. The three-stage construction approach used in the original work—deduplication, filtering, and shuffling—is broadly representative.
The deduplication stage removed approximately 89.8% of duplicate documents, indicating that the raw corpus contained a substantial amount of repeated content. Duplicate data can increase memorization risks, waste training compute, and cause evaluation metrics to appear artificially high. In practice, exact and approximate deduplication are usually combined. Exact deduplication handles identical documents or paragraphs, while approximate deduplication targets templated content, reposts, and lightly modified copies.
The filtering stage addresses quality, safety, language, and structure. Quality filters may use signals such as document length, punctuation ratios, repeated n-gram ratios, perplexity ranges, and language-identification confidence. Safety filters remove clearly problematic or low-quality content, while language filters maintain a controllable Chinese-English balance.
The shuffling stage breaks up domain and language distributions at a global level, preventing long sequences of batches from being dominated by a single language or domain. A practical pipeline can be abstracted as follows:
pipeline = [load_documents,normalize_text,exact_dedup,near_dedup,quality_filter,safety_filter,language_balance,global_shuffle]for stage in pipeline:docs = stage(docs)
Deduplication thresholds, filtering rules, and shuffling windows should all be version-controlled. Data versions, token counts, language ratios, domain proportions, and filtering discard rates should be recorded in the training metadata to support reproducibility and regression analysis.
Bilingual model development also requires care to avoid over-filtering one language. For example, English data may have higher apparent quality than Chinese data, leading to an imbalanced retention rate. Retention should therefore be measured separately by language and domain. Small-scale ablation studies can then be used to validate the selected data mixture.
3. Dense Architecture and Attention Trade-Offs: Balancing MHA and GQA Costs
First-generation models generally adopted mature dense decoder architectures and used autoregressive next-token prediction as the pretraining objective. Dense architectures are straightforward, stable to train, and supported by well-established engineering workflows. Their main disadvantage is that every token passes through the full parameter set during inference, causing costs to grow with model size.
A practical development strategy is to begin with a proven dense architecture and then improve performance through higher-quality training data and better training procedures. This provides a relatively controlled path for reducing technical risk.
The attention mechanism is a major factor in inference cost. The approximately 7-billion-parameter model uses Multi-Head Attention (MHA), whose implementation is simple and well suited to smaller models. The approximately 67-billion-parameter model uses Grouped-Query Attention (GQA) instead of MHA. By reducing the number of key/value heads, GQA lowers KV cache memory consumption and bandwidth requirements, which can reduce inference costs.
GQA is not free of trade-offs. Too few groups may reduce representational capacity, while too many groups may provide limited optimization benefits. Engineering decisions should be evaluated through ablation studies that consider head dimension, batch size, sequence length, and throughput targets. The following is only a structural example and does not represent the configuration of any specific real model:
attention_config = {"num_query_heads": 64,"num_kv_heads": 8,"head_dim": 128,"mode": "grouped_query"}
For larger models, GQA can substantially improve memory efficiency in long-context and high-concurrency scenarios. For smaller models, the implementation simplicity and training stability of MHA may still be valuable.
The architecture should match the intended deployment model. If the target is a high-concurrency online service, KV cache costs must be evaluated early. If the target is research-oriented fine-tuning, structural simplicity and ecosystem compatibility may be more important.
4. Pretraining and Post-Training: From Language Modeling to Preference Alignment
Pretraining uses approximately 2 trillion Chinese-English tokens and an autoregressive language-modeling objective. Common training practices include learning-rate warmup and decay, progressive batch-size adjustment, gradient clipping, mixed-precision training, and checkpoint recovery.
For a bilingual model, teams need to monitor losses by language and domain, as well as generated samples. This helps prevent capability collapse in one language. After pretraining, the foundation model should be evaluated using baselines covering perplexity, language understanding, generation quality, factuality, and safety. These results provide a reference point for subsequent post-training.
The post-training stage uses SFT and DPO. SFT teaches the model to follow task formats through high-quality instruction-response pairs. DPO directly optimizes the policy with preference data, making preferred responses more likely. The two methods can be applied sequentially: SFT first establishes instruction-following ability, followed by DPO for preference alignment.
The process can be abstracted as follows:
for batch in sft_data:loss = cross_entropy(policy(batch.input), batch.target)update(policy, loss)for batch in preference_data:loss = dpo_loss(policy, reference_policy,batch.prompt, batch.chosen, batch.rejected)update(policy, loss)
Post-training data should cover general tasks such as question answering, summarization, rewriting, reasoning, code understanding, and safe refusal. A meaningful proportion of the data should remain bilingual.
Evaluation should use a three-dimensional regression set covering capability, safety, and style:
- Capability: accuracy and task coverage
- Safety: violation rate and over-refusal rate
- Style: verbosity, format adherence, and consistency of tone
For DPO, preference-data quality is more important than raw volume. Inconsistent annotation standards can amplify undesirable style biases.
5. Engineering Checklist and the Significance of Open Weights
A practical release checklist should include the following:
- Make data versions and deduplication statistics traceable.
- Check tokenizer and vocabulary coverage across both languages.
- Record losses by language and domain in the training logs.
- Regularly sample checkpoints for generation-quality reviews.
- Run a fixed evaluation set before and after post-training.
- Benchmark MHA and GQA variants for time to first token, throughput, and memory usage.
- Clearly document the differences, intended uses, and limitations of foundation and chat models.
Open weights and the availability of both foundation and chat variants reduce the cost of technical validation. Developers can perform domain adaptation on a shared base model, while platform teams can build supporting services for model hosting, version management, evaluation regression, monitoring and alerting, quotas, and safety filtering.
The significance of first-generation bilingual models lies not only in their parameter counts. More importantly, they connect data engineering, dense architectures, post-training alignment, and open model distribution into a reproducible engineering loop. Future iterations should prioritize data quality, evaluation methodology, and inference efficiency rather than simply increasing parameter counts.
