A Deep Dive into the Reinforcement Learning Training Pipeline for Reasoning LLMs

    This article breaks down how reasoning-focused large language models are trained with reinforcement learning rather than supervised fine-tuning alone. It explains the two implicit prerequisites of a base model, reconstructs a staged pipeline combining a zero-supervision exploration chain with a five-step alignment chain, and analyzes the group relative policy optimization algorithm that removes the value model. It also covers reward design, rejection sampling, and a practical engineering checklist for sampling throughput, difficulty stratification, and cloud deployment.

    1. Why Reasoning Needs Its Own Training Pipeline

    Reasoning models draw their capabilities from a fundamentally different source than conversational models. Dialogue ability can be acquired through supervised fine-tuning on massive pairs of “question—ideal answer,” which is essentially pattern imitation. Capabilities such as mathematical derivation and code debugging, however, require the model to unfold a self-consistent chain of thought before producing an answer, and to self-correct along the way. Such trajectories are hard to annotate manually, because an annotator would need to write out complete, correct, and stylistically diverse reasoning paths — a process that is extremely costly and limited in coverage.

    The industry has therefore converged on a shared view: reasoning ability is better “grown” through reinforcement learning than “taught” with supervised data. The base model only needs to satisfy two prerequisites — sufficient knowledge, and the ability to generate structurally sound candidate answers. The remaining work of judging right from wrong is handed to automatically verifiable reward signals. The value of this approach is that it shifts annotation cost onto verification cost, and verification is cheap and deterministic in many domains.

    2. Two Implicit Prerequisites of the Base Model

    The pipeline starts from the base model, whose architecture and data composition directly determine the ceiling of subsequent reinforcement learning.

    • Scale and sparsity: A mixture-of-experts architecture with roughly 670 billion total parameters and about 37 billion activated parameters per token is the mainstream choice today for balancing capacity against inference cost. Sparse activation keeps knowledge capacity while controlling the compute of a single forward pass.
    • Data volume and cutoff: Pretraining corpus reaches the order of 10 trillion tokens, with a knowledge cutoff in a specific month. The closer the cutoff, the less the model needs extra data for time-sensitive tasks later.
    • Neutrality of data sources: One notable engineering fact is that even if only ordinary web pages and e-books are declared, with no deliberate use of synthetic data, publicly available web pages inevitably contain answers generated by other models, so the base model may indirectly absorb external knowledge. This is a caution for capability attribution.
    • Domain distribution: A substantial share of the corpus is math and code, meaning the base model has already “seen” a large number of reasoning trajectories — the fundamental reason reinforcement learning can start at all under zero supervised fine-tuning. The corpus is also mainly bilingual in Chinese and English, which explains why later training produces mixed languages without constraints.

    3. Reconstructing the Staged Training Pipeline

    The full pipeline can be abstracted as “one exploration chain plus one alignment chain.”

    The exploration chain begins with zero-supervision reinforcement learning: reinforcement learning is applied directly to the base model with no human-written chain-of-thought data mixed in, in order to test whether reasoning ability can emerge spontaneously. The output of this chain is not a usable product but an understanding of the “boundaries of reward design.”

    The alignment chain contains five stages:

    1. Cold-start supervised fine-tuning: initialize with a small number of high-quality, readable long chain-of-thought samples to fix messy output formats and poor readability;
    2. Stage-one reasoning-oriented reinforcement learning: rely mainly on verifiable rewards to strengthen reasoning depth on math and code tasks;
    3. Rejection sampling for data construction: sample the same batch of questions extensively with the current policy, keep trajectories with correct answers and clear expression, and convert them into supervised data;
    4. Stage-two supervised fine-tuning: mix the above reasoning data with general-task data such as writing, question answering, and coding assistance to restore general capability;
    5. Stage-two full-scenario reinforcement learning: add helpfulness and harmlessness rewards while retaining reasoning rewards, completing alignment.

    The core idea of this structure is “open up first, then narrow down”: first let the model push reasoning ability to the extreme on narrow tasks, then pull it back into a usable general assistant through data mixing and multi-objective rewards.

    4. Analyzing Group Relative Policy Optimization

    Both reinforcement learning stages use the same policy optimization algorithm, motivated by the need to reduce the resource overhead of proximal policy optimization.

    The pain points of proximal policy optimization concentrate on the value model: it needs a critic comparable in size to the policy model to estimate state value, then combines immediate rewards with future returns through generalized advantage estimation. This brings three burdens — doubled memory, increased computation, and a value target that is itself hard to fit, especially in sparse settings where only the final outcome reward exists, making value regression nearly guesswork.

    The replacement idea of group relative policy optimization is straightforward: drop the value model and use a group of samples for the same question as each other’s baseline.

    1. For question q:
    2. Sample a group of outputs {o_1, o_2, ..., o_G} from the old policy
    3. Compute rewards {r_1, r_2, ..., r_G}
    4. Advantage A_i = (r_i - mean(r)) / std(r)
    5. Update the policy with the clipped relative objective

    The pseudocode can be closer to an implementation view:

    1. def group_relative_advantage(rewards):
    2. # rewards: scalar rewards for G sampled outputs of the same question
    3. mean_r = rewards.mean()
    4. std_r = rewards.std() + 1e-8
    5. return (rewards - mean_r) / std_r

    The benefits of this design are a significant drop in memory usage and a shorter training pipeline; the cost is that multiple outputs must be sampled per question, making sampling throughput the new bottleneck, and when all rewards in a group are identical the advantage is zero and no gradient is produced, which must be mitigated by question difficulty filtering and dynamic sampling.

    5. Reward Design Is the Real Dividing Line

    The problems exposed by zero-supervision reinforcement learning point almost entirely to rewards: with only a signal for answer correctness, the model tends toward verbose, repetitive, language-mixed output, because it discovers that “thinking a bit longer” is statistically more likely to land a lucky guess. In engineering, two kinds of rewards are typically used together:

    • Verifiable rewards: whether the answer is correct, whether the code passes tests, whether the format complies — used to constrain reasoning quality;
    • Language consistency rewards: score the consistency between the output language and the question language to suppress language mixing, at the cost of a slight sacrifice in task accuracy, requiring trade-offs per scenario.

    A practical rule of thumb: if your reward function cannot be judged automatically by a program, it is better placed in stage-two full-scenario reinforcement learning than in stage one.

    6. Engineering Implementation Checklist

    • Prioritize sampling throughput: group sampling is the main cost, so plan the inference cluster and concurrency strategy in advance;
    • Difficulty stratification: bucket questions by pass rate, remove all-correct and all-wrong samples, and keep gradients effective;
    • Data mixing ratio: stage two must mix in general-task data, otherwise general capability degrades noticeably;
    • Length and readability constraints: cold-start data determines the ceiling of output style — better fewer than sloppy;
    • Careful attribution: base corpus may contain externally generated content, so capability evaluation should retain ablation experiments;
    • Cloud implementation: run training and sampling separately on elastic resource pools of a container platform, put data and checkpoints in object storage, and connect metrics and alerts to a logging service and a monitoring and alerting system, avoiding building the entire infrastructure stack yourself.

    7. Conclusion

    The training focus for reasoning models has shifted from “piling up annotated data” to “designing verification signals and sampling efficiency.” Mastering the exploratory value of zero-supervision reinforcement learning, the data loop of rejection sampling, and the value-model-free policy optimization method makes it possible to build a reproducible reasoning-capability production line at relatively low cost, then gradually fill in general dialogue and safety alignment as business needs require.