Core Technical Routes of Chinese LLMs: An Analysis and Practice Guide
The article explores the evolution of Chinese large language models (LLMs) from imitating existing architectures to pioneering independent technical routes. It delves into three key directions: Mixture of Experts (MoE) architectures, the balance between long context handling and model lightweighting, and multimodal fusion. Additionally, it provides practical selection criteria and engineering best practices for developers looking to implement these models in real-world applications.
Core Technical Routes of Chinese LLMs: An Analysis and Practice Guide
Introduction: From Following to Independent Technical Evolution
The proposal of the Transformer architecture in 2017 opened a new era for large language models (LLMs). In the following years, the Chinese AI industry underwent a profound transformation from imitation to independent innovation. Early domestic models mostly reproduced and chased existing architectural routes. However, after 2023, an increasing number of teams began exploring differentiated paths in model architecture, training paradigms, and context processing, gradually forming a technological landscape with distinct characteristics.
Understanding the fundamental differences between these technical routes is crucial for developers in model selection, architecture design, and application deployment. This article analyzes three of the most representative directions: Sparse Architecture (MoE), Long Context & Lightweighting, and Multimodal Fusion, along with the engineering trade-offs behind them.
1. Mixture of Experts Architecture: Trading Sparse Activation for Scale and Efficiency
1.1 Core Idea of MoE
The core idea of the Mixture of Experts (MoE) architecture is “specialization”: instead of having all parameters participate in every computation, the feed-forward network (FFN) layer is split into multiple “expert” sub-networks, and each token is routed only to a few of the most relevant experts for processing.
This design brings a key advantage: the total number of model parameters can be very large, while the number of activated parameters during a single inference remains controllable. For example, an MoE model with a total parameter count of over 200 billion might only activate tens of billions of parameters during each forward pass, achieving an excellent balance between inference cost and model capacity.
1.2 Gating Router Mechanism
The key component of MoE is the gating network (Router). It calculates routing weights for each expert using the softmax function and selects the Top-K experts to participate in the computation:
import torchimport torch.nn.functional as Fdef moe_router(hidden_states, router_weight, top_k=2, temperature=1.0):# hidden_states: [batch, seq_len, hidden_dim]logits = torch.matmul(hidden_states, router_weight) # [batch, seq_len, num_experts]# The temperature coefficient adjusts the sharpness of the distributionprobs = F.softmax(logits / temperature, dim=-1)top_k_probs, top_k_indices = torch.topk(probs, top_k, dim=-1)# Normalize the weights of the selected expertstop_k_probs = top_k_probs / top_k_probs.sum(dim=-1, keepdim=True)return top_k_probs, top_k_indices
The temperature coefficient is a key tuning knob: a higher temperature leads to a more uniform distribution, where more experts are activated evenly, which is beneficial for training stability; a lower temperature creates a sharper distribution, where only the top-ranked few experts are selected, making inference more efficient but potentially losing diversity.
1.3 Engineering Challenges
MoE is not a free lunch; its deployment requires solving several typical problems:
- Load Balancing: If routing is consistently biased towards a few experts, it will cause some experts to be overloaded while others are undertrained. Auxiliary load balancing loss is usually introduced to penalize unbalanced routing distributions.
- Memory Footprint: Although the number of activated parameters is small, all expert parameters must reside in memory, posing higher requirements for memory planning during inference deployment.
- Communication Overhead: In distributed training, tokens need to be routed across devices to corresponding experts, making all-to-all communication a performance bottleneck that requires meticulous parallel strategy design.
In addition, some teams have made supporting innovations in attention mechanisms. For example, the Multi-head Latent Attention (MLA) approach compresses the KV cache into a low-rank latent space, significantly reducing memory overhead during long-sequence inference, which synergizes well with MoE.
2. Long Context and Lightweighting: Two Seemingly Contradictory Paths
2.1 Technical Value of Long Context
Long context capabilities allow models to process entire books, large codebases, and lengthy legal documents at once. Their value lies in: reducing semantic fragmentation caused by document chunking, supporting more complete code understanding, and enabling global reasoning across chapters.
Implementing long context primarily relies on the following technical methods:
- Position Encoding Extrapolation: Based on Rotary Position Embedding (RoPE) interpolation and base frequency adjustment, allowing the model to maintain position perception on sequences exceeding training lengths.
- Attention Sparsification and Approximation: Using sliding window attention, chunked attention, etc., to reduce attention complexity from O(n²) to near-linear.
- KV Cache Optimization: Controlling memory growth during long-sequence inference through Grouped Query Attention (GQA), KV quantization, and cache eviction strategies.
- Long Text Training Data Construction: Through document concatenation and synthesizing cross-paragraph dependency tasks, enabling models to truly learn to utilize distant information rather than just “fitting it in”.
Note that “supporting a long context window” and “effectively utilizing long context” are two different things. The industry commonly uses the “Needle-in-a-Haystack” test to verify a model’s real ability to retrieve key information in long texts.
2.2 Lightweighting: Moving Models to the Edge and Endpoints
The goal of the lightweighting route is to reduce model deployment costs while preserving capabilities as much as possible, enabling models to run on consumer-grade hardware or even mobile terminals. Key technologies include:
- Knowledge Distillation: Using the output distribution of a large model (teacher) to guide the training of a small model (student), allowing the small model to approximate the large model’s behavior.
- Quantization: Compressing weights from FP16 to INT8, INT4, or even lower, significantly reducing memory and bandwidth requirements with controllable precision loss in typical scenarios.
- Pruning and Structural Optimization: Removing redundant attention heads or layers and designing more efficient model structures.
# Pseudo-code for quantized loading (general process)model = load_model(model_path,dtype="int4", # 4-bit quantized weightsgroup_size=128, # Quantization group sizeuse_activation_scaling=True)
2.3 Unifying the Two Paths
Long context and lightweighting seem contradictory, but they can be unified in engineering: through KV cache compression and sparse attention, medium and small-scale models can also efficiently process long texts. For enterprise applications, “sufficiently long context + affordable deployment cost” is often more practically valuable than sheer parameter size.
3. Multimodal Fusion: From Language to Vision and Speech
3.1 Basic Paradigm of Multimodal Architecture
The mainstream architecture of multimodal large models is “Encoder + Projector + Language Model”: the visual encoder splits images into patches and extracts features, the projector maps visual features into the embedding space of the language model, and finally, the language model unifies cross-modal understanding and generation.
3.2 Key Technical Points
- Efficient Representation of Visual Tokens: High-resolution images generate a large number of visual tokens, which need to be compressed through pooling, resampling, etc., to control sequence length.
- Cross-Modal Alignment Training: Utilizing large-scale image-text pairs for contrastive learning and instruction fine-tuning to align the two modalities in the semantic space.
- Multimodal Instruction Data Construction: Covering real scenarios like image QA, document understanding, chart parsing, and OCR, which determines the upper limit of the model’s practical capabilities.
Multimodal capabilities are highly valuable in enterprise scenarios: structured extraction of contracts and receipts, automatic generation of industrial inspection reports, and data interpretation of complex charts are all needs that pure text models cannot cover.
4. Selection and Practice Recommendations
Faced with different technical routes, developers should weigh options based on business needs:
| Business Need | Recommended Route |
|---|---|
| High-concurrency API services, balancing cost and capability | MoE sparse architecture models |
| Long document/codebase analysis | Models with strong long-context capabilities |
| Private, edge deployment | Lightweight small-parameter models |
| Image-text mixed understanding | Multimodal models |
When implementing these models, it is recommended to follow these best practices:
- Evaluation-Driven Selection: Construct an evaluation set tailored to your business rather than solely relying on public leaderboards.
- Control Inference Costs: Reasonably utilize quantization, batch inference, and cache reuse. For cloud deployment, general infrastructure capabilities like container platforms, monitoring, and logging services can be combined to build elastic inference services. For example, model service platforms and computing resources provided by Baidu AI Cloud can help enterprises quickly complete model deployment and elastic scaling.
- Focus on Data-Level Alignment: Fine-tuning with domain data and Retrieval-Augmented Generation (RAG) often bring higher cost-effectiveness than switching to a larger model.
- Pay Attention to Composability: Integrating large models as one component of a system, combined with knowledge bases, tool calling, and workflow orchestration, is necessary to release real business value.
Conclusion
The technical evolution of Chinese LLMs has moved from single-point architectural innovation to systematic engineering competition. MoE sparsification resolves the contradiction between scale and cost, long context and lightweighting expand application boundaries, and multimodal fusion opens up a broader perception space. For developers, understanding the technical principles and trade-offs behind these routes is far more important than chasing a specific model version—because architectures iterate, but technical ideas will endure.
