General-Purpose LLMs Explained: From Blank-Infilling Pretraining to a Full Model Matrix
This article traces the evolution of a general-purpose large language model series—from an academic lab spin-off and a self-developed pretraining architecture to a complete model matrix spanning open-source lightweight models, commercial flagship models, multimodal models, and tool-using agents. It breaks down the autoregressive blank-infilling pretraining paradigm, explains why a tiered model matrix matters, and covers how to evaluate coding, long-context, and reasoning capabilities. It also examines multimodal and agent capabilities, the open ecosystem and multi-hardware adaptation, representative industry scenarios, and practical guidance on enterprise selection, deployment, inference optimization, and governance. The aim is to help developers see how architecture, model matrix, ecosystem, and engineering together determine the competitiveness of general-purpose LLMs.
1. Introduction: Beyond Single Benchmark Scores, Focus on the “System”
Over the past few years, large language models (LLMs) have moved from the lab into industry, and developers’ attention has gradually shifted from “how high can one model score on a benchmark” to “how can a family of models support complex business needs.” The reason is straightforward: real-world workloads typically mix high-frequency simple requests with low-frequency complex ones, each with different demands on latency, cost, and data compliance—and the models themselves keep evolving rapidly.
As a result, the value of a mature general-purpose language model depends not only on the capability of any single model, but on whether it closes the loop across five dimensions:
- Pretraining architecture;
- A model matrix spanning different cost tiers;
- Extended capabilities such as multimodality and agents;
- An open ecosystem with support for diverse compute;
- Clear evaluation and adoption methods.
Using a general-purpose language model series incubated by a university lab in China as a sample (referred to below as “the series”), this article follows a main thread of “architecture → matrix → capabilities → ecosystem → adoption” to map out its technical trajectory and practical experience.
2. Technical Origins: From Academic Research to a Self-Developed Architecture
2.1 From the Lab to an Industrialization Team
The series originated from a knowledge engineering lab at a university in China. Established in 1996, the lab was one of the earliest academic labs in the country to conduct research on natural language processing and knowledge graphs. Long-running work on knowledge graphs focused on “how to make machines understand and apply structured knowledge,” which is directly continuous with later techniques such as knowledge enhancement, retrieval-augmented generation (RAG), and tool calling.
Around 2019, the technology team incubated by the lab spun off into an independent company. Moving from a lab to an industrialization team meant that the research goal shifted from “validating methods” to “shipping products at scale.” The massive compute needed for large-scale pretraining, distributed training, and engineering operations were all foundational capabilities the team had to build at this stage.
2.2 The Hundred-Billion-Parameter Vision and an Open-Source Breakthrough
Around 2020, the team began developing its own pretraining architecture. At an internal meeting in late 2021, the team proposed building a hundred-billion-parameter model—a vision that later became the seed of the series’ first hundred-billion-scale open-source model.
That model was the first open-source hundred-billion-parameter large model in the country, and its release drew broad attention from the global developer community and industry. It was landmark in two respects:
- It proved that a domestic team could deliver the full pipeline, from architecture design to large-scale distributed training;
- By releasing open weights, it lowered the technical barrier for academic researchers and small and medium-sized enterprises to study large models.
Overall, the series’ development can be summarized as the path “lab research accumulation → industrialization team → self-developed pretraining architecture → hundred-billion-scale open-source breakthrough → systematic iteration,” reflecting the synergy among foundational research, engineering capability, and an open ecosystem.
3. Core Architecture: Autoregressive Blank Infilling Pretraining
3.1 Comparing Paradigms: Why a “Middle Path” Is Needed
There are mainly three mainstream pretraining paradigms:
- Unidirectional autoregressive: Predicts the next token from left to right. Strong generation ability, but each token can only see the preceding context, making it hard to model complete bidirectional context.
- Autoencoding masked modeling: Introduces bidirectional attention and learns context representations by reconstructing masked tokens. Good performance on understanding tasks, but weaker native generation ability.
- Autoregressive blank infilling: Masks several spans of the text and has the model reconstruct the masked content autoregressively based on context.
The capabilities of the first two paradigms are complementary. The goal of autoregressive blank infilling is to balance understanding and generation under a single pretraining objective, so the model can handle both understanding tasks (question answering, classification, extraction) and generation tasks (summarization, dialogue, code generation).
3.2 How It Works: How Blanks Are “Filled Back In”
Autoregressive blank infilling was systematically proposed in the General Language Model (GLM) framework by Tsinghua University and others. The core steps are:
- Split the text: Divide the text into two parts. Part A is corrupted text (containing blank markers), and Part B is the set of spans to be reconstructed.
- Shuffle the spans: Shuffle the span order to obtain a positional permutation p₁, p₂… Mask one span at a time, and randomly decide the mask length, from a single word to an entire sentence.
- Create the blanks: Replace each token in a masked span with a mask marker, roughly understood as
[MASK][MASK].... - Concatenate the input: Concatenate the corrupted Part A with the blank markers as the model input.
- Autoregressive reconstruction: The model reconstructs the spans one by one from left to right, based on the context of Part A and the already-generated spans. The training objective is to maximize the conditional likelihood of each span.
- Special setup: Each span to be reconstructed can be prefixed with a start marker to signal the model to begin generating; the model can also predict the length of each masked span.
An illustration:
Original: He yesterday at the library finished that book about distributed systemsSpans (after shuffling): [at the library] → [He yesterday] → [about distributed systems]Model input: [MASK][MASK] [MASK][MASK][MASK] finished that [MASK][MASK][MASK][MASK] bookPrediction targets: length=2 → He yesterdaylength=3 → at the librarylength=4 → about distributed systems
In this example, the model can reconstruct “He yesterday” because the complete semantic structure of “finished that… book” constrains the range of the subject and the time. This is precisely how blank infilling balances global semantics with autoregressive decoding.
- Attention mask:
- Part A uses bidirectional visibility internally, preserving full context understanding;
- Blank markers can only attend to Part A and the already-generated spans, and cannot “peek” at content not yet generated;
- Two-dimensional positional encoding assigns positional information separately to Part A and the generated part, allowing the model to distinguish “original positions” from “generated positions.”
- Length prediction: Predicting the length of a masked span is equivalent to teaching the model “how much content is missing.”
3.3 One Objective, Many Task Forms
A notable strength of this framework is that simply changing the masking strategy yields different task forms:
- Masking an entire sentence: equivalent to generative language modeling;
- Masking part of a sentence (such as the beginning or end): equivalent to conditional text generation;
- Masking a single word: equivalent to a fill-in-the-blank or discriminative task;
- Concatenating multiple input-output pairs and masking the outputs: equivalent to multi-task learning or downstream fine-tuning.
This design lays the foundation for unified modeling from pretraining to downstream tasks, and reduces the cost of separately designing architectures and objectives for different tasks.
3.4 From Billions to Hundred-Billions: Training Engineering Essentials
As the parameter count grows from the billions scale to the hundred-billions scale, the focus of training shifts from model structure to systems engineering. Large-scale training typically requires attention to the following:
- Parallelism strategy: Combining data parallelism, tensor parallelism, pipeline parallelism, and sequence parallelism to balance memory, communication, and compute efficiency;
- Memory optimization:
- Mixed-precision training;
- Activation recomputation (trading compute for memory);
- Low-bit quantization of optimizer states to compress the state overhead when training very large models;
- Numerical stability: Deep networks need appropriate normalization and residual scaling, together with loss scaling and gradient clipping;
- Data and long context: Cleaning, deduplication, and mixing of high-quality corpora, along with sample concatenation, length packing, and positional encoding extrapolation, directly determine the model’s capability ceiling;
- Reproducibility: Fixing random seeds, recording data versions and hyperparameters, and periodically saving checkpoints are basic requirements for large-scale training.
The following is illustrative pseudocode showing the idea of constructing blank-infilling samples:
# Pseudocode: build autoregressive blank-infilling training samplesdef build_blank_infilling_sample(text, rng):spans = sample_spans(text, rng) # sample contiguous spans with some probability, shuffle, mask one by onecorrupted = textfor span in spans:span = resize_span(span, rng) # randomly decide mask length (in words or sentences)start = rng.randrange(0, len(corrupted) - len(span) + 1)corrupted = (corrupted[:start]+ [MASK] * len(span)+ corrupted[start + len(span):])labels = concat(spans) # concatenate reconstruction targets in generation orderinputs = [A_SEP] + corrupted + [B_SEP] + labels# Part A is bidirectionally visible; blank markers can only see Part A and the generated Part Battn_mask = build_attention_mask(len(corrupted), len(labels))pos_ids = build_2d_position_ids(len(corrupted), len(labels))return inputs, attn_mask, pos_ids
4. Model Matrix: From Open-Source Lightweight to Commercial High-Performance
4.1 Why “Systematization” Is Needed
Real businesses rarely rely on just one model size:
- High-frequency simple tasks (such as intent recognition and text classification) are sensitive to latency and cost;
- Complex tasks (such as long-document analysis and code engineering) value reasoning ability more;
- On-device and edge scenarios are limited by compute;
- Industry scenarios need multimodal and tool-calling capabilities.
The essence of systematization is to form, on a unified technical foundation, a gradient covering different “capability–cost” ranges, so business teams can select models on demand.
4.2 Matrix Tiers and Positioning
| Tier | Typical parameter scale | Deployment form | Typical scenarios | Selection focus |
|---|---|---|---|---|
| Lightweight open-source model | Billions scale | Single GPU, on-device, or edge devices | Text classification, information extraction, on-device assistants | Memory footprint, inference latency, fine-tuning cost |
| General-purpose workhorse model | Tens of billions scale | Single machine with multiple GPUs, or cloud service | Knowledge Q&A, content generation, coding assistance | Overall effectiveness, concurrency, tool calling |
| High-performance flagship model | Hundred-billions scale and above | Multi-machine, multi-GPU clusters or dedicated service | Complex reasoning, long-document analysis, software engineering | Reasoning depth, context length, stability |
| Multimodal and agent-specialized models | Depends on the task | Cloud service or private deployment | Image and document understanding, task automation | Modality coverage, tool ecosystem, execution safety |
The series’ representative versions have evolved from a hundred-billion-scale open-source model and a lightweight dialogue model to several later iterations, multimodal visual understanding models, and an all-around tool-using agent, gradually forming a complete matrix.
4.3 Iteration Logic: Three Main Lines—Capability, Efficiency, Scenarios
- Capability line: Extending context length, and improving code generation and mathematical reasoning ability;
- Efficiency line: Lowering per-token cost through structural optimization, improved training data quality, and inference acceleration;
- Scenario line: Releasing specialized versions for scenarios such as code, visual understanding, and tool calling.
These three lines support one another: capability improvements create more scenario demands, scenario demands drive efficiency optimization, and efficiency optimization allows higher capabilities to be delivered at an affordable cost.
4.4 Open-Source and Commercial Dual Tracks
The series adopts a strategy running open-source and commercial services in parallel:
- Open-source versions cover multiple scales including lightweight dialogue models, making it easy for developers to research, fine-tune, and privately deploy;
- Commercial versions target production scenarios with higher demands on effectiveness, stability, and service guarantees;
- A community has formed around the open weights, producing derivative models, fine-tuning data, and inference optimization solutions.
According to public sources, as of 2026, the series’ models have reached the hundreds-of-millions scale in cumulative downloads across the global open-source community.
5. Key Capability Dimensions and Evaluation Methods
In key areas such as coding, long-text processing, and logical reasoning, the series has performed well across multiple authoritative, internationally recognized evaluations: one iteration topped both the open-source model and domestic model leaderboards, while another version ranked among the global top tier—and first among the open-source camp—on the composite leaderboard of an international third-party evaluation organization. For developers, what is more valuable than rankings is understanding the evaluation methods behind each dimension.
5.1 Coding Capability
- Focus: Single-function generation, code completion, defect repair, unit test generation, and code explanation;
- Common metrics:
- Pass rate on test cases (pass@k);
- Compilation pass rate;
- Number of static-analysis warnings;
- Practical advice: Building a private evaluation set from your own code repositories is closer to real scenarios than a general leaderboard.
5.2 Long-Text Processing
- Focus: Information localization in long contexts, cross-paragraph synthesis, and detail recall;
- Common methods: “Needle in a haystack”-style key information retrieval, long-document summarization, and multi-hop question answering;
- Note: A large context window does not mean it is fully utilized; combine it with segmented retrieval and hierarchical summarization strategies.
5.3 Logical Reasoning
- Focus: Multi-step reasoning, mathematical and symbolic reasoning, and commonsense reasoning;
- Common metrics: Benchmark accuracy, chain-of-thought consistency, and process verifiability;
- Note: Reasoning tasks usually need to be paired with longer generation length and reasonable prompting strategies.
5.4 Building an Evaluation System
It is recommended that enterprises establish a “four-layer evaluation” mechanism:
- Public benchmarks: For horizontal reference and observing trends;
- Internal evaluation sets: Taken from real business logs and manually labeled—the core basis for model selection;
- Human preference evaluation: Suited to open-ended generation tasks;
- Safety and adversarial testing: Covering risks such as prompt injection and unauthorized tool calls.
A single evaluation is not enough to draw conclusions; continuous regression testing is needed to prevent effectiveness regressions caused by model upgrades.
6. Multimodality and Agents: From “Understanding” to “Execution”
6.1 Multimodal Capabilities
The series has released visual understanding models (such as a multimodal version supporting document image understanding and a high-concurrency vision model), covering tasks like visual Q&A, document parsing, and chart understanding.
Its technical route is consistent with the industry mainstream and typically proceeds in three stages:
- Alignment pretraining: Mapping visual features into the language semantic space;
- Visual instruction fine-tuning: Improving visual Q&A and document understanding ability;
- Preference alignment: Making outputs better aligned with human preferences.
In engineering practice, specialized components such as OCR, table reconstruction, and layout analysis are often more critical than general visual understanding.
6.2 Agent Capabilities
Versions representing “all-around tool” capabilities (such as a tool-oriented model supporting web browsing, code execution, intelligent drawing, and more) mark the model’s shift from “answering questions” to “completing tasks.”
A typical agent system comprises four elements:
- Planning: Decomposing a goal into sub-tasks;
- Tools: Function calling, retrieval, code execution, and browser operations;
- Memory: Long context and external storage;
- Reflection: Correcting the plan based on execution results.
Illustrative code for tool calling:
# Pseudocode: a tool-calling agent loopfor step in range(max_steps):resp = llm.chat(messages, tools=tool_schema) # the model returns a structured tool callif not resp.tool_calls:return resp.content # no tool call; return the final answerfor call in resp.tool_calls:if not permission_check(call): # permission checkmessages.append(deny_result(call))continueresult = sandbox_execute(call, timeout=30) # execute in a sandboxmessages.append(tool_result(call, result)) # feed the execution result back into context
From a product perspective, GLM-4 All Tools represents all-around tool-calling capability, while versions like GLM-5V-Turbo target high-concurrency visual understanding services. Agents and multimodality are converging at an accelerating pace.
7. Ecosystem and Compute: Open Ecosystem and Multi-Hardware Adaptation
7.1 The Flywheel of an Open Ecosystem
Open weights lower the barrier to trial and secondary development, and the community in turn contributes fine-tuned versions, quantization schemes, and inference optimization practices, which in turn drive model capability improvements—forming a positive loop. The series’ hundreds-of-millions-scale cumulative downloads are exactly the result of this flywheel.
7.2 Adaptation to Domestic Accelerators
The series has fully adapted to the domestic chip ecosystem represented by Ascend. For domestic accelerator adaptation, the following work is typically required:
- Operator coverage and functional alignment: Ensuring mainstream operators are available and produce outputs consistent with the reference implementation;
- Communication and parallelism optimization: Adapting to multi-card interconnect topologies and optimizing collective communication;
- Inference engine adaptation: Tuning quantization, graph compilation, and memory management on domestic hardware;
- Accuracy evaluation: Comparing accuracy metrics on the same tasks to ensure performance gains do not come at the cost of effectiveness.
7.3 Cloud Platform Distribution
The series has been deployed on the model service platforms of major international public cloud providers (such as managed model catalogs and managed services), so developers can call models on demand without building their own inference clusters. In China, companies such as Baidu AI Cloud can also help enterprises access general-purpose large model capabilities at different scales on demand through general model service platforms.
8. Typical Application Scenarios
8.1 Public Services and Governance
Policy Q&A, service process guidance, and public-opinion analysis. The key is that answers must be traceable and consistent, requiring a combination of knowledge-base retrieval and human review.
8.2 Industrial Manufacturing
Equipment manual Q&A, process knowledge retrieval, and assisted fault diagnosis. Lightweight models can be deployed on the edge for real-time Q&A, while complex problems are routed to cloud models.
8.3 Finance
Contract review, research report summarization, intelligent customer service, and compliance checks. Attention must be paid to keeping data within a controlled boundary, auditability, and explainable results; private or dedicated-instance deployment is typically used.
8.4 Education
Personalized tutoring, homework grading, and lesson-preparation assistance. Focus is needed on guarding against content-safety risks and academic-integrity issues, and on establishing teacher-review mechanisms.
9. Enterprise Adoption: Selection, Deployment, and Governance
9.1 Selection: Guided by Business Evaluation
Before selecting a model, build an evaluation set from real business data, and score across four dimensions—effectiveness, latency, cost, and compliance—rather than looking only at public leaderboards.
9.2 Comparing Deployment Forms
| Deployment form | Data control | Elasticity | Cost structure | Suitable scenarios |
|---|---|---|---|---|
| Public cloud model service | Depends on the provider’s security and compliance capability | High | Billed by usage or resources | Rapid validation, highly variable traffic |
| Dedicated instance | Relatively high, with resource isolation | Relatively high | Billed by resource specification | Stable workloads needing some isolation |
| Private deployment | Highest, with data kept on-premises | Low | Large upfront investment, low long-term marginal cost | Strongly regulated industries, high-frequency calls |
9.3 Inference Optimization
- Quantization: INT8/INT4 weight quantization, and KV Cache quantization;
- Batching: Continuous batching and dynamic batching to improve throughput;
- Decoding acceleration: Speculative decoding and prefix-cache reuse;
- Routing: Route simple requests to lightweight models and complex requests to flagship models.
9.4 Observability and Cost Governance
- Monitoring: Latency percentiles, token consumption, error rates, and timeout rates;
- Logging: Desensitized records of requests and responses for easier traceback;
- Governance: Setting call quotas and budget alerts, and periodically analyzing the token cost structure.
9.5 Security and Compliance
- Input side: Prompt-injection detection and sensitive-data masking;
- Output side: Content-safety review and citation traceability;
- Tool side: Least privilege, sandbox isolation, and human confirmation for dangerous operations;
- Compliance side: Implementing the relevant regulations on data security and generative AI service management, labeling AI-generated content, and retaining necessary audit records.
10. Conclusion: Systematization Is the Inevitable Direction of LLM Engineering
From the hundred-billion-parameter vision conceived in a lab, to a complete matrix covering open-source lightweight models, commercial flagships, multimodality, and agents, the series’ development reveals a clear pattern: competition in general-purpose LLMs has moved from “comparing the capability of a single model” to “comprehensive competition across architecture, model matrix, ecosystem, and engineering capability.”
For developers, understanding unified pretraining paradigms like blank infilling helps grasp the boundaries of model capabilities; mastering how to choose across matrix tiers and deployment forms is what allows a balance among effectiveness, cost, and compliance. Whether you are building agents, processing long documents, or pursuing private deployment, you can find a suitable technical path within this system.
