General-Purpose Large Language Models: Architecture Evolution and Practical Selection Guidelines

    This article maps the technical landscape of general-purpose large language models (LLMs), covering pretraining architectures (autoregressive, autoencoding, and autoregressive blank infilling), the capability dimensions that define model generations (code generation, long context, instruction following, multimodality, and agentic tool use), evaluation and selection methodology, deployment options from cloud APIs to private and edge deployments, inference optimization, safety governance, and industry use cases. It is intended for developers and technical decision-makers who need a systematic reference for choosing models and building LLM applications.

    1. Introduction: The Technical Landscape of General-Purpose LLMs

    General-purpose LLMs have moved quickly from research labs into production use, forming a full spectrum that ranges from lightweight open-source models in the tens of billions of parameters to high-performance commercial models in the hundreds of billions. For developers and enterprise technical decision-makers, understanding core architectural differences, the path of capability evolution, and engineering practices for deployment is the prerequisite for sound model selection and application innovation. This article walks through the technical system of general-purpose LLMs, including pretraining architectures, key capabilities, evaluation methods, and deployment practices, aiming to serve as a systematic reference.

    2. Pretraining Architectures: Autoregressive vs. Blank Infilling

    2.1 Main architecture types

    Pretraining objectives for today’s LLMs fall into three main categories:

    • Autoregressive: predicts the next token from left to right, represented by the GPT family, and strong at open-ended generation.
    • Autoencoding: reconstructs masked spans of the input through masked language modeling, represented by the BERT family, and strong at understanding tasks.
    • Autoregressive blank infilling: unifies the two by randomly blanking out contiguous spans in the input and having the model generate the blanked content autoregressively. The typical representative of this approach is the architecture used by the GLM series.

    2.2 Why blank infilling matters

    The core advantage of autoregressive blank infilling is task unification:

    1. Understanding and generation in one model: blanked spans vary in length, so short spans approximate discriminative understanding while long spans degenerate into pure generation, letting a single model cover both NLU and NLG tasks.
    2. Flexible training objective: adjusting the blanking ratio and span distribution shifts the model’s emphasis across task shapes.
    3. Alignment with downstream tasks: real-world scenarios such as text completion, fill-in-the-blank question answering, and code completion map naturally onto this training paradigm.

    From an engineering perspective, architecture choice directly affects how inference services are implemented: autoregressive models lend themselves to streaming output, while understanding tasks are better served by a single forward pass. A unified architecture lets one serving framework support diverse interfaces such as chat, completion, and classification.

    3. Key Dimensions of Capability Evolution

    Across generations of general-purpose LLMs, capability gains show up mainly in the following dimensions.

    3.1 Code generation and logical reasoning

    Code capability is the entry ticket to the developer ecosystem. Modern models are already practically useful for code completion, function generation, bug fixing, and unit test writing. Technically, this comes from:

    • large volumes of high-quality code and execution feedback signals in the training corpus;
    • chain-of-thought and process supervision, which improve the stability of multi-step reasoning;
    • at the evaluation level, the industry commonly uses standard benchmarks to measure code pass rates and reasoning accuracy, so model selection should be validated with both public leaderboards and a self-built regression suite.

    3.2 Long-context handling

    As context windows have grown from a few thousand tokens to hundreds of thousands and beyond, long-document summarization, repository-level code understanding, and long multi-turn conversations have become feasible. Engineering considerations:

    • Long context brings quadratic growth in attention computation and memory consumption, so techniques such as sparse attention and KV cache optimization are needed to control cost.
    • “Supporting long context” is not the same as “using long context well.” In practice, retrieval-augmented generation (RAG) should recall relevant fragments first and hand them to the model, balancing quality and cost.

    3.3 Instruction following and dialogue alignment

    Through supervised fine-tuning (SFT) and reinforcement learning from human or AI feedback (RLHF/RLAIF), a base model is aligned into a usable conversational assistant. Alignment quality can be assessed with metrics such as instruction-following rate, multi-turn consistency, appropriateness of refusals, and hallucination rate.

    3.4 Multimodal extension

    Visual understanding has become a standard feature of the new generation of models, typically in a joint “vision encoder + language model” architecture that supports image question answering, chart parsing, OCR-level text recognition, and video frame understanding. The practical value for enterprises is that scenarios traditionally split between CV and NLP — inspection image analysis, receipt and invoice recognition, courseware understanding — can be handled by one unified multimodal model, simplifying the technology stack.

    3.5 Agents and tool calling

    Agentic capability means the model can plan tasks, call external tools (search, code execution, APIs), and iterate based on results. Typical implementations include function-calling interfaces, structured output, and multi-step planning loops. When building agent applications, pay attention to:

    • clear tool schema descriptions and parameter validation;
    • execution sandboxes and permission boundaries to prevent unauthorized operations;
    • failure retry and human-in-the-loop mechanisms.

    The following is a generic tool-calling example (pseudocode, independent of any specific vendor):

    1. tools = [
    2. {
    3. "name": "query_weather",
    4. "description": "Query the current weather for a given city",
    5. "parameters": {
    6. "city": {"type": "string"},
    7. }
    8. }
    9. ]
    10. response = llm.chat(
    11. messages=[{"role": "user", "content": "Is it good for a run today?"}],
    12. tools=tools
    13. )
    14. if response.tool_calls:
    15. for call in response.tool_calls:
    16. result = dispatch(call.name, call.arguments) # execute the tool locally
    17. # append the tool result to the conversation and continue reasoning
    18. messages.append({"role": "tool", "content": result})

    4. Model Selection and Evaluation Methodology

    4.1 Read leaderboards, but do not rely on them alone

    Several third-party evaluation organizations publish model capability indices covering general intelligence, code, reasoning, and cost efficiency. When using leaderboards:

    1. Compare within the right groups — open-source vs. closed-source, and similar parameter scales.
    2. Check whether results are reproducible and whether data contamination is a risk.
    3. Remember that leaderboards reflect average general capability; vertical-scenario performance must be verified on your own.

    4.2 Build an internal evaluation system

    Enterprises are advised to construct a three-layer evaluation:

    • Base capability regression set: standard task sets covering question answering, summarization, code, and reasoning.
    • Business gold set: sampled from real business traffic and human-labeled, the closest proxy for actual production quality.
    • Online A/B testing and human spot checks: continuous monitoring for quality drift after launch.

    Engineering metrics such as inference cost, time to first token, throughput, and concurrency stability should be evaluated alongside quality.

    5. Deployment Practice: From Cloud Services to Private Deployment

    5.1 Multiple ways to obtain models

    Mainstream models are typically available in three forms:

    1. Cloud APIs: pay-as-you-go calls, suitable for fast validation and elastic workloads. Major public clouds offer access to multiple models, and some platforms provide unified access to several models, reducing the overhead of managing and switching between them.
    2. Private deployment: self-hosting open weights, suitable for finance and government scenarios with strict data compliance requirements. Common patterns include running inference services on container platforms with monitoring, alerting, and logging to ensure stability.
    3. Device-side / lightweight: quantization (INT8/INT4), distillation, and pruning to run smaller models on edge devices.

    5.2 Inference performance optimization

    • Quantization and sparsification: trade a small amount of precision for gains in memory footprint and throughput.
    • KV cache and prefix reuse: avoid repeated computation in multi-turn conversations and long system prompts.
    • Continuous batching and speculative decoding: improve throughput under high concurrency.
    • Locally produced AI accelerators: at the ecosystem level, mainstream open-source models have generally been adapted to a range of locally produced AI chips, so enterprises can complete a training and inference loop in self-reliant IT environments. During selection, confirm operator compatibility and real measured performance data.

    5.3 Security and governance

    Production environments need content safety filtering, sensitive information masking, output audit logs, and access control, plus a model version management process so that upgrades can be rolled back and results compared.

    6. Industry Use Cases

    • Public services and civic operations: intelligent assistance for government inquiry hotlines, plus automatic ticket classification and summarization, reducing manual handling costs.
    • Industrial manufacturing: equipment inspection image analysis combined with maintenance knowledge Q&A, using multimodal models and RAG.
    • Finance: research report summarization, compliance review assistance, and advisory Q&A, with emphasis on low hallucination and traceability.
    • Education: homework grading assistance and personalized explanation generation, with attention to age-appropriate content review.

    The common lesson from deployments is to validate cheaply first with RAG plus prompt engineering before considering fine-tuning, and to always keep a human fallback path.

    7. Summary and Outlook

    The evolution of general-purpose LLMs shows three trends: architectural unification, multimodal capabilities, and agentic interaction. For developers, understanding pretraining architecture principles clarifies the boundaries of a model’s capabilities; building a sound evaluation system is the core of selection; and at the deployment layer, cloud APIs, private deployment, and locally produced accelerator support offer ample flexibility. Readers are encouraged to start from real business pain points, validate model value in small fast iterations, and gradually build an enterprise-grade LLM application system.