\documentclass[11pt]{article} \usepackage{common} \begin{document} \notehead{0107}{CISPO: clip the importance weight, not the update}{Policy-optimisation lineage, batch M1. Companion notebook: \texttt{notebooks/0107-cispo.ipynb}.} \begin{problem} \question{Can an off-policy update keep the rare high-ratio tokens that clipping silences, while still bounding the weights?} Off-policy updates on one batch (0103) need the ratio $r_{i,t}=\pi_\theta/\pi_{\rm old}$. PPO and GRPO handle large ratios by \emph{removing the token from the gradient} once it has moved past the clip range in the favourable direction (0104). MiniMax-M1 (arXiv:2506.13585, Sec.~3.1) found that this silences exactly the tokens that matter most for long-CoT learning: rare ``fork'' tokens (\emph{However, Recheck, Wait, Aha}) have low probability under the base model, hence a large ratio after the first update, and are ``clipped out after the first on-policy update, preventing them from contributing to subsequent off-policy gradient updates'' (they run 16 off-policy rounds per generation batch). DAPO's larger $\epsilon_{\rm hi}$ (0106) was ``less effective'' in their setup. CISPO (Clipped IS-weight Policy Optimization) is their fix; it is the RL objective Mistral names for Leanstral~1.5. The announcement gives no equations; the Leanstral technical report (Sec.~2.3) states the objective but not the truncation value $c$. Sections 1--6 below follow the MiniMax paper; the report's variant is derived in the subsection \emph{Leanstral variant}. \end{problem} \section{Notation} \begin{center}\small\begin{tabular}{@{}ll@{}}\toprule symbol & meaning\\\midrule $r_{i,t}=\pi_\theta(o_{i,t}|s_{i,t})/\pi_{\rm old}(o_{i,t}|s_{i,t})$ & token importance weight\\ $\hat A_i$ & group advantage (0105), shared by all tokens of $o_i$\\ $\sg(\cdot)$ & stop-gradient: value kept, derivative set to $0$\\ $\hat r_{i,t}=\clip(r_{i,t},1-\epsilon^{IS}_{\rm low},1+\epsilon^{IS}_{\rm high})$ & clipped IS weight (Eq.~5)\\ $w(r,A)$ & gradient weight: loss gradient $=w\cdot A\cdot\nabla\log\pi_\theta(o_t|s_t)$\\ $M_{i,t}\in\{0,1\}$ & token mask (Eqs.~6--7)\\ $\epsilon_{\rm hi},\epsilon_{\rm lo}$ & PPO clip bounds (DAPO values $0.28,\,0.2$ used for the tables)\\\bottomrule\end{tabular}\end{center} \section{Derivation} \subsection{Start from the importance-weighted policy gradient} 0103 gave the exact off-policy gradient with the sequence weight; its token-level form, with the weights treated as constants, is the ``vanilla REINFORCE objective with corrected distribution for offline updates'' (M1 Eq.~3; M1 writes the per-sample normaliser $1/|o_i|$ there and the token-level $1/\sum_i|o_i|$ only in Eq.~4, which we use throughout so that Eqs.~\eqref{eq:reinf} and \eqref{eq:cispo} differ by the clip alone): \begin{equation}\mathcal J_{\rm REINFORCE}=\E\Big[\frac1{\sum_i|o_i|}\sum_{i,t}\sg\big(r_{i,t}\big)\,\hat A_{i}\,\log\pi_\theta(o_{i,t}\mid s_{i,t})\Big],\qquad\nabla\mathcal J=\E\Big[\tfrac1{\sum|o_i|}\textstyle\sum_{i,t}r_{i,t}\hat A_i\nabla\log\pi_\theta\Big].\label{eq:reinf}\end{equation} Since $r\nabla\log\pi=\nabla r$, this is also $\nabla$ of the unclipped surrogate $\E[r\hat A]$ of 0104. The stop-gradient is what makes the \emph{value} of the loss a different function from its gradient: only $\nabla\log\pi$ is differentiated. \ver{at $\theta_{\rm old}$ ($r\equiv1$) the gradient of Eq.~\eqref{eq:reinf} equals the exact $\nabla J$ to $4.2\times10^{-17}$.} \subsection{PPO/GRPO is Eq.~(\ref{eq:reinf}) times a mask} From 0104 the PPO gradient of one token is $A\,r\,\indb{\rm live}\,\nabla\log\pi$ with $\mathrm{live}=(A>0\wedge r<1+\epsilon_{\rm hi})\vee(A<0\wedge r>1-\epsilon_{\rm lo})$. That is Eq.~\eqref{eq:reinf} multiplied by the mask of M1 Eq.~7: $M=0$ if $A>0$ and $r>1+\epsilon_{\rm hi}$, $M=0$ if $A<0$ and $r<1-\epsilon_{\rm lo}$, else $M=1$ (M1 Eq.~6 is the unified form $\sg(\hat r)\hat A\log\pi\,M$). \ver{unified form with $\hat r=r$ and this mask equals the autograd gradient of the PPO loss to $1.4\times10^{-17}$; the silenced set computed from the weights equals the mask-zero set exactly (symmetric difference $0$).} \subsection{CISPO: keep every token, clip its weight} Rather than masking, clip the weight and stop its gradient (M1 Eqs.~4--5): \begin{equation}\mathcal J_{\rm CISPO}=\E\Big[\frac1{\sum_i|o_i|}\sum_{i,t}\sg\big(\hat r_{i,t}\big)\hat A_i\log\pi_\theta(o_{i,t}\mid s_{i,t})\Big],\quad\hat r=\clip\big(r,1-\epsilon^{IS}_{\rm low},1+\epsilon^{IS}_{\rm high}\big).\label{eq:cispo}\end{equation} MiniMax ``did not impose a lower bound on the IS weight by setting $\epsilon^{IS}_{\rm low}$ to a large value; instead, we only tuned $\epsilon^{IS}_{\rm high}$'', so $\hat r=\min(r,1+\epsilon_{\rm hi})$ and the gradient of each token is \begin{equation}\nabla\mathcal J_{\rm CISPO}\ \ni\ \min(r_{i,t},\,1+\epsilon_{\rm hi})\ \hat A_i\ \nabla\log\pi_\theta(o_{i,t}\mid s_{i,t}).\label{eq:cgrad}\end{equation} Without clipping ($\epsilon_{\rm hi}=\infty$) it \emph{is} Eq.~\eqref{eq:reinf}, the standard policy gradient. \ver{$\epsilon_{\rm hi}{=}\infty$ gives the token-IS gradient exactly ($0$); autograd of the CISPO, PPO and IS losses equals $\sum_tw(r,A)A\nabla\log\pi$ built from the weight table to $\le1.4\times10^{-17}$.} \subsection{Gradient comparison table} Weights $w(r,A)$ multiplying $A\nabla\log\pi$ (checked on the grid below; $\epsilon_{\rm hi}=0.28$, $\epsilon_{\rm lo}=0.2$): \begin{center}\small\setlength{\tabcolsep}{4pt}\begin{tabular}{@{}lcccc@{}}\toprule region & PPO/GRPO & CISPO & unclipped token IS & changed by CISPO?\\\midrule $A>0,\ r<1+\epsilon_{\rm hi}$ & $r$ & $r$ & $r$ & no\\ $A>0,\ r>1+\epsilon_{\rm hi}$ & \textbf{0} & $1+\epsilon_{\rm hi}$ & $r$ & \textbf{kept, capped}\\ $A<0,\ r>1+\epsilon_{\rm hi}$ & $r$ (unbounded) & $1+\epsilon_{\rm hi}$ & $r$ & \textbf{bounded}\\ $A<0,\ 1-\epsilon_{\rm lo}0,\ r<1-\epsilon_{\rm lo}$ & $r$ & $r$ & $r$ & no\\\bottomrule\end{tabular}\end{center} \textbf{Exactly which tokens PPO/GRPO zero out and CISPO keeps:} $\{A>0,\ r>1+\epsilon_{\rm hi}\}\cup\{A<0,\ r<1-\epsilon_{\rm lo}\}$, the first set being the favourable-direction rare tokens of the problem statement. CISPO additionally caps the weight on $\{A<0,\ r>1+\epsilon_{\rm hi}\}$, where PPO's weight $r$ is unbounded. Numbers on the toy ($\|\theta-\theta_{\rm old}\|=1.5$, ratios in $[0.455,1.992]$): the three sets hold $7$, $63$ and $83$ token slots with probability mass $0.013$, $0.055$, $0.016$ respectively; maximum weight over all tokens: PPO $1.992$, CISPO $1.280$. \ver{the set of tokens with PPO weight $0$ and CISPO weight $>0$ equals the union of the first two cells exactly; CISPO's smallest weight equals the smallest ratio (no token is ever silenced); CISPO weights never exceed $1+\epsilon_{\rm hi}$.} \paragraph{Observation (mine).} The weight $\min(r,C)$ in Eq.~\eqref{eq:cgrad} is the same function as the token-level \emph{truncated importance sampling} (TIS) weight used against the training--inference mismatch (arXiv:2510.26788 Eq.~6 gives its sequence-level form). The functional form is shared; the ratio is not: here $r=\pi_\theta/\pi_{\rm old}$ (policy lag), there $\rho=\pi_{\rm train}/\pi_{\rm sampler}$ (numerics, 0108). \subsection{Stop-gradient semantics} The loss in Eq.~\eqref{eq:cispo} has gradient $\hat r\hat A\nabla\log\pi$ only because $\hat r$ is detached. Two look-alikes differ: \begin{itemize} \item \emph{Forgotten $\sg$:} $\nabla[\min(r,c)\,A\log\pi]=A\big(\indb{r0\wedge r<1+\epsilon_{\rm hi})\vee(A<0\wedge r>1-\epsilon_{\rm lo})}\\ &\text{zeroed by PPO/GRPO, kept by CISPO: }\{A>0,r>1+\epsilon_{\rm hi}\}\cup\{A<0,r<1-\epsilon_{\rm lo}\}\\ &\|\text{bias}\|\le\E\textstyle\sum_t(r_t-1-\epsilon_{\rm hi})_+|A_t|\,\|\nabla\log\pi_t\|\\ &\phantom{\|\text{bias}\|}\le(\max|A|\max\|\nabla\log\pi\|)\textstyle\sum_t\E\,\TV_t \end{align*} \end{result} \section{What breaks} \begin{breaks}\small\begin{itemize} \item \textbf{Biased gradient} (bounded by Eq.~\eqref{eq:cbias}); \emph{violated:} unbiasedness of IS. It grows with how far $\pi_\theta$ moves in $K$ updates. \item \textbf{No trust region.} Weights are bounded but the policy is not; with large $K$ or learning rate nothing stops drift (toy: $0.01\to0.86$). \emph{Violated:} the proximity assumption behind 0104's bound is not enforced at all. \item \textbf{Still a per-token ratio.} The other tokens' ratios $\prod_{s\ne t}r_s$ are dropped exactly as in 0103's token-level approximation; CISPO does not solve long-horizon IS variance, it avoids discarding tokens. \item \textbf{Mismatch contaminates $r$.} If the sampler and trainer disagree (0108), $r\ne1$ even at $\theta=\theta_{\rm old}$; large spurious ratios are now \emph{kept} with weight up to $1+\epsilon_{\rm hi}$ rather than dropped. \item \textbf{Wrong stop-gradient} silently produces a different algorithm (sign errors on live tokens), and the loss value cannot reveal it. \item \textbf{$A<0$ tokens with $r>1+\epsilon_{\rm hi}$} still get weight $1+\epsilon_{\rm hi}$ (strong push-down); PPO gives them weight $r$. Neither limits how often a token that is \emph{both} high-ratio and negative-advantage is penalised. \item \textbf{Leanstral variant.} The sampler ratio is per token and still biased under mismatch (toy: $\|\mathrm{bias}\|=8\times10^{-3}$); one outcome on every token of a multi-turn trace inflates variance relative to per-turn credit (toy: $2.05\times$); $c$ is not reported, so nothing here fixes the clip level. \emph{Violated:} exactness of IS and the absence of cross-turn noise. \item \textbf{Hyper-parameters are paper-specific}: M1 tunes only $\epsilon^{IS}_{\rm high}$; their value is not reported in the passages used here, and they combine CISPO with dynamic sampling and a length penalty (0106) and no KL (0109). \end{itemize}\end{breaks} \nextnote{CISPO's $r$ assumes the sampler's distribution at $\theta_{\rm old}$ \emph{is} $\pi_{\theta_{\rm old}}$. In practice the inference engine and the training engine disagree numerically, and MiniMax needed an FP32 LM head before reward would grow at all. Note 0108 bounds that bias and the truncated-IS correction.} \section*{References} {\small\begin{itemize}[leftmargin=1.2em] \item MiniMax, \emph{MiniMax-M1}, arXiv:2506.13585: Sec.~3.1 (Eq.~1 PPO, Eq.~2 group advantage, ``Issues of Token Clipping'', Eq.~3 REINFORCE with $\sg$, Eqs.~4--5 CISPO, Eqs.~6--7 unified mask, no KL, dynamic sampling and length penalty from DAPO), Fig.~2. \item Yu et al., arXiv:2503.14476, Sec.~3.1 (Clip-Higher) for the comparison point. \item Qi et al., arXiv:2510.26788, Sec.~2.1, Eqs.~5--7 (sequence-level IS, TIS, MIS) for the observation on the shared weight form. \item Mistral AI, \emph{Leanstral 1.5} announcement (vault note \texttt{leanstral-15-proof-abundance-for-all}): names mid-training, SFT and RL with CISPO; no equations given. \item Mistral AI, Leanstral technical report (\texttt{LeanstralReport.pdf} in the \texttt{LeanstralSafeVerify} repository; vault notes \texttt{in-this-work-we-present-leanstral-a-series-of-generalist-code-agent-models-for}, \texttt{source-analysis-leanstral-technical-report}), Sec.~2.3: the objective of Eq.~\eqref{eq:lean}, outcome propagated to all model tokens, prompts and tool responses as context; truncation value $c$ not reported. Not on arXiv. \item Notes 0103, 0108 and 0204 of this series for the sequence weight, the sampler--trainer mismatch and the multi-turn masking and credit used in the Leanstral-variant subsection. \item Weight table, bias bound, stop-gradient analysis and the fork-token demonstration are derived/checked here. \end{itemize}} \end{document}