Technical Principles of Deep Thinking Models and Practical Reproduction

    This article breaks down the engineering fundamentals behind deep thinking models and how to reproduce them. It explains how sparse Mixture-of-Experts architectures decouple total parameters from activated parameters, why pure reinforcement learning can emerge long-chain reasoning, and how a multi-stage training pipeline improves readability and alignment. It also covers long-context cost control, a four-step reproduction roadmap, and acceptance criteria, showing that success depends more on reward quality and sampling throughput than on parameter scale.

    1. Why Deep Thinking Models Deserve Separate Discussion

    Over the past two years, models with long-chain reasoning ability have become a focus of industry attention. The original article, credited to the author “Muyao,” records a frontline algorithm engineer’s reproduction summary of a long-thinking model paper with roughly 671B parameters, about 37B activated, and support for a 128K context. Once the specific product attributes are stripped away, the question with real engineering value is this: how do you turn “the ability to think” into a trainable, evaluable, and reproducible engineering process using sparse architectures and reinforcement learning?

    The difference between a deep thinking model and a conventional conversational model lies not in parameter count itself but in three points. First, the output contains an explicit and lengthy intermediate reasoning process. Second, the training signal comes more from result correctness than from human preference scores. Third, inference cost grows linearly or even super-linearly with the length of the thinking. These three points mean the model cannot follow the conventional supervised fine-tuning plus preference alignment approach.

    2. Sparse Architecture: Decoupling Total and Activated Parameters

    The core structural feature mentioned in the original article is roughly 671B total parameters with about 37B activated per token. This belongs to the general design paradigm of sparse Mixture-of-Experts (MoE) architectures: each layer contains multiple expert networks, and a routing module selects a few experts to participate in computation for each token.

    The engineering implication of this design is that memory and storage cost are determined by total parameters, while computation cost is determined by activated parameters. As a result, the bottleneck during reproduction is often not compute but memory capacity and the communication overhead introduced by expert parallelism. A common practice is to introduce a load balancing loss to avoid routing collapse onto a few experts, together with a capacity factor that limits the number of tokens a single expert receives, preventing overflow and dropping under long sequences.

    The illustrative routing and balancing logic can be abstracted as:

    1. # Pseudocode: sparse routing + load balancing
    2. logits = router(hidden_states) # [tokens, num_experts]
    3. probs = softmax(logits, dim=-1)
    4. topk_idx, topk_w = topk(probs, k=2)
    5. topk_w = topk_w / topk_w.sum(-1, keepdim=True) # weight normalization
    6. # Load balancing: suppress routing collapse
    7. load = scatter_count(topk_idx, num_experts)
    8. balance_loss = num_experts * (load.mean() ** 2).mean()

    Engineering practice also requires attention to the following: with expert parallelism, all-to-all communication volume is large, so it is advisable to combine expert-dimension partitioning with data parallelism and pipeline parallelism, and to overlap routing computation with communication; otherwise long-context training will show noticeable bubbles.

    3. The Pure Reinforcement Learning Path: Verify Feasibility First, Then Discuss Results

    The first group of models emphasized in the original article is a zero-start model trained with reinforcement learning only, used to verify that the technical route is feasible. At this point, long-chain reasoning behaviors such as reflection and self-verification already emerge. The methodological value of this conclusion is higher than its metric value: it shows that outcome-oriented sparse rewards are sufficient to let the model spontaneously search for longer thinking paths.

    Actionable points include:

    • Prioritize automatically verifiable rule-based rewards for reward design, such as exact answer matching, code passing test cases, and verifiable math results, to avoid a reward model being fooled by “lengthy but empty” expressions.
    • Adopt a group-relative advantage estimation style algorithm that samples multiple answers for the same question and normalizes advantages using the group mean and standard deviation, removing the need for a separate value network and significantly reducing memory pressure.
    • Set a thinking-length penalty or length cap to prevent the model from racking up tokens with meaningless repetition.
    • Keep a weakened version of the KL constraint; too strong a constraint early on suppresses exploration and prevents the reasoning chain from growing longer.

    It is worth noting that the pure reinforcement learning path is extremely sensitive to sampling throughput. The rollout stage should be made asynchronous, decoupling generation from training and buffering samples with a message queue or similar mechanism to avoid the generation side sitting idle.

    4. Multi-Stage Training: Cold Start, Alignment, and Further Reinforcement

    A pure reinforcement learning base model usually suffers from mixed languages, unstable formatting, and poor readability. The multi-stage paradigm commonly adopted in the industry is:

    1. Cold-start supervised fine-tuning: initialize with a small number of high-quality long-thinking samples to stabilize output format and language.
    2. Reasoning-oriented reinforcement learning: rely mainly on rule-based rewards to strengthen math, code, and logic capabilities.
    3. Rejection sampling fine-tuning: sample a large number of answers from the current model, filter them with rules and a discriminative model, then feed them back into training to improve coverage and difficulty distribution.
    4. Full-scenario preference alignment: introduce preference signals for helpfulness and safety, balancing the general conversational experience.

    Each stage should fix the evaluation set and decoding parameters; otherwise cross-stage comparisons lose meaning. On the data side, the key is not quantity but difficulty stratification: overly easy samples drive the reinforcement learning advantage toward zero, and the gradient contribution nearly disappears.

    5. Long Context and Inference Cost Control

    A 128K-level context means attention overhead becomes the main cost. General optimization techniques include grouped-query attention to reduce the number of KV heads, key-value cache quantization, chunked prefill, and interpolation strategies for position-encoding extrapolation. On the inference-serving side, it is advisable to deploy long-thinking requests and short conversational requests in separate pools to avoid long requests blocking the queue; the intermediate reasoning process should also be exposed as an optional return field, letting the caller decide whether to persist it to object storage in order to control logging-service costs.

    6. Reproduction Roadmap and Acceptance Recommendations

    It is recommended to proceed in four steps: small-scale validation, structural alignment, data loop, and serving. First, run the full pipeline on a ten-billion-scale sparse model to confirm that the reward, routing, and parallelism strategies have no defects; then gradually scale up; next, build an automated evaluation pipeline covering four task categories: math, code, instruction following, and safety; finally, integrate monitoring and alerting to track the thinking-length distribution, truncation rate, and drift in mean reward. If compute resources are tight, you can leverage the elastic scheduling of a container platform and relevant general capabilities from Baidu AI Cloud to handle elastic scaling and cost attribution.

    The core conclusion is that the capability of a deep thinking model comes from the synergy of three elements: sparse architecture provides capacity, reinforcement learning provides search, and multi-stage data provides readability. Reproduction success or failure usually depends on reward quality and sampling throughput rather than parameter scale alone.