3 Efficient RL Scaling: Algorithms and Lightning Attention
本文为论文《MiniMax-M1:用闪电注意力高效扩展测试时计算》「论文原文」板块的对应章节,按 arXiv 官方全文逐字保留,层级与「中文全文翻译」板块一一对应。
As shown in Figure 1 (Right), the M1 architecture demonstrates a clear efficiency advantage during inference. This naturally facilitates efficient RL scaling where increasingly longer responses are generated. However, as pioneers in scaling up RL with this hybrid architecture, we encounter unique challenges during the process, and the RL procedure can become unstable or even fail due to various issues. To address these difficulties, we develop targeted solutions that enable us to successfully scale up RL training for M1. In addition, we propose a new RL algorithm that achieves greater RL efficiency compared to existing methods. These dual contributions yield an efficient and scalable RL framework for training M1, where the complete training cycle requires 3 weeks on 512 H800 GPUs—equivalent to a rental cost of approximately $0.53M USD. In this section, we first provide general context on RL and present our novel RL algorithm, and then describe the specific challenges we face with the hybrid architecture, along with the solutions we devise to overcome them.
3.1 Efficient RL Scaling with CISPO
Background. For questions $q$ from a dataset $\mathcal{D}$, we denote $\pi$ as the policy model parameterized by $\theta$, and $o$ as the response generated by the policy. PPO (Schulman et al., 2017) adopts the following objective to optimize the policy to maximize the expected return, and a clipping operation is applied to stabilize training:
| $\displaystyle\mathcal{J}_{\text{PPO}}(\theta)$ | $\displaystyle=\mathbb{E}{q\sim\mathcal{D},o{i}\sim\pi_{\theta_{\text{old}}}(\cdot|q)}$ | (1) | ||
|---|---|---|---|---|
| $\displaystyle\left[\frac{1}{|o_{i}|}\sum_{t=1}^{|o_{i}|}\min\left(r_{i,t}(\theta)\hat{A}{i,t},\text{clip}\big(r{i,t}(\theta),1-\epsilon,1+\epsilon\big)\hat{A}{i,t}\right)-\beta D{KL}(\pi_{\theta}||\pi_{\text{ref}})\right],$ |
where $r_{i,t}(\theta)=\frac{\pi_{\theta}(o_{i,t}\mid q,o_{i,(Shao et al., 2024) eliminates the value model and defines the advantage as the output reward relative to other responses in the group:
| | $\hat{A}{i,t}=\frac{R{i}-\text{mean}({R_{j}}{j=1}^{G})}{\text{std}({R{j}}_{j=1}^{G})},$ | | (2) |
where $R_{i}$ is the reward of the response, and $G$ responses ${o_{i}}^{G}_{i=1}$ are sampled for each question. The reward is either from rule-based verifiers such as in mathematical problem solving, or from a reward model.
Issues of Token Clipping. In our initial experiments with the hybrid architecture under the zero-RL setting, we observed that the GRPO algorithm adversely affected training performance and failed to effectively promote the emergence of long CoT reasoning behaviors. Through a series of controlled ablation studies, we ultimately identified the undesirable clipping operation in the original PPO/GRPO loss as the primary factor contributing to degraded learning performance. Specifically, we found that tokens associated with reflective behaviors (e.g., However, Recheck, Wait, Aha), which often serve as “forks” in reasoning paths, were typically rare and assigned low probabilities by our base model. During policy updates, these tokens were likely to exhibit high $r_{i,t}$ values. As a result, these tokens were clipped out after the first on-policy update, preventing them from contributing to subsequent off-policy gradient updates. This issue was particularly pronounced in our hybrid-architecture model and further hindered the scalability of reinforcement learning. These low-probability tokens, however, are often crucial for stabilizing entropy (Cui et al., 2025) and facilitating scalable RL (Wang et al., 2025). Although DAPO attempts to mitigate this issue by increasing the upper clipping bound (Yu et al., 2025), we found this approach to be less effective in our setup, which involved 16 rounds of off-policy updates per generation batch.

Figure 2: Comparison of GRPO, DAPO, and our proposed CISPO on AIME 2024, based on Qwen2.5-32B-base. CISPO outperforms both GRPO and DAPO in terms of performance at the same number of training steps, and achieves comparable performance to DAPO using 50% of the training steps.
The CISPO Algorithm. In response, we propose a new algorithm that explicitly avoids dropping tokens, even those associated with large updates, while inherently maintaining entropy within a reasonable range to ensure stable exploration. First, recall that the vanilla REINFORCE objective with corrected distribution for offline updates is:
| $\displaystyle\mathcal{J}_{\text{REINFORCE}}(\theta)$ | $\displaystyle=\mathbb{E}{(q,a)\sim\mathcal{D},o{i}\sim\pi_{\theta_{\text{old}}}(\cdot|q)}$ | (3) | ||
|---|---|---|---|---|
| $\displaystyle\left[\frac{1}{|o_{i}|}\sum_{t=1}^{|o_{i}|}\texttt{sg}(r_{i,t}(\theta))\hat{A}{i,t}\log\pi{\theta}(o_{i,t}\mid q,o_{i,where $\texttt{sg}(\cdot)$ denotes the stop-gradient operation. | ||||
| Rather than clipping the token updates as in PPO/GRPO, we instead clip the importance sampling weight in Eq. 3 to stabilize training. | ||||
| We term our approach CISPO (Clipped IS-weight Policy Optimization). Adopting the group relative advantage from GRPO and the token-level loss (Yu et al., 2025; Liu et al., 2025b), CISPO optimizes the following objective: |
| $\displaystyle\mathcal{J}_{\text{CISPO{}}}(\theta)$ | $\displaystyle=\mathbb{E}{(q,a)\sim\mathcal{D},{o{i}}{i=1}^{G}\sim\pi{\theta_{\text{old}}}(\cdot|q)}$ | (4) | ||
|---|---|---|---|---|
| $\displaystyle\left[\frac{1}{\sum_{i=1}^{G}|o_{i}|}\sum_{i=1}^{G}\sum_{t=1}^{|o_{i}|}\texttt{sg}(\hat{r}{i,t}(\theta))\hat{A}{i,t}\log\pi_{\theta}(o_{i,t}\mid q,o_{i,where $\hat{r}_{i,t}(\theta)$ is the clipped IS weight: |
| | $\hat{r}{i,t}(\theta)=\text{clip}\left(r{i,t}(\theta),1-\epsilon^{IS}{low},1+\epsilon^{IS}{high}\right).$ | | (5) |
We note that without weight clipping, $\mathcal{J}{\text{CISPO{}}}$ reduces to the standard policy gradient objective. In our experiments, we did not impose a lower bound on the IS weight by setting $\epsilon^{IS}{low}$ to a large value; instead, we only tuned $\epsilon^{IS}_{high}$. Although the gradient of Eq. 4 is slightly biased due to weight clipping, this approach preserves gradient contributions from all tokens, especially in long responses. CISPO proves effective in our experiments, helping reduce variance and stabilizing RL training. In addition, we utilize the dynamic sampling and length penalty techniques from Yu et al. (2025). There is no KL penalty term in CISPO similar to other recent works (Yu et al., 2025; Hu et al., 2025).
A General Formulation. While we adopt CISPO in our experiments, here we further present a unified formulation by introducing a token-wise mask into the CISPO objective. This allows for hyperparameter tuning to control whether, and under what conditions, gradients from specific tokens should be dropped:
| $\displaystyle\mathcal{J}_{\text{unify}}(\theta)$ | $\displaystyle=\mathbb{E}{(q,a)\sim\mathcal{D},{o{i}}{i=1}^{G}\sim\pi{\theta_{\text{old}}}(\cdot|q)}$ | (6) | ||
|---|---|---|---|---|
| $\displaystyle\left[\frac{1}{\sum_{i=1}^{G}|o_{i}|}\sum_{i=1}^{G}\sum_{t=1}^{|o_{i}|}\texttt{sg}(\hat{r}{i,t}(\theta))\hat{A}{i,t}\log\pi_{\theta}(o_{i,t}\mid q,o_{i,The mask $M_{i,t}$ is equivalent to the mask implicitly defined in the PPO trust region: |
| | $M_{i,t}=\begin{cases}0&\text{if }\hat{A}{i,t}>0\text{ and }r{i,t}(\theta)>1+\epsilon_{\text{high}},\ 0&\text{if }\hat{A}_{i,t}This unified loss formulation can flexibly represent different clipping strategies under a common framework.
Empirical Validation of CISPO. To validate the effectiveness of CISPO, we empirically compare it with DAPO and GRPO in a zero-RL training setting. Specifically, we apply different RL algorithms to train the Qwen2.5-32B-base model on the mathematical reasoning dataset from Yu et al. (2025), and report performance on the AIME 2024 benchmark. As shown in Figure 2, CISPO significantly outperforms both DAPO and GRPO with the same number of training steps. Notably, CISPO demonstrates superior training efficiency compared to other approaches; for example, it matches DAPO’s performance with only 50% of the training steps.
3.2 Efficient RL Scaling with Lightning Attention – Challenges and Recipes


Figure 3: Probability of tokens in training-mode code vs. probability of tokens in inference-mode code. Each point in the figures represents an individual token. The Pearson correlation coefficient is indicated in the figures. Theoretically, the two probabilities should be identical, and all the tokens should be exactly on the diagonal line. Left: Correlation of the M1 model before our fix; Right: Correlation of the M1 model after applying our fix of using FP32 precision for the LM output head.
As shown in Figure 1 (Right), we emphasize that our hybrid attention inherently enables more efficient RL scaling compared to traditional attention designs, since rollout computation and latency are often the primary bottlenecks in RL training. However, as pioneers in conducting large-scale RL experiments with this novel architecture, we encountered unique challenges and developed targeted solutions, as we describe below.
Computational Precision Mismatch in Generation and Training. RL training is highly sensitive to computational precision. During our RL training, we observed a significant discrepancy in the probabilities of rolled-out tokens between training-mode and inference-mode, as shown in Figure 3 (Left). This discrepancy arose from a precision mismatch between the training and inference kernels. The issue was detrimental and prevented reward growth in our experiments. Interestingly, this issue did not appear in smaller, dense models with softmax attention. Through layer-by-layer analysis, we identified high-magnitude activations in the LM head at the output layer as the primary source of error. To address this, we increased the precision of the LM output head to FP32, thereby realigning the two theoretically identical probabilities, as demonstrated in Figure 3 (Right). This adjustment improved the correlation between training and inference probabilities from approximately 0.9x to 0.99x. Notably, this correlation metric remained stable throughout training, enabling successful reward increase.
Optimizer Hyperparameter Sensitivity. We employ the AdamW (Loshchilov and Hutter, 2019) optimizer, and inappropriate configurations of $\beta_{1}$, $\beta_{2}$, and $\epsilon$ can lead to non-convergence during training. (Molybog et al., 2023). For instance, using the default configuration from VeRL (Sheng et al., 2024), where betas = (0.9, 0.999) and eps = 1e-8, can result in such issues. We have observed that the gradient magnitudes in MiniMax-M1 training span a wide range, from 1e-18 to 1e-5, with the majority of the gradients being smaller than 1e-14. Furthermore, the correlation between the gradients of adjacent iterations is weak. Based on this, we set $\beta_{1}=0.9$, $\beta_{2}=0.95$, and eps=1e-15.
Early Truncation via Repetition Detection. During RL training, we found that complex prompts could induce pathologically long and repetitive responses, whose large gradients threatened model stability. Our goal was to preemptively terminate these generation loops rather than penalize the already repetitive text. As simple string-matching is ineffective against varied repetition patterns, we developed a heuristic based on token probabilities. We observed that once a model enters a repetitive cycle, the probability for each token soars. Consequently, we implemented an early truncation rule: generation is halted if 3,000 consecutive tokens each have a probability above 0.99. This method successfully prevents model instability and improves generation throughput by eliminating these pathological, long-tail cases.
