CISPO
MiniMax-M1 / CISPO: Clipped Importance Sampling Policy Optimization MiniMax Team arXiv
CISPO lets useful tokens keep contributing when GRPO would stop reinforcing them.
Why it mattered
PPO and GRPO clip the objective via , which sets the gradient to exactly zero on any token whose ratio crosses the clip boundary. MiniMax-M1 noticed that low-probability reasoning pivot tokens ('Wait', 'However', 'Let me double check') get clipped out early and stop learning — especially when rollouts arrive 1 step behind the latest weights.
Core insightApply a stop-gradient clipped importance weight directly to the policy gradient: Every token still contributes a bounded gradient, keeping reasoning diversity intact while a background worker overlaps rollouts with GPU updates.
losses.CISPO(clip_low=0.2, clip_high=0.28) is a built-in Trainer loss — pair it with trainer.snapshot() and a 1-slot ThreadPoolExecutor to overlap sampling with GPU backward/optim steps and release snapshots cleanly.
When to use
Choose CISPO when running asynchronous or slightly off-policy RL loops where PPO's hard clip zeroes out gradients on crucial reflection tokens (like 'Wait' or 'Check'). If your rollout staleness exceeds 2 to 4 steps, fall back to standard clipped PPO for safety.
Step-by-step walkthrough
- 01
Pin a snapshot and prefetch next-step rollouts in a background thread
Call
trainer.snapshot()and submitenv.rollout_groups(snap, ...)to a 1-workerThreadPoolExecutorso rollouts overlap with the GPU backward pass. Overlapping rollout generation with GPU backward hides sampling latency behind gradient computation.snap = trainer.snapshot(); pending = pool.submit(env.rollout_groups, snap, tasks=next_chunk, group_size=8) - 02
Step with built-in losses.CISPO()
Pass
losses.CISPO(clip_low=0.2, clip_high=0.28)— stop-gradient clipped importance weights preserve gradients on low-probability reflection tokens. Stop-gradient clipping caps weight magnitude without erasing the log-probability gradient on rare pivot tokens.trainer.forward_backward(batch, loss=losses.CISPO(clip_low=0.2, clip_high=0.28)) - 03
Release old snapshots as soon as rollouts finish
Call
old_snap.release()after awaiting its rollouts so the trainer never hitsmax_snapshots. Releasing each snapshot immediately after its batch completes keeps the trainer's snapshot pool uncluttered.old_snap.release()
Implementation
from concurrent.futures import ThreadPoolExecutor
import grad
from grad import Environment, Grad, Rubric, Scorer, Task, adapters, advantages, losses, optim, validators
client = Grad()
ds = client.datasets.from_hf("openai/gsm8k", config="main", split="train", prompt="question", answer="answer", limit=2560)
tasks = [Task(id=str(i), prompt=r["messages"][0]["content"], expected_output=r["expected_output"]) for i, r in enumerate(ds.records())]
batches = [tasks[i : i + 32] for i in range(0, len(tasks), 32)]
env = Environment(
rubric=Rubric([Scorer("math", fn=validators.MathEquivalence())]),
max_turns=1,
system_prompt="Solve step by step and end with \\boxed{...}.",
)
with (
client.trainers.create(
model="qwen/qwen3-8b",
name="cispo-async",
adapter=adapters.LoRA(rank=32),
total_steps=len(batches),
max_cost_usd=10.0,
) as trainer,
ThreadPoolExecutor(max_workers=1) as pool,
):
cur_snap = trainer.snapshot()
pending = pool.submit(env.rollout_groups, cur_snap, tasks=batches[0], group_size=8, max_tokens=1024, temperature=1.0)
for step in range(1, len(batches) + 1):
groups, old_snap = pending.result(), cur_snap
if step < len(batches):
cur_snap = trainer.snapshot()
pending = pool.submit(env.rollout_groups, cur_snap, tasks=batches[step], group_size=8, max_tokens=1024, temperature=1.0)
old_snap.release()
batch = grad.with_advantages(groups, advantages.GroupStd())
if not batch:
continue
fb = trainer.forward_backward(batch, loss=losses.CISPO(clip_low=0.2, clip_high=0.28))
opt = trainer.optim_step(optim.AdamW(lr="auto", objective="rl"))
fb_res, opt_res = fb.result(), opt.result()
trainer.log_metrics(opt_res.step, {"reward": grad.mean_reward(groups), "loss": fb_res.loss})
cur_snap.release()
artifact = trainer.export(name="cispo-async").result().artifactBenchmarks
Reported results from the original paper compared against its baseline.
Models & datasets
| Model | Duration | Est. cost |
|---|---|---|
Qwen3 8Brecommendedqwen/qwen3-8b | ~20 min | ~$1.60 |
Qwen3 4Bfast smoke runqwen/qwen3-4b | ~10 min | ~$0.80 |
Qwen3.5 9Bqwen/qwen3.5-9b | ~24 min | ~$1.95 |
| Dataset | Source | Size |
|---|---|---|
| GSM8K Math | Hugging Face | 7,473 train / 1,319 test |
Practical gotchas
- Keep off-policy staleness tight ( step). For heavily stale async rollout pools ( steps behind), prefer
losses.PPO()so extreme importance weights are hard-clipped. - Always release finished snapshots (
snap.release()) or setmax_snapshotsonclient.trainers.create()to keep GPU snapshot slots free. - Log
clip_fractionalongside reward ingrad runs watch: if more than 25% of tokens hit the stop-gradient cap, tightenlror reduce rollout lag to 1 step so off-policy drift does not accumulate.