General-Purpose LLM Series: Architecture, Model Selection, and Deployment Guide
This article provides a vendor-neutral guide to understanding and selecting general-purpose large language model families. It covers pretraining paradigms such as autoregressive blank infilling, tiered model matrices by parameter scale and deployment model, and the evolution of context windows, reasoning, and code capabilities. It also outlines multimodal and agent engineering checks, a practical selection framework based on task complexity, latency, data compliance, and total cost, plus considerations for domestic AI chip adaptation and fine-tuning before launch. The goal is to help teams make reproducible model decisions instead of choosing by version number alone.
1. Why You Need to Understand a Model Series
Large language models (LLMs) have moved from research prototypes to production systems. A single model series often contains multiple versions: some can run on a single consumer-grade GPU, while others can only be called through a cloud API. If developers choose a model only by version number, they can easily pay too much in cost or performance. Understanding the series’ pretraining approach, version tiers, and capability boundaries is necessary for making reproducible selection decisions.
This article is not aimed at one specific vendor. It discusses the shared design logic of this type of model series. The parameter ranges and performance figures mentioned here are typical ranges only. Before making a formal decision, rely on the model’s official technical report and model card.
2. Pretraining Paradigm: Autoregressive Blank Infilling
There are three main pretraining objectives.
- Autoregressive language modeling: predict the next token using a left-to-right causal mask. It has strong generation ability but cannot see right-side context.
- Autoencoding denoising (Masked LM): mask some tokens and reconstruct them using bidirectional context. It has strong understanding ability, but the training objective is not aligned with generation tasks.
- Autoregressive blank infilling: remove several contiguous spans from the text, replace them with mask placeholders, and then autoregressively generate the removed content one piece at a time.
Training samples for blank infilling are usually constructed as follows:
- Sample several contiguous spans according to a strategy; a common masking ratio is about 15%.
- Replace each span with a mask marker to form the corrupted context.
- Append the removed spans in order to the end of the sequence as the generation target.
- Use bidirectional attention for the context part and unidirectional causal attention for the target part.
- Use two-dimensional positional encoding to represent two things at the same time: the span’s position in the original text and the token’s position within the span.
This design has three benefits. Bidirectional attention helps the model better understand the known context. Autoregressive generation keeps the training objective consistent with downstream generation tasks. By adjusting the distribution of blank lengths, the same objective can cover fill-in-the-blank, continuation, and long-text generation.
Its limitation is that data construction and attention masking are more complex than in ordinary causal language models. When reproducing it, carefully check the loss mask and positional encoding.
3. Model Matrix: Layered by Deployment Mode
A complete model series is usually divided into three tiers by parameter scale and deployment mode. The table below gives common ranges and does not represent any specific model.
| Tier | Typical parameter range | Deployment form | Typical scenarios | Main limitations | Verification source |
|---|---|---|---|---|---|
| Lightweight open-source tier | Billions to tens of billions | Single-GPU or laptop inference; parameter-efficient fine-tuning possible | Local experiments, teaching, edge devices | Limited capability for complex reasoning and long-chain tasks | Parameter count and memory requirements in the model card |
| Mid-scale tier | Tens of billions to hundreds of billions | Enterprise private multi-GPU deployment | Knowledge Q&A, document processing, internal assistants | Requires a stable inference cluster and operations | Benchmark reports from inference frameworks |
| Flagship tier | Very large scale; some use sparse activation | Cloud API or large clusters | Complex reasoning, code generation, long-document analysis | High invocation cost; data passes through an external service | Official pricing page and terms of service |
When selecting a model, first confirm which tier the team needs, then compare specific versions within that tier.
4. Main Evolution Threads and Their Boundaries
Looking at version iterations across a model series, four main development threads emerge. Each has applicable preconditions and failure modes.
- Context-window extension: relies on positional interpolation, extrapolation of rotary position embeddings, and sparse attention. Accuracy usually drops noticeably when positional interpolation is used far beyond the training length. Before launch, test retrieval and question answering at the target length rather than relying only on the nominal length.
- Reasoning enhancement: improves performance on math and planning tasks through long chain-of-thought training, process reward models, and reinforcement learning. The tradeoff is more output tokens, which increases latency and cost.
- Code capability expansion: capabilities have expanded from code completion to requirement understanding, cross-file modification, and defect repair. Cross-file tasks place high demands on context management, and generated patches require human review.
- Evaluation-driven iteration: public benchmarks guide data mixing and alignment. Public benchmarks are easy to optimize for specifically, so teams should keep a private evaluation set that matches their own business.
5. Engineering Considerations for Multimodal Models and Agents
5.1 Visual Encoder Selection Checklist
Multimodal extension usually adds a visual encoder and a projection layer that maps image features into the language model’s embedding space. Check each item during selection:
- Input resolution: higher resolution captures more detail, but images consume more tokens. First estimate the token count per image, then calculate total cost under concurrency.
- Task type: receipts, tables, and charts require layout understanding, while ordinary image description has lower resolution requirements.
- Text recognition needs: if images contain many small characters, separately test recognition accuracy for small text.
- License terms: confirm the permitted use of the encoder and pretrained weights, especially for commercial scenarios.
- Latency budget: measure first-token latency with real image samples instead of relying only on specification sheets.
5.2 Parameter Validation and Degradation for Tool Calls
The basic agent loop is: the model plans, generates a tool call, the tool executes, the result is fed back, and reasoning continues. Every step can fail and needs separate design.
Parameter validation:
- Define a JSON Schema for each tool, declaring field types, required fields, and value ranges.
- Validate model-generated parameters against the Schema first. If validation fails, send the error message back to the model for retry, with a maximum of one or two retries.
- For tools that modify data, require secondary confirmation even when parameters are valid; do not let the model execute them directly.
Timeouts and degradation:
- Set timeouts for each tool type. The following values are only starting points and should be adjusted based on real latency distributions: 10 seconds for query tools and 30 seconds for code execution tools.
- Use exponential backoff for retries, doubling the interval each time, and set a maximum retry count.
- When a tool keeps failing, return a clear degradation notice so the model can tell the user the task cannot be completed instead of fabricating results.
- Code execution must run in an isolated sandbox with restricted network access, file system, and memory.
6. Model Selection Decisions
You can judge with the following four dimensions. Each dimension includes a checkable question.
- Task complexity: Can the task be solved by rules or a smaller model? If yes, a flagship model is unnecessary.
- Latency and concurrency: What is the target P95 latency? What is the peak concurrency? If requirements cannot be met, consider quantization or a smaller model.
- Data compliance: Can data leave the internal network? If not, only open-source versions that can be privately deployed are viable.
- Total cost of ownership: Include API fees, or self-hosted GPUs, electricity, and operations labor, and compare the annual cost of both options.
A common approach is tiered routing. First use a lightweight classification module to judge request difficulty, send simple requests to a smaller model, and escalate complex requests to a flagship model. Routing thresholds should not be set by experience alone; use a batch of labeled request samples for offline evaluation to find the balance between quality and cost.
7. Adaptation to Domestic AI Chips
Adaptation to domestic AI chips usually includes both training and inference. Before deployment, verify the following:
- Whether the inference engine supports all operators on the target chip, and whether unsupported operators have alternative implementations.
- Whether numerical precision aligns with the reference implementation; compare the maximum output deviation using the same batch of inputs.
- The measured accuracy loss of quantization schemes (such as 8-bit or 4-bit weight quantization) on the target hardware. This must be validated with a business evaluation set, not only with general benchmarks.
- Communication overhead and memory usage during multi-GPU inference; run stress tests with real concurrency.
Only when each of these items can produce data does the selection conclusion have a basis. If a vendor only gives a verbal claim that adaptation is complete, ask for a test report.
8. Fine-Tuning and Pre-Launch Checks
For open-source versions, the fine-tuning workflow includes:
- Data preparation: construct instruction data consistent with the business distribution.
