Modern LLM Architectures, Parameter Scale, and How to Choose the Right Model
Parameter count alone doesn't tell you how capable a large language model is. This guide explains the core architecture of modern LLMs, the difference between total and activated parameters, how dense and Mixture-of-Experts designs affect inference cost, and how memory, context length, and training methods influence deployment. It closes with a practical evaluation framework and step-by-step selection advice for developers and enterprises.
Modern LLM Architectures, Parameter Scale, and How to Choose the Right Model
Why Parameter Count Alone Isn’t Enough
The most common question when discussing large language models is “how many parameters does it have?” Parameter count does reflect model capacity, but it is not the only indicator of capability.
A model’s actual performance is shaped by many factors:
- Architecture design;
- Total parameter count versus activated parameter count;
- Training data scale and quality;
- Pretraining and post-training methods;
- Context window length;
- Compute resources available at inference time;
- Tool calling, retrieval-augmented generation, and workflow orchestration;
- How well the model is adapted to specific tasks.
For example, two models with similar parameter counts can behave very differently at inference if one uses a dense architecture and the other uses a Mixture-of-Experts (MoE) design. A dense model must activate most of its parameters for every generation step, while an MoE model routes each input to a subset of experts, keeping large total capacity while reducing per-token inference cost.
So when evaluating modern LLMs, pay attention to both “total parameters” and “parameters activated per token.”
The Basic Structure of Modern LLMs
Most modern large language models are built on attention-based sequence modeling architectures. The core processing pipeline can be summarized as:
- Split text into tokens;
- Convert tokens into vectors;
- Model contextual relationships through stacked network layers;
- Predict the next token;
- Repeat generation until the response is complete.
2.1 Tokenization and Embeddings
Models cannot directly understand characters, words, or code symbols. Instead, a tokenization algorithm splits the input into discrete units. A single Chinese character might become one token or combine with adjacent characters into a longer token; English words, code, numbers, and punctuation may all be split differently.
The tokenization strategy affects three things:
- How much context capacity the same text consumes;
- Inference speed and cost;
- How well the model handles code, domain terminology, and multilingual text.
After tokens are assigned IDs, they are mapped to high-dimensional vectors. These embeddings are not fixed dictionary definitions; they are mathematical representations the model gradually learns during training.
2.2 Attention Mechanism
The attention mechanism determines which parts of the context the current token should focus on. For example, when generating a function body, a model may need to attend simultaneously to the function name, parameter definitions, comments, and type declarations earlier in the file.
A common abstraction of attention computation is:
Attention(Q, K, V) = softmax(QKᵀ / √d) V
Where:
- Q is the current query;
- K is the index of the context;
- V is the information to aggregate;
- d is the vector dimension.
Full attention computation grows rapidly with context length, so long-context models typically combine positional encoding improvements, caching mechanisms, block-wise attention, or other sparsity techniques to reduce compute overhead.
2.3 Feed-Forward Networks
Attention layers build relationships between tokens; feed-forward networks (FFNs) apply non-linear transformations to each position’s representation. Modern models typically alternate attention modules and FFN modules within each layer.
FFNs often contain the majority of a model’s parameters, making them a major source of model capacity. In MoE models, the “experts” are typically composed of multiple independent feed-forward networks.
2.4 Normalization and Residual Connections
Residual connections allow information to flow across many layers, mitigating gradient problems in deep network training. Normalization modules stabilize the numerical distribution between layers.
These components usually don’t directly determine total parameter count, but they significantly affect training stability, convergence speed, and final performance.
Dense Models vs. Mixture-of-Experts Models
3.1 Dense Models
In a dense model, every input token passes through most of the model’s parameters. If the model has tens of billions of parameters, each generation step typically invokes a substantial portion of the network weights.
Advantages of dense models:
- Relatively simple architecture;
- Mature training and deployment workflows;
- More predictable runtime behavior;
- Stable performance on general-purpose tasks.
The drawback is higher inference cost. As parameter scale grows, GPU memory usage, memory bandwidth, and compute latency all increase noticeably.
3.2 Mixture-of-Experts Models
MoE models maintain multiple expert networks and use a router to select a small number of experts for each input token. A model can have an enormous total parameter count while activating only part of it per computation.
For example, a model with hundreds of billions of total parameters might activate only tens of billions per token, making actual inference cost closer to the activated parameter count than the total count.
MoE models typically include:
- A router that decides which experts each token enters;
- Expert networks that perform the feed-forward transformations;
- Load balancing mechanisms to prevent overuse of some experts;
- Communication mechanisms to move token representations across devices.
The key advantage is “high capacity with controllable per-token compute,” but it introduces additional engineering challenges: inter-device communication, uneven expert utilization, memory management, and serving stability.
3.3 Total vs. Activated Parameters
When reading model documentation, distinguish these concepts:
- Total parameters: the sum of all experts, shared layers, and embedding layers;
- Activated parameters: the parameters actually involved in processing a single token;
- Trainable parameters: the parameters actually updated during fine-tuning;
- Storage footprint: the disk space required to store weights at a given precision.
These four numbers can differ substantially. For inference deployment, activated parameters better reflect compute requirements; for weight storage planning, total parameters and quantization precision are what matter.
How Parameter Scale Affects Memory and Deployment
Ignoring caches and runtime overhead, model weight footprint can be estimated roughly as:
Weight memory ≈ parameter count × bytes per parameter
Common precisions include:
- FP32: about 4 bytes per parameter;
- FP16/BF16: about 2 bytes per parameter;
- 8-bit quantization: about 1 byte per parameter;
- 4-bit quantization: about 0.5 bytes per parameter, plus quantization metadata.
For example, a model with tens of billions of parameters at 16-bit precision may need tens of GB of memory for weights alone; adding long-context KV caches, transient activations, and the serving framework requires even more.
Deployment planning cannot rely on weight size alone. Also consider:
- KV cache: the longer the context, the larger the cache;
- Batch size: more concurrent requests mean faster cache growth;
- Output length: longer generations hold caches for longer;
- Parallelism strategy: the model may need to be sharded across devices;
- Quantization error: low precision saves resources but may degrade quality on some tasks;
- Serving framework overhead: scheduling, communication, and memory management consume additional resources.
In practice, run small-scale load tests to measure throughput, time-to-first-token, per-request latency, and peak memory usage—don’t draw conclusions from parameter count alone.
Key Technologies Behind Long Context
Long-context capability is a major direction for modern models. Where earlier models handled only short text, long-context models can analyze lengthy documents, large codebases, meeting transcripts, and multi-turn conversations.
But a longer context window doesn’t guarantee the model will accurately use everything in it. Actual performance also depends on:
- Positional encoding design;
- Whether long documents were used during training;
- The model’s ability to retain distant information;
- The degree of attention computation optimization;
- Retrieval and summarization strategies;
- The ability to identify conflicting information.
In engineering practice, avoid simply stuffing all material into the context at once. A more reliable approach is layered processing:
- Split documents into chunks;
- Build an index over the chunks;
- Retrieve relevant content based on the query;
- Re-rank the retrieved results;
- Insert only the necessary information into the model’s context;
- Validate facts and formatting after generation.
This reduces interference from irrelevant information and lowers inference cost.
Architectural Extensions for Multimodal Models
Multimodal models handle not only text but also images, audio, video, or structured data. A typical architecture includes:
- Modality encoders: convert images, audio, and other inputs into vectors;
- Alignment modules: map different modalities into a shared representation space;
- The language model backbone: handles understanding, reasoning, and generation;
- Output modules: produce text, structured results, or other content.
For image understanding, the system typically splits the image into visual patches, generates features with a vision encoder, then converts those features into representations the language model can process.
Key challenges for multimodal models include:
- Different temporal and spatial granularity across modalities;
- Image detail loss during compression;
- Video introduces enormous sequence lengths;
- Speech involves temporal alignment and noise handling;
- Semantic conflicts can arise between modalities.
As a result, more parameters do not guarantee proportionally better multimodal capability—data quality and cross-modal alignment methods matter just as much.
Reasoning Capability and Training Pipeline
Large language models typically go through several stages:
7.1 Pretraining
Pretraining uses massive amounts of text, code, and other data to teach the model language patterns, knowledge associations, and basic reasoning patterns. The primary objective at this stage is next-token prediction.
7.2 Instruction Fine-Tuning
A pretrained model may only be good at continuing text, not necessarily at following user instructions accurately. Instruction fine-tuning uses tasks like Q&A, summarization, classification, and code generation to teach the model to respond as requested.
7.3 Preference Optimization
Preference optimization improves the helpfulness, accuracy, safety, and style of responses. It reduces irrelevant content, improves format adherence, and makes output better fit real-world use cases.
7.4 Inference-Time Augmentation
In production, you can further improve results through retrieval augmentation, tool calling, planning and execution, result verification, and multi-turn reflection. At this point, system capability is no longer determined by model parameters alone, but by “model plus external workflows” together.
How to Compare Models of Different Scales
Build an evaluation matrix across the following dimensions instead of comparing advertised parameter counts:
| Dimension | What to Look At |
|---|---|
| Total parameters | Overall model capacity |
| Activated parameters | Per-token inference compute |
| Context length | Range of processable input |
| Inference speed | Time-to-first-token and generation speed |
| Concurrency | Serving capacity per unit of resource |
| Factual accuracy | Suitability for knowledge Q&A and analysis |
| Coding ability | Suitability for development assistance and automation |
| Tool calling | Structured output and workflow execution |
| Deployment complexity | Memory, communication, and operations cost |
| Security and compliance | Data isolation, auditing, and access control |
For individual developers, smaller models are often easier to run locally and suit classification, summarization, format conversion, and simple Q&A. For enterprise-grade complex reasoning, larger models can be combined with common infrastructure—retrieval systems, databases, message queues, object storage, container platforms, and monitoring/alerting—to build complete applications.
In cloud environments such as Baidu AI Cloud, enterprises should also evaluate elastic scaling of model services, access control, log auditing, resource isolation, and cost management—though specific configurations should be based on actual service capabilities and your own load test results.
Model Selection Advice for Developers
Follow this process when selecting a model:
- Define the task type: Q&A, generation, code, classification, extraction, or multimodal understanding;
- Estimate input/output lengths to determine whether long context is needed;
- Assess latency requirements: distinguish interactive online use from offline batch processing;
- Budget compute resources: estimate GPU memory, CPU, network, and storage needs;
- Design an evaluation set using real business samples, not just public leaderboards;
- Compare accuracy against cost: watch per-request cost and overall throughput;
- Test edge cases: hallucinations, refusals, overlong inputs, and malformed formats;
- Set up monitoring: track latency, failure rates, resource utilization, and user feedback;
- Keep a fallback plan: switch to a lightweight model during traffic spikes or resource shortages;
- Iterate continuously: update prompts, retrieval strategies, and fine-tuning data based on production data.
Overall, modern LLMs have evolved from a race for “more parameters” into a comprehensive competition across architecture, data, training, inference, and engineering systems. Understanding the relationships between dense architectures, Mixture-of-Experts, long context, multimodality, and parameter precision is what allows you to accurately judge which scenarios a model fits and how much compute it truly requires.
