The Evolution of Large Language Model Architectures: A Full-Stack Analysis
This article breaks down large language model evolution into four layers: base architecture, post-training, reasoning enhancement, and inference budget control. It explains how Multi-head Latent Attention and sparse Mixture-of-Experts reduce inference cost, how reinforcement learning with verifiable rewards builds reasoning ability, and how sparse attention, self-verification, and self-correction improve long-context performance. Developers will also find practical guidance on layered evaluation, cost control, and deployment choices.
1. Why You Should Read Model Evolution as One Continuous Stack
Many teams choose models based only on the latest benchmark scores, overlooking which layer a given capability actually comes from. A more reliable approach is to break model evolution into four layers:
- Base architecture layer (attention and expert routing)
- Post-training layer (supervised fine-tuning and preference optimization)
- Reasoning enhancement layer (reinforcement learning with verifiable rewards)
- Inference budget control layer (thinking length and the switch between thinking and not thinking)
Any “version upgrade” is essentially a change in one or two of these layers, while the remaining layers stay compatible.
An open-source flagship model released a new version over a major US holiday weekend, a cadence consistent with its predecessor. The new version comes close to contemporary closed-source flagship models on several public benchmarks while keeping its weights open, which makes it valuable for research and secondary development. The rest of this article walks through the stack layer by layer.
2. Base Architecture Layer: Multi-head Latent Attention and Sparse Experts
The previous-generation base model was built on two core designs.
The first is Multi-head Latent Attention (MLA). It compresses the key-value cache into a low-dimensional latent space, so inference only needs to cache the compressed vectors, which significantly reduces memory footprint and bandwidth pressure. Since both compression and decompression are low-rank linear transformations, the loss in model expressiveness is limited. The direct engineering benefit: with the same amount of memory, you can run longer contexts and larger batch sizes.
Illustration (only conveys the idea of a low-rank cache, not a real API):
# c: compressed latent vector, W_dk/W_uk: down-projection/up-projectionc = x @ W_dk # only c is written to the cachek = c @ W_uk # reconstructed when computing attentionv = c @ W_uv
The second is sparse Mixture-of-Experts (MoE). The total parameter count is very large, but each token only activates a small number of experts, which keeps training and inference costs within a manageable range. On the engineering side, watch out for the load-balancing loss, communication overhead during expert parallelism, and throughput fluctuations caused by routing jitter.
3. Post-training and Reasoning Enhancement Layer: Reinforcement Learning with Verifiable Rewards
The dividing line for reasoning models is replacing or supplementing human preference alignment with reinforcement learning with verifiable rewards (RLVR). The key point: for tasks whose answers can be judged right or wrong by a program (math, code, formal logic), the reward signal is objective and scalable, and does not require manual labeling of every example.
A minimal working skeleton of a reward function:
def reward(prompt, completion):if not completion.format_ok:return -0.5 # format/structure penaltyif run_tests(completion.code):return 1.0 # executable verification passedreturn 0.0 # incomplete but not destructive
In practice, what matters is not the name of the algorithm but three things: the coverage of tasks and verifiers, protection against reward hacking, and using supervised fine-tuning first during cold start to establish basic formatting and tool-use habits.
4. Efficiency Layer: Sparse Attention and Long Context
One focus of the new version is making attention a structure that can be sparsified, so that computation for very long contexts no longer grows quadratically with length. Common approaches include local window attention, sparse selection across layers or heads, and compressing historical information into a small number of reusable representations. The engineering payoff shows up in scenarios such as long-document question answering and repository-level code understanding: better first-token latency and prefix cache hit rates, and lower cost per token.
For evaluation, it is recommended to fix three comparison groups: short-context accuracy, “middle-of-context information recall” for long contexts, and throughput curves at different batch sizes, rather than looking only at average scores.
5. Self-verification and Self-correction
An important branch in math and reasoning is letting the model check and revise itself. Self-verification requires the model to produce a checkable verification process for a candidate answer (for example, substituting the conclusion back into the conditions, or running a consistency check on each step); self-correction then rewrites the answer based on the verification result. Combining the two can noticeably reduce outputs that “look plausible but are actually wrong.”
Implementation points: verification must be decoupled from generation (different prompts, and different sampling temperatures when necessary), otherwise the model tends to confirm its own mistakes; also set a maximum number of correction rounds and a fallback strategy to prevent endless self-loops from driving up costs.
6. Generalizing the Reinforcement Learning Pipeline and Inference Budget Control
Recent public reports generally emphasize two improvements. First, group-relative advantage estimation algorithms (such as the GRPO family) remove the value network and estimate advantages from the relative quality of multiple samples under the same prompt, which is friendlier in both memory usage and implementation complexity. Second, treating “thinking length” as a controllable variable, using length penalties or budget constraints to avoid overly long reasoning.
Pseudocode for inference budget control:
def solve(prompt, budget_tokens, max_rounds=3):ans = generate(prompt, max_tokens=budget_tokens)for _ in range(max_rounds):verdict = verify(ans)if verdict.ok:return ansans = revise(ans, verdict, max_tokens=budget_tokens)return fallback(ans)
There is also a “hybrid reasoning” capability: the same base supports both a low-latency mode that answers directly and a high-quality mode that reasons before answering, with the caller choosing per scenario. In addition, there are enhanced versions aimed at hard competition problems; the idea is to put more reinforcement learning budget into verifiable tasks, at the cost of possibly regressing the general conversational experience, which is a tradeoff to weigh during selection.
7. Engineering and Evaluation Recommendations
- Layered validation: for architecture changes, look at long context and throughput; for post-training changes, look at reasoning accuracy; for reasoning enhancement changes, look at overfitting and reward-hacking risk.
- Cost control: make maximum thinking length, number of correction rounds, and batch size configuration items, and pair them with monitoring, alerting, and logging services to locate anomalous calls.
- Deployment forms: open weights can be hosted on a container platform, with models and data placed in object storage and a vector retrieval service respectively; for managed inference, focus on elastic scaling and rate-limiting policies.
- If you use Baidu AI Cloud’s general capabilities (such as container platform, object storage, logging service, and monitoring and alerting), you can turn the evaluation pipeline into reproducible automated tasks.
8. Summary
From the base model to hybrid reasoning, and then to sparse attention, self-verification and self-correction, and reinforcement learning pipeline optimization, the common thread of this evolution is: trading more efficient attention and sparser activation for efficiency, verifiable rewards for reasoning ability, and budget control for cost certainty. For developers, what really needs to be accumulated is a layered evaluation and cost-constraint mechanism, not chasing a single benchmark ranking.
