Open-Source LLM Evolution: From Core Architecture to Reasoning Reinforcement Learning

    This article traces the technical evolution of a representative open-source large language model series, version by version. It covers four key stages: reducing inference cost in the base architecture, enhancing reasoning ability, improving computational efficiency for long contexts, and reinforcement learning with verifiable rewards. The numbers used here only illustrate how the calculations work and do not represent measured results for any model.

    1. Why Track the Technical Evolution Path

    Open-source large language models iterate quickly. Looking only at a release’s parameter count or benchmark scores makes it hard to judge its technical value. A more effective approach is to follow the version sequence and ask what bottleneck each generation addressed, which mechanisms it introduced, and how those mechanisms work together.

    This article uses a typical open-source model evolution path as an example and breaks it into four key stages: inference cost optimization in the base architecture, reasoning enhancement, computational efficiency improvements for long contexts, and reinforcement learning based on verifiable rewards. The numbers in this article only illustrate how the calculations work and do not represent measured results for any model.

    2. Release Cadence and Version Relationships

    Most open-source model series follow a similar iteration cadence, which roughly consists of four steps:

    • A base model is released first, providing general capabilities and an architectural foundation.
    • A reasoning-enhanced version is trained on top of the base model, with a focus on math, code, and multi-step reasoning.
    • Several intermediate versions are released to validate new mechanisms, such as sparse attention or new training algorithms.
    • Mechanisms that prove effective are merged into a formal release, forming a stronger next-generation model.

    This cadence lets teams introduce new technology in stages, keeping the risk at each step under control. Community feedback is also collected during the intermediate version stage and influences later training data and evaluation priorities. For users, watching changes in intermediate versions often reveals the technical direction more clearly than watching formal releases alone.

    3. Trade-offs Between Hybrid and Dedicated Reasoning

    Reasoning-enhanced models generally follow two approaches.

    • Dedicated reasoning models: These are optimized only for long chain-of-thought tasks. Their reasoning output is longer, and per-request latency is higher. They suit high-difficulty scenarios such as math competition problems and complex code debugging.
    • Hybrid reasoning models: A single set of weights supports both a thinking mode and a non-thinking mode, which can be switched through a template or a parameter. Daily conversation and simple Q&A use the non-thinking mode, which offers faster responses and lower cost.

    The engineering value of the hybrid approach is lower maintenance cost, since only one model needs to be maintained. However, training becomes harder. The data mix for the two modes must be balanced carefully. Otherwise, the general capabilities of the non-thinking mode may degrade, or the thinking mode may become unnecessarily verbose on simple questions.

    In practice, the following rules can guide the choice of mode:

    • When a task requires multi-step derivation and the answer can be verified, enable the thinking mode.
    • When a task mainly involves information retrieval, format conversion, or short Q&A, use the non-thinking mode.
    • When you are unsure which to use, run the workflow in non-thinking mode first, then retry the failed samples individually with the thinking mode enabled.

    4. Base Architecture: Multi-Head Latent Attention and Cache Compression

    During inference, the memory bottleneck mainly comes from the key-value (KV) cache. When a model generates each new token, it must keep the key and value vectors of all previous tokens at every layer. The longer the context, the more memory the cache occupies, and this memory grows roughly linearly with sequence length.

    The idea behind multi-head latent attention is to avoid caching full keys and values directly. Instead, the keys and values are first projected into a lower-dimensional latent vector, which is what gets stored. When attention is computed, the latent vector is projected back up. Because the cache holds low-dimensional vectors, memory usage drops.

    This design involves a clear trade-off:

    • Benefit: The cache size shrinks significantly, so the same memory can support a longer context or a larger batch.
    • Cost: Each computation requires extra projection operations, so the amount of computation increases slightly.

    The following simplified estimate illustrates the difference in cache size. Suppose a layer has 16 attention heads, each with a dimension of 128. A full cache stores keys and values for each token in a total of 2 × 16 × 128 = 4096 elements. If the keys and values are compressed into a 512-dimensional latent vector, each token needs to store only 512 elements. In theory, the cache shrinks to one-eighth of its original size. Real systems also store additional components such as positional encoding, so the actual compression ratio is somewhat lower than this figure.

    5. Reasoning Enhancement: Reinforcement Learning with Verifiable Rewards

    Reinforcement learning with verifiable rewards means that the reward signal comes from results that a program can judge automatically, rather than from human preference labels. Common reward sources include:

    • Comparing math answers against standard answers.
    • Checking whether code passes unit tests.
    • Checking whether the output follows the required format, such as including specified structured fields.

    This approach has the advantage of an objective signal, which makes it harder for the model to “please” the scorer. It also has clear challenges:

    • Sparse rewards: Positive feedback arrives only when the final answer is correct, so intermediate reasoning steps rarely receive a direct signal.
    • Reward hacking: The model may learn to exploit weaknesses in the verification script, such as hard-coding the expected outputs of test cases.
    • Unstable training: The reward distribution shifts as training progresses, and the training is sensitive to hyperparameters.

    For policy optimization, a common method is to sample a group of responses to the same question and use the group’s average reward as a baseline. The relative advantage of each response is then computed against that baseline. This avoids the cost of training a separate value network. Below is an illustrative code snippet for computing group-relative advantages:

    1. def group_advantages(rewards):
    2. mean = sum(rewards) / len(rewards)
    3. var = sum((r - mean) ** 2 for r in rewards) / len(rewards)
    4. std = var ** 0.5
    5. # Normalize within the group; add a small constant to avoid division by zero
    6. return [(r - mean) / (std + 1e-6) for r in rewards]

    Several details need attention in practice. The group size affects how stable the baseline estimate is. Differences in response length can bias the advantage estimates, which can be corrected through normalization or a length penalty. Policy updates usually need clipping and constraints to prevent overly large single-step updates.

    6. Long Context: Sparse Attention to Reduce Computational Cost

    The computation required by standard attention grows with the square of the sequence length. When the context expands from a few thousand tokens to hundreds of thousands, computational cost rises quickly. The core idea of sparse attention is that each query interacts with only a subset of the historical keys, rather than all of them.

    One common implementation has two stages. First, a lightweight scoring module quickly evaluates the relevance of all historical positions. Then, full attention is computed only for the small set of positions with the highest scores. An illustrative workflow is shown below:

    1. scores = lightweight_indexer(query, all_keys) # Lightweight scoring, far cheaper than full attention
    2. topk_idx = select_top_k(scores, k) # Select the k most relevant positions
    3. out = attention(query, keys[topk_idx], values[topk_idx])

    The key trade-offs of this method are as follows:

    • Risk of wrong selection: If the scoring module misses critical information, the main model cannot recover it. The quality of the indexer therefore directly determines the result.
    • Training alignment: The scoring module must be trained jointly with the main model. Otherwise, the two may focus on different things.
    • Dependence on the scenario: When the context is short, the cost of full attention is modest, so sparsification offers limited benefit. The gains are more evident in long-context scenarios.

    The actual speedup depends on the specific implementation, hardware, and sequence length. Measure it on your own workload rather than adopting someone else’s numbers directly.

    7. Self-Verification and Self-Correction

    In tasks such as math reasoning, a model can first generate an answer and then act as a verifier, checking each reasoning step and correcting any errors it finds. A practical workflow looks like this:

    • Generate an initial solution and output the reasoning steps.
    • In the verification step, check each step, flag doubtful steps, and give reasons.
    • Revise the flagged steps and generate a new solution.
    • Verify the revised result again, with an upper limit on iterations to prevent endless loops.

    Two points need attention in this design. First, the verification output should itself be assessable. If the verification step only outputs “correct” or “incorrect” without justification, the model may learn to state conclusions confidently without actually checking the process. Second, the cost of verification and revision adds to inference latency. This approach suits tasks that require high accuracy and are not sensitive to latency.

    8. Updating Reinforcement Learning for Overall Capability

    Reinforcement learning focused only on math problems tends to degrade the model’s performance on other tasks. For this reason, training updates usually mix several task types: reasoning problems, coding problems, general conversation, tool calling, and others. Verifiable tasks use rule-based rewards, while open-ended tasks may rely on a reward model.

    Training also needs to control reasoning length. Unlimited encouragement of long reasoning raises cost and may cause the model to overthink simple questions. A common approach is to set reasoning budgets for different difficulty levels, so the model learns to allocate its thinking according to the complexity of each question.

    Extended thinking mode allows the model to use a longer reasoning budget on high-difficulty tasks. Its benefit shows up in accuracy on complex problems. The cost is that each request consumes more output tokens and takes longer. Whether to enable it should depend on both the value of the task and its cost.

    9. Engineering Recommendations

    When turning these techniques into a real system, consider the following principles:

    • Choose the mode by task: Use the non-thinking mode for simple tasks and the thinking mode for complex reasoning tasks, and record the cost difference between the two.
    • Build your own evaluation set: Public leaderboards may overlap with training data and may not reflect real business performance. An evaluation set should cover your core scenarios and be updated regularly.
    • Evaluate multiple metrics together: Accuracy, time to first token, cost per request, and stability with long contexts are all necessary. Optimizing only one metric often hurts the others.
    • Check for data contamination: Confirm that evaluation samples do not appear in the training data, or the scores will be inflated.
    • Review open-source licenses: Before using open-source weights, review the license terms, including