The Evolution and Architecture of General-Purpose Large Language Models: A Technical Deep Dive

    This article traces the technical evolution of general-purpose large language models (LLMs), from early hundred-billion-parameter foundation models to lightweight chat models, long-context and multimodal capabilities, and the rise of AI agents. It explains the core pretraining architecture—autoregressive blank infilling—walks through four key development stages, reviews major evaluation benchmarks (coding, long context, reasoning), and covers engineering practices for hardware adaptation, deployment, and real-world applications. It concludes with practical advice for developers on model selection, context engineering, and building agent-based systems.

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

    In recent years, general-purpose large language models have become one of the most important technical directions in artificial intelligence. The field has progressed through several key stages: the open-sourcing of early hundred-billion-parameter foundation models, rapid iteration of chat models, and comprehensive enhancement of multimodal and agent capabilities. For developers and enterprise users, understanding the architectural logic and engineering trade-offs behind this evolution is more valuable than simply chasing benchmark scores. This article takes a deep dive into the pretraining architecture, development history, capability matrix, and practical deployment of general-purpose LLMs.

    2. Core Architecture: Autoregressive Blank Infilling

    Traditional pretraining architectures fall into two main categories:

    • Autoregressive architectures generate text word by word from left to right, making them naturally suited for text generation tasks.
    • Autoencoding architectures learn bidirectional contextual representations by recovering masked tokens, making them better suited for understanding tasks.

    Each has its strengths, but a single architecture often struggles to balance understanding and generation.

    The core idea of the autoregressive blank infilling architecture is to randomly mask out continuous spans of the input text (span corruption) and then generate the missing content in an autoregressive manner. This design unifies both types of tasks under a single pretraining objective:

    1. Understanding: The model must infer the missing content using bidirectional context from before and after each masked span, giving it bidirectional encoding characteristics.
    2. Generation: The masked spans are still generated autoregressively, ensuring generation quality and consistent sequence modeling.
    3. Task unification: By varying how spans are masked and how targets are formed, tasks such as classification, summarization, question answering, and text infilling can all be modeled as “blank infilling” problems, minimizing structural changes needed for downstream fine-tuning.

    A schematic pseudocode representation:

    1. def abi_pretrain_loss(model, text, mask_ratio=0.15):
    2. # 1. Randomly mask span-level segments in the input text
    3. corrupted, targets = span_corrupt(text, mask_ratio)
    4. # 2. Feed [context + placeholders] into the model
    5. logits = model(corrupted)
    6. # 3. Compute autoregressive cross-entropy loss over the masked spans
    7. return cross_entropy(logits, targets)

    This architecture also has a natural advantage for long-text modeling: span-level corruption exposes the model to long-range contextual dependencies during pretraining, laying the foundation for extending to very long context windows (e.g., 128K tokens).

    3. Development History: Four Stages from Foundation Model to Agent

    The evolution of general-purpose LLMs can be clearly divided into four stages.

    Stage 1: Foundation Models (2020–2022)

    The focus of this stage was validating pretraining architectures and large-scale training capabilities. Early teams first trained ten-billion-parameter models to validate data pipelines, distributed training, and stability strategies, then scaled up to the hundred-billion-parameter level. The successful open-sourcing of models at this scale was a landmark achievement: it demonstrated that very large models could approach top international levels on key metrics such as accuracy and robustness, and it energized the global open-source community around large-scale pretraining.

    Key engineering lessons accumulated during this stage include:

    • Mixed-precision training and memory optimization techniques that kept the cost of training hundred-billion-parameter models manageable
    • Cleaning and mixing strategies for high-quality bilingual corpora to ensure balanced Chinese and English capability
    • Quantization and parallel inference optimizations that enabled deployment under limited compute budgets

    Stage 2: Lightweight and Chat Models (2023)

    Foundation models were powerful but hard to deploy. The industry broadly pursued two paths:

    • Lightweight models: Distilling foundation model capabilities into 6-billion-parameter-class models, combined with INT4/INT8 quantization, made it possible to run them on consumer GPUs or even locally. This dramatically lowered the barrier for developers and fostered a vibrant community ecosystem.
    • Chat models: Foundation models were aligned using supervised fine-tuning (SFT) and reinforcement learning from human feedback (RLHF), making outputs better match human preferences, with successive versions delivering stronger performance and longer context.

    The typical workflow of this stage—“foundation model → chat fine-tuning → tool calling”—set the stage for later agent capabilities.

    Stage 3: Multimodal and Long-Context Models (around 2024)

    As foundational capabilities matured, the model’s capability boundary expanded in two directions beyond plain text:

    • Long context: Context windows were extended to 128K tokens or more, enabling models to process entire technical manuals, lengthy contracts, and large codebases. Long-context scenarios such as document Q&A and cross-file code analysis became must-have capabilities for real-world deployment.
    • Multimodal: Visual encoders were integrated with language models to enable image understanding, image-text Q&A, and chart parsing. The classic engineering pattern is “vision encoder + projection layer + language backbone,” injecting visual information into the language model as soft prompts.

    Stage 4: Agents

    Agent capabilities mark the critical leap from “answering questions” to “completing tasks.” The core capabilities include:

    • Tool calling: The model autonomously decides when to invoke external tools such as web search, code interpreters, or function APIs, and continues reasoning based on the results.
    • Multi-step planning: Complex tasks are decomposed into sequences of subtasks, executed in a “plan—execute—observe—revise” loop.
    • Long-range memory: External storage maintains task state and history, going beyond the limits of a single context window.

    A typical agent loop can be simplified as:

    1. while not task_done:
    2. action = llm.plan(context) # Plan the next step
    3. result = tools.execute(action) # Execute the tool call
    4. context = update(context, result) # Observe and update the context

    4. Key Capability Benchmarks: Coding, Long Context, and Reasoning

    The industry typically measures general-purpose LLMs along three evaluation dimensions:

    1. Coding: Automated programming benchmarks assess function generation, bug fixing, and multi-language programming ability, directly reflecting practical value in software development scenarios.
    2. Long context: “Needle in a haystack” retrieval tests and long-document Q&A verify the model’s ability to locate and synthesize information across very long contexts.
    3. Logical reasoning: Math reasoning, commonsense reasoning, and complex decision-making tasks evaluate multi-step chain-of-thought ability.

    Notably, open-source models have continued to climb on these benchmarks in recent years, with several versions ranking among the global leaders—evidence that the open ecosystem has become a major driving force behind LLM progress.

    5. Engineering in Production: Ecosystem Adaptation and Application Practices

    Industrial deployment of LLMs requires solving three engineering problems:

    1. Hardware ecosystem adaptation: Models need to run across multiple hardware platforms, including mainstream GPUs and other AI accelerators. Operator adaptation, graph compilation optimization, and distributed communication libraries work together to enable cross-platform training and inference migration.
    2. Diverse deployment options: Enterprises can choose between public cloud APIs, private deployment, or on-device quantized deployment depending on the scenario. Cloud deployments can use container platforms and model inference services for elastic scaling, while private deployments typically combine object storage (for model weight management), logging services, and monitoring/alerting to build a complete operations pipeline.
    3. Deepening domain applications: LLMs are already deployed at scale in areas such as public services (intelligent government Q&A), industrial manufacturing (equipment fault diagnosis assistance), finance (research report summarization and risk control assistance), and education (personalized tutoring).

    6. Practical Recommendations for Developers

    Based on the analysis above:

    • Choose models by scenario: For high-concurrency, lightweight tasks, prefer quantized small-parameter models to control costs; reserve large-parameter models for complex reasoning and long-context tasks.
    • Invest in context engineering: Well-designed prompt structures and retrieval-augmented generation (RAG) pipelines often deliver greater gains than switching models.
    • Embrace the agent paradigm: Combine models with tool calling and external knowledge bases to build auditable, rollback-capable task execution pipelines.
    • Follow the open ecosystem: Prefer open-source models with clear licensing and active communities to reduce supply-chain risk.

    7. Conclusion

    The development of general-purpose LLMs follows a clear trajectory: architectural innovation → scale breakthroughs → alignment optimization → multimodal and agent capabilities. Pretraining architecture innovations such as autoregressive blank infilling laid the foundation for unified understanding and generation, while the open-source ecosystem and broader hardware adaptation have significantly lowered the barrier to adoption. For developers and enterprises, understanding the logic behind this technical mainline—and pairing it with sound model selection and engineering practices—is the key to unlocking the real benefits of the large model era.