Open-Source LLM Technical Evolution: From Architecture to Inference Reinforcement
This article traces a technical path for open-source large language models: how base models reduce inference cost through latent attention cache compression and Mixture of Experts, how Reinforcement Learning with Verifiable Rewards builds multi-step reasoning ability, and how hybrid reasoning, sparse attention, and self-verification extend capability boundaries. It explains the design motivations behind each step and provides practical criteria for evaluating deployment cost, latency, long-context throughput, and reasoning quality.
Introduction
Open-source large models iterate quickly. Looking only at benchmark scores for a single version makes it difficult to understand why it works. A more valuable approach is to trace a technical path: how base models control inference cost, how they acquire reasoning ability through reinforcement learning, and how they extend capability boundaries through sparsification and self-verification. This article follows that path step by step, explains the design motivation behind each step, and provides criteria developers can directly apply.
1. Base Architecture: Compressing the Attention Cache with Latent Representations
Transformer self-attention needs to cache the keys and values of every layer during inference. As context grows longer, this cache consumes a large amount of GPU memory and becomes a major throughput bottleneck. Multi-head Latent Attention (MLA) takes a different approach: instead of caching full K and V directly, it compresses the hidden state into a low-dimensional latent vector and projects it back when needed. The cache size therefore drops significantly, at the cost of a small amount of additional projection computation.
A common companion design is Mixture of Experts (MoE). The model has a very large total parameter count, but each token activates only a few experts, so the computation for a single forward pass is far smaller than the total parameter scale. When evaluating deployment cost, consider three metrics together: total parameter count, activated parameter count, and KV cache footprint. Looking only at total parameter count can lead to highly misleading conclusions.
2. Reinforcement Learning: Training Reasoning Ability with Verifiable Rewards
Base models are good at language modeling, but multi-step reasoning chains are often unstable. Reinforcement Learning with Verifiable Rewards (RLVR) targets this problem. Its rewards are determined by programs rather than by another scoring model. Common verification methods include math answer matching, unit test pass status, and output format validation. Because rewards can be precisely verified by programs, the model is less able to obtain high scores by catering to a scorer, and the training signal is cleaner.
A typical RLVR workflow has three steps. First, use a small set of high-quality samples for cold-start fine-tuning to stabilize the output format. Second, run reinforcement learning on large-scale verifiable tasks, encouraging the model to explore longer reasoning paths. Third, use rejection sampling or distillation to recycle successful reasoning trajectories into general conversation data, preventing capability degradation in non-reasoning scenarios.
3. Hybrid Reasoning: One Model Supports Two Working Modes
An early common practice was to deploy two models: a chat model with fast responses and a reasoning model that is slower but more accurate. Maintaining two models is costly, and the application layer also has to handle routing. Hybrid reasoning merges both modes into the same set of weights and uses a switch in the chat template to decide whether to output the thinking process.
From an engineering perspective, the caller needs to clarify two things: whether thinking mode is enabled, and whether the thinking content is returned to end users. A recommended practice is to keep the thinking process in server logs or a collapsed area and show only the final answer to users. At the same time, set latency and cost budgets separately for the two modes. Disable thinking mode for simple Q&A, and enable it for complex tasks with a higher output length limit.
Example code (field names should follow the relevant API documentation of the platform in use):
function build_request(prompt, need_reasoning):mode = "reasoning" if need_reasoning else "chat"max_output = 8192 if need_reasoning else 1024return {"mode": mode,"max_output_tokens": max_output,"messages": [{"role": "user", "content": prompt}]}
4. Sparse Attention: Making Long-Context Computation Grow More Gently
In standard attention, every query computes relevance against all historical tokens, and computation grows quadratically with sequence length. Sparse attention first uses a lightweight scoring module to select the k most relevant historical tokens, then performs full attention only at those k positions. Computation changes from growing with the square of sequence length to growing with the product of sequence length and k. When k is fixed, the overhead growth as context lengthens slows markedly.
The difficulty lies in the selector itself. The scoring process must be cheap enough; otherwise the gains are offset. Selection results also need to be trainable, and the selector usually needs to learn the distribution of the main attention. Before launch, verify three things: whether generation quality on short text degrades, whether recall of key information in long text is stable, and whether throughput actually improves on the target hardware.
Example pseudocode (in real systems, the scorer is far cheaper than full dot products):
function sparse_attention(q, K, V, top_k):scores = [dot(k_i, q) for k_i in K]selected = indices of the top_k largest scoresweights = softmax(scores restricted to selected)return sum(weights[i] * V[selected[i]] for i in range(top_k))
5. Self-Verification and Self-Correction: An Approach for Proof-Oriented Tasks
Mathematical proofs and formal derivations are difficult to evaluate with single-answer matching, because the derivation process matters more than the final conclusion. Self-verification has the model act as a verifier, check the reasoning chain step by step, identify erroneous steps, and give the basis for its judgment. Self-correction rewrites the derivation according to the verification feedback, checks it again, and repeats until it passes or reaches the round limit.
This process has two key points. First, the verification prompt must be designed independently to avoid the verifier inheriting the generator’s erroneous premises. Second, the number of correction rounds must be capped.
