Architecture and Training Practices for a 130B-Parameter Chinese-English LLM
This article examines the architecture and engineering practices of a roughly 130-billion-parameter Chinese-English pretrained language model. It covers the 70-layer Transformer design, autoregressive blank infilling with multi-granularity masking, rotary position embeddings, deep normalization, GELU, bilingual data construction at the scale of about 400 billion tokens, training stability, distributed parallelism, inference optimization, downstream adaptation, and evaluation. The goal is to provide developers with a transferable framework for understanding and implementing large bilingual models under practical cost and hardware constraints.
1. Introduction: Technical Significance of a 100-Billion-Parameter Bilingual Model
As pretrained language models scale from billions to hundreds of billions of parameters, their capabilities in language understanding, generation, cross-lingual transfer, and complex reasoning continue to expand. A 100-billion-parameter model means more than a larger parameter capacity. It also moves training stability, memory management, data quality, parallelism strategy, and inference cost into a new engineering regime. For a model designed for both Chinese and English, the system must also handle differences between the two languages in morphology, syntax, semantic distribution, and corpus structure.
In this context, the core goal of a 100-billion-parameter bilingual pretrained model is not simply to make the model larger. It is to achieve high-quality bilingual representation learning at a controllable cost and to support inference deployment on limited hardware resources as much as possible. For example, running such a model on a single multi-accelerator server requires efficient coordination among model architecture, parallel partitioning, memory optimization, and inference scheduling.
This article uses a typical 100-billion-parameter bilingual pretrained model as its object and abstracts its technical architecture and engineering practices. It focuses on model structure, pretraining objectives, key operators, data scale, training stability, and inference optimization, aiming to provide developers with a transferable technical framework.
2. Overall Architecture: A General Language Model Design for Bilingual Tasks
The model adopts a general language model architecture with an overall parameter scale in the 100-billion range. Its core structure can be summarized by the following dimensions:
- Parameter scale: about 130 billion parameters;
- Network depth: 70 Transformer layers;
- Hidden size: 12,288;
- Maximum sequence length: 2,048;
- Training objective: autoregressive blank infilling;
- Language coverage: Chinese and English.
From an architectural perspective, 70 layers, a hidden size of 12,288, and a maximum sequence length of 2,048 jointly determine the model’s basic capacity and context modeling ability. A deeper model is more likely to form hierarchical semantic abstractions. A larger hidden size provides a richer representation space for each token. Sequence length affects the model’s ability to understand long documents, multi-turn dialogues, and complex contexts.
However, a 100-billion-parameter model cannot be built simply by stacking more layers and expanding the hidden size. As scale grows, gradient explosion, activation overflow, normalization instability, and memory bottlenecks become more pronounced. The architecture must therefore be paired with stable normalization strategies, position encoding schemes, and efficient activation functions to remain trainable at ultra-large scale.
3. Pretraining Objective: Autoregressive Blank Infilling and Dual Masking
The model uses autoregressive blank infilling as its main pretraining objective. Unlike traditional unidirectional language modeling or bidirectional masked modeling, blank infilling requires the model to recover masked text spans from context, using both preceding and following information.
The basic idea can be represented as follows:
Original text: A B C D E FMasked input: A [MASK] C [MASK] FTraining target: predict the masked B and D
This training approach has several advantages:
- More effective use of context: The model can learn not only from preceding dependencies but also from following clues;
- A task form closer to generation: A masked span can be a word, a phrase, or a continuous segment;
- Support for both understanding and generation: It can be used for semantic understanding as well as text completion and generation.
To strengthen the model’s ability to model information at different granularities, two masking strategies with different granularities are used during training. One favors local span masking for learning fine-grained language dependencies. The other favors longer spans or more global masking for modeling document-level semantics and long-distance dependencies. This combination helps the model form a more balanced representation capability across word, phrase, and paragraph levels.
An illustrative pseudocode example is shown below:
# Pseudocode: blank infilling training objectiveinput_ids = tokenize(text)masked_ids, labels = apply_span_masking(input_ids)logits = model(masked_ids)loss = cross_entropy(logits, labels)
Here, apply_span_masking can select short-span masking or long-span masking depending on the training stage, thereby controlling which levels of contextual relationships the model learns.
4. Key Technical Components: Position Encoding, Normalization, and Activation
At the 100-billion-parameter scale, whether a model can be trained stably often depends on engineering details in several foundational components. The architecture combines several widely used and large-scale-validated technical approaches.
4.1 Rotary Position Embedding
The Transformer itself has no explicit position awareness, so position encoding is required. Rotary position embedding applies a rotation transformation to query and key vectors, enabling the model to perceive relative positions between tokens. Compared with absolute position encoding, rotary position embedding has advantages in long-sequence modeling and position generalization.
Its core value includes:
- More natural expression of relative positions;
- Better transfer across texts of different lengths;
- Strong compatibility with autoregressive and blank infilling objectives.
4.2 Deep Normalization
In deep networks, the design of residual connections and normalization layers significantly affects training stability. Deep normalization scales the residual branch so that deep networks maintain more stable signal propagation at initialization. For a large structure such as 70 layers, this design can reduce the risk of loss oscillation and gradient anomalies in the early stage of training.
4.3 Gaussian Error Linear Unit
The activation function directly affects the model’s nonlinear expression capability and computational efficiency. The Gaussian Error Linear Unit introduces smoother nonlinearity on top of gated linear units, improving optimization stability while maintaining strong expressive capability. In ultra-large models, the choice of activation function affects not only accuracy but also memory usage and operator efficiency.
5. Data Construction: Bilingual Corpus Scale and Quality Control
The model uses a corpus of about 400 billion text tokens during training, with approximately 200 billion Chinese tokens and 200 billion English tokens. This data scale shows that the effectiveness of a bilingual large model depends not only on model structure but also heavily on corpus coverage and data quality.
High-quality bilingual pretraining data usually goes through the following pipeline:
- Source filtering: Cover diverse scenarios such as encyclopedias, news, Q&A, code, academic text, and dialogue;
- Language identification: Accurately distinguish Chinese, English, and other mixed text;
- Quality filtering: Remove low-quality, duplicate, advertising, garbled, and template-generated content;
- Deduplication: Reduce the interference of repeated corpora with model memorization and generalization;
- Sensitive content governance: Establish safety and compliance filtering mechanisms;
- Tokenization: Use an encoding scheme suitable for a large bilingual vocabulary to improve compression rate and training efficiency.
In bilingual scenarios, data mixing ratios are particularly important. If one language accounts for too high a proportion, the model may underperform in the other language. If the two languages are simply mixed without alignment, the model may struggle to form a stable cross-lingual semantic space. In practice, balanced sampling, language tag control, and curriculum-style training strategies are often used so that the model gradually adapts to the bilingual distribution at different stages.
6. Training Stability: A Core Challenge for Ultra-Large Models
One of the biggest difficulties in training a 100-billion-parameter model is stability over long training runs. Common problems include:
- Sudden loss increases;
- Abnormal gradient norms;
- Activation overflow;
- Improper learning rate scheduling;
- Communication bottlenecks caused by parallel partitioning;
- High checkpoint saving and restoration costs.
To address these problems, a complete training monitoring system is usually required. It should continuously observe loss, gradient norm, learning rate, throughput, memory usage, and communication time. At the same time, the training framework needs to support mixed precision, gradient accumulation, activation recomputation, optimizer state sharding, and fault-tolerant recovery.
An illustrative training loop is shown below:
for step, batch in enumerate(dataloader):with autocast():outputs = model(batch["input_ids"])loss = compute_loss(outputs, batch["labels"])loss.backward()clip_grad_norm_(model.parameters(), max_norm=1.0)optimizer.step()scheduler.step()optimizer.zero_grad()if step % log_interval == 0:log_metrics(loss, grad_norm, lr, throughput)
In engineering practice, it is advisable to split the training task into multiple observable stages, such as small-scale validation, data ratio validation, stability stress testing, and full-scale training. Each stage should have clear exit criteria so that problems are not carried into large-scale training.
7. Distributed Training and Inference Optimization
A 100-billion-parameter model cannot be fully hosted on a single compute device, so distributed parallelism is required. Common parallelism methods include:
- Data parallelism: Different devices process different data batches;
- Tensor parallelism: Split matrices within a layer across multiple devices;
- Pipeline parallelism: Assign different layers to different devices;
- Sequence parallelism: Partition the long-sequence dimension;
- Expert parallelism or parameter sharding: Further reduce per-device memory pressure.
The training stage focuses more on throughput and stability, while the inference stage focuses more on latency, memory, and concurrency. To support 100-billion-parameter inference on a single multi-accelerator server, the following strategies are usually combined:
- Model partitioning: Distribute different layers or matrices across multiple accelerators;
- Memory optimization: Use activation recomputation, KV cache compression, and memory reuse;
- Quantized inference: Reduce memory usage within an acceptable accuracy loss;
- Dynamic batching: Merge multiple requests to improve throughput;
- Request scheduling: Arrange queues based on input and output lengths;
- Cache reuse: Cache high-frequency prefixes or system prompts.
When implementing with general cloud engineering capabilities, container platforms can orchestrate inference services, object storage can store model files and checkpoints, logging services can record call chains, and monitoring and alerting systems can observe latency, memory usage, and error rates. The specific architecture should still be stress-tested and tuned according to the business workload.
8. Application Practices: From Pretraining to Downstream Task Adaptation
The value of a 100-billion-parameter bilingual model is ultimately reflected in downstream tasks. Common applications include:
- Chinese Q&A and English Q&A;
- Bilingual summarization and cross-lingual summarization;
- Text classification and sentiment analysis;
- Information extraction and structured generation;
- Dialogue completion and content creation;
- Code assistance and knowledge Q&A.
When adapting to downstream tasks, full-parameter fine-tuning of a 100-billion-parameter model is generally not recommended because it is costly and prone to overfitting. More common approaches include:
- Prompt engineering: Guide model output through task templates;
- Parameter-efficient fine-tuning: Train only a small number of adaptation parameters;
- Retrieval-augmented generation: Combine external knowledge bases to improve factuality;
- Distillation and compression: Transfer large-model capabilities to smaller models;
- Rule and model collaboration: Use rules to constrain outputs in high-risk scenarios.
For example, in an enterprise knowledge Q&A scenario, a “retrieval + large model generation” architecture can be used:
User question↓Retrieval module recalls relevant documents↓Construct prompt↓Large model generates answer↓Citation traceability and result verification
This approach can reduce the risk of model hallucination and improve answer traceability.
9. Evaluation System: How to Measure a Bilingual Large Model
Evaluating a 100-billion-parameter bilingual model cannot rely on a single metric. A multi-dimensional evaluation system should be established. It is recommended to cover the following dimensions:
- Language capability: Chinese understanding, English understanding, and cross-lingual translation;
- Generation quality: Fluency, relevance, and factual consistency;
- Reasoning capability: Logical reasoning, basic mathematics, and common-sense judgment;
- Long-text capability: Long-document summarization and context-based Q&A;
- Safety and compliance: Harmful content identification and sensitive topic control;
- Engineering metrics: First-token latency, throughput, memory usage, and concurrency stability.
For evaluation methods, automatic metrics and human evaluation can be combined. Automatic metrics are suitable for rapid regression testing, while human evaluation is better for judging semantic quality, factuality, and usability. For high-risk businesses, red-team testing and boundary-case coverage should also be added.
10. Conclusion
A 100-billion-parameter bilingual pretrained model represents an important direction for engineering large-scale language models. Its core is not only the parameter scale itself but also the systematic coordination among model architecture, pretraining objectives, data quality, training stability, distributed parallelism, and inference optimization. Through a general language model structure, autoregressive blank infilling, multi-granularity masking, rotary position embeddings, deep normalization, and efficient activation functions, the model can develop strong language understanding and generation capabilities in bilingual scenarios.
For developers, three priorities matter when deploying such models. First, build a high-quality bilingual data pipeline. Second, create an observable and recoverable distributed training system. Third, design an inference optimization and evaluation loop around real business scenarios. Only by combining model capability, engineering capability, and business context can a 100-billion-parameter model become stable and reliable technical productivity.
