Common CLI Options
OpenRLHF 0.10.2 organizes every CLI flag under a dotted section prefix that mirrors
ownership: --ds.* for DeepSpeed, --vllm.* for vLLM, --rollout.* for generation
knobs, --data.* / --train.* / --eval.* / --ckpt.* / --logger.* / --algo.*
for pipeline stages, and per-entity --actor.* / --critic.* / --ref.* / --reward.*
for PPO or --model.* for the single-model trainers (SFT / RM / DPO). Flat aliases from
earlier releases were removed — every launch script must use the new names.
This page is the central flag reference. Trainer-specific knobs are on Supervised & Preference Training (SFT / RM / DPO) and RL Training Guide; end-to-end launch scripts live under examples/scripts.
Section map
Prefix |
Who owns it |
What lives under it |
|---|---|---|
|
DeepSpeed + model loading |
|
|
vLLM generation engine |
|
|
Rollout / sampling |
|
|
Dataset + tokenization |
|
|
Training orchestration |
|
|
Evaluation |
|
|
Checkpointing |
|
|
Logging |
|
|
RL algorithm (PPO only) |
|
|
Per-role model config (PPO) |
|
|
Single-model loss/loader config (SFT / RM / DPO) |
|
(flat) |
Launcher & special |
|
Note
Naming convention: boolean toggles whose names do not already read as predicates carry an
explicit _enable suffix, e.g. --reward.normalize_enable, --ckpt.load_enable,
--train.async_enable, --train.dynamic_batch_enable, --algo.dynamic_filtering_enable,
--algo.advantage.is_correction_enable. Flags already shaped like verbs
(freeze_*, save_*, enforce_*, colocate_*, use_*, *_offload) stay bare.
DeepSpeed
Flag |
Meaning |
|---|---|
|
DeepSpeed ZeRO stage (0 / 1 / 2 / 3). Use 3 for large models. |
|
DeepSpeed tensor parallelism (AutoTP) size — only with |
|
Offload the Adam optimizer state to CPU; saves GPU memory at the cost of step time. Not compatible with Muon — DS’s Muon implementation keeps optimizer state on GPU. |
|
Parameter dtype: |
|
ZeRO++ max partition size (default |
|
Overlap backward with gradient reduce (larger bucket budget — needs more memory). |
|
Adam grad-accumulation dtype. |
|
Enable DeepCompile graph compilation (PyTorch 2.0+). |
|
DeepSpeed sleep mode — free DeepSpeed memory between training steps (paired with
|
|
RingAttention sequence-parallel group / head stride (see Sequence Parallelism (RingAttention)). |
|
Use DeepSpeed Universal Checkpoint format (ZeRO-stage / world-size agnostic). |
|
Attention backend: |
|
MoE expert computation strategy passed through to |
|
Enable Liger Kernel for fused ops. |
|
Load the base model in 4-bit (QLoRA — pair with |
|
LoRA / QLoRA config (set |
|
Pack multiple samples per sequence (Flash-Attention path). Large throughput win. |
|
Score-head name prefix for sequence-regression models (RM training, PPO reward
model loader, |
vLLM
Flag |
Meaning |
|---|---|
|
Number of vLLM engines ( |
|
Tensor parallel size per vLLM engine. |
|
KV-cache fraction. Start at |
|
DeepSpeed → vLLM weight sync backend ( |
|
Use Ray groups (instead of bare NCCL) for weight sync. |
|
Disable CUDA graphs in vLLM (avoids some hang modes; reduces memory). |
|
Enable vLLM prefix caching (pairs well with |
|
vLLM sleep mode — free most of vLLM’s memory between rollouts. Hybrid Engine only;
incompatible with |
Rollout / generation
Flag |
Meaning |
|---|---|
|
Prompt batch size per rollout step (experience-collection batch). |
|
Per-GPU micro-batch during the forward over generated samples (e.g., log-prob recompute). |
|
Completions per prompt. Must be |
|
vLLM sampling parameters during rollouts. |
|
Max tokens to generate per sample. |
|
Token budget per GPU for the rollout-side forward (used with |
|
vLLM generation batch. If larger than |
Data
Shared across trainers. Note that the prompt-input flag differs: PPO uses
--data.prompt_dataset (the value is a dataset path — renamed from the old --data.prompt),
while SFT / RM / DPO use --data.dataset.
Flag |
Meaning |
|---|---|
|
HuggingFace dataset name(s) or path(s). Comma-separate for mixing. |
|
Sampling probabilities when mixing multiple datasets (e.g., |
|
HF split name (default |
|
JSON keys for prompts, SFT targets, and RL ground-truth labels. |
|
Preference-dataset keys (RM / DPO). |
|
VLM image-path / URL key (default |
|
Apply the tokenizer’s chat template. |
|
Override the tokenizer’s default chat template. |
|
Plain-text format string when not using a chat template (e.g., |
|
Max total sequence length (prompt + response). |
|
Cap on training samples. |
|
DataLoader workers (default |
|
Force |
|
(SFT) Train on compacted multi-turn chat data (loss applies to all assistant turns).
Requires |
|
(PPO VLM) Max images per prompt for vLLM ( |
Training
Flag |
Meaning |
|---|---|
|
Global and per-GPU training batch sizes. |
|
Token budget per GPU during training (used with |
|
PPO optimization epochs per rollout (or epochs over dataset for SFT / RM / DPO). |
|
Total RL episodes (one episode = full pass through the prompt set). |
|
Global random seed (default |
|
Bit-reproducible behavior (slower; vLLM v1 + fixed seed paths). |
|
Form micro-batches by token budget instead of count — much better packing for
variable-length sequences. Pair with |
|
Async pipeline controls (see Async Training & Partial Rollout). |
|
Track an EMA copy of the actor (see Checkpointing). |
|
Multi-turn agent Python file. Sets up the multi-turn executor (see RL Training Guide). |
|
Role colocation for Ray / vLLM placement (see Hybrid Engine). |
Evaluation
--eval.dataset: eval dataset path (with--data.prompt_datasetfor PPO; reward-function runs only).--eval.split: eval split (default differs per trainer).--eval.steps: evaluate every N training steps (-1to disable).--eval.temperature/--eval.n_samples_per_prompt(PPO): sampling params for eval rollouts.
Checkpointing
Flag |
Meaning |
|---|---|
|
Final HuggingFace-format model save path (always written at end of training). |
|
Directory for resumable DeepSpeed-format checkpoints. |
|
Steps between checkpoints ( |
|
Also export an HF-format model at every checkpoint. |
|
Skip DeepSpeed checkpoints — training progress is not recoverable. |
|
Cap retained checkpoint count / total size (GB). |
|
Resume from |
|
Eval metric key for best-checkpoint saving (empty = auto-detect first |
Detailed semantics and SFT/PPO examples live in Checkpointing.
Logging
--logger.logging_steps: log every N training steps.--logger.wandb.key {token-or-True}: Wandb logging (Trueuses a priorwandb login).--logger.wandb.org/--logger.wandb.group/--logger.wandb.project/--logger.wandb.run_name: Wandb metadata.--logger.tensorboard_dir {logdir}: TensorBoard logging path.
Model / entity flags
PPO routes model config through four parallel sections:
Prefix |
Scope |
|---|---|
|
The policy (trained). Owns optimizer / scheduler / grad-clip, loss knobs ( |
|
Value network. Owns its own optimizer section, |
|
Frozen reference model. |
|
Reward model / function. Owns |
Each PPO entity carries its own --{entity}.num_nodes / --{entity}.num_gpus_per_node.
Engine-level model loading flags — --ds.attn_implementation,
--ds.experts_implementation, --ds.use_liger_kernel, --ds.load_in_4bit,
--ds.lora.*, --ds.packing_samples — are shared across every role; you cannot set
a different attention implementation or LoRA config per-entity.
SFT / RM / DPO use the single-model namespace --model.*:
Flag |
Meaning |
|---|---|
|
HF model name or path. |
|
Trade compute for memory (recompute activations); reentrant toggle. |
|
MoE balancing loss coefficient ( |
|
DPO temperature. |
|
IPO switch / cDPO smoothing / NLL regularization. |
|
Reward-model loss family. Score-head prefix is |
|
Pretrain-style loss (next-token over whole sequence). |
Engine-level model loading (attn_implementation, experts_implementation,
use_liger_kernel, load_in_4bit, lora.*, packing_samples) lives under
--ds.* for SFT / RM / DPO too.
Optimizer: Adam or Muon
0.10.2 exposes the optimizer as two parallel sections under --adam.* and --muon.*,
selected at runtime by a single switch:
--optim {adam, muon}in SFT / RM / DPO.--actor.optim {adam, muon}and--critic.optim {adam, muon}in PPO (actor / critic are independent — actor-Muon with critic-Adam is supported out of the box).
Pure Adam
Flag |
Meaning |
|---|---|
|
Learning rate. |
|
Adam β₁/β₂ (default |
|
Adam ε (default |
|
L2 weight decay (replaces the old flat |
Muon (--optim muon)
DeepSpeed’s MuonWithAuxAdam uses Muon for 2-D hidden weight matrices and a parallel AdamW
subgroup for embeddings / LM head / 1-D params. In 0.10.2 OpenRLHF drives this directly:
Flag |
Meaning |
|---|---|
|
LR for the Muon 2-D-weight group (default |
|
Muon momentum (default |
|
Newton–Schulz iteration count. Placeholder — DeepSpeed 0.18.x hard-codes
|
|
Nesterov momentum toggle. Placeholder — DeepSpeed 0.18.x hard-codes Nesterov on. |
The aux-Adam subgroup (embeddings / LM head / 1-D / value head) reuses --adam.lr,
--adam.betas, --adam.eps, --adam.weight_decay — and the LR scheduler drives
both groups simultaneously. Per-entity in PPO: --actor.muon.lr,
--critic.muon.lr, etc.
Note
Requirements and caveats
Requires DeepSpeed ≥ 0.18.2.
Incompatible with
--ds.adam_offload— Muon keeps state on GPU.Weight decay is shared. DeepSpeed 0.18.x stamps a single
weight_decayinto both the Muon and aux-Adam param groups; OpenRLHF therefore reads it from--adam.weight_decay(or--{entity}.adam.weight_decay) and applies it to both. There is no separate--muon.weight_decayflag.Bias / LayerNorm decay exemption is NOT applied under Muon. DS Muon partitions a flat
Parameterlist viap.use_muonand refuses param-group dicts; splitting groups post-init would desync ZeRO’s bit16/fp32 metadata. The pure-Adam path still exempts bias / LayerNorm from weight decay as usual.0.10.2 fix. Previously the aux-Adam subgroup silently inherited Muon’s LR (
0.02), which nuked pretrained embeddings over the first ~100 steps. 0.10.2 emitsmuon_lrandadam_lrexplicitly to DS so each group follows its own initial LR. Make sure to set--adam.lr(PPO:--actor.adam.lr) when training with--optim muon.
Learning-rate scheduler & gradient clip
Flags stay flat in the single-model trainers, nested per-entity in PPO.
SFT / RM / DPO |
PPO (per entity) |
|---|---|
|
|
|
|
|
|
|
|
Default scheduler is cosine_with_min_lr with warmup_ratio 0.03 and min_lr_ratio 0.1.
LoRA / QLoRA
LoRA / QLoRA is supported by SFT / RM / DPO. Not supported by Ray + vLLM PPO.
Flag (SFT/RM/DPO) |
Meaning |
|---|---|
|
Set |
|
LoRA alpha scaling. |
|
LoRA dropout (passed through to HuggingFace PEFT). |
|
PEFT target modules (e.g., |
|
Load the base model in 4-bit (QLoRA). |
Only the adapter is saved. Merge it back with the base model to deploy:
python -m openrlhf.cli.lora_combiner \
--model_path meta-llama/Meta-Llama-3-8B \
--lora_path ./checkpoint/llama3-8b-rm \
--output_path ./checkpoint/llama-3-8b-rm-combined \
--is_rm \
--param_dtype bf16
Use --is_rm when merging a reward model (preserves the score head).
Long context & checkpointing (dedicated pages)
RingAttention —
--ds.ring_attn_size/--ds.ring_attn_head_stride; see Sequence Parallelism (RingAttention).Checkpointing —
--ckpt.*+--train.enable_ema; see Checkpointing.
Flag migration (0.9.x / early 0.10 → 0.10.2)
Upgrade checklist: replace the old flat flag on the left with the dotted flag on the right.
Every launch script in examples/scripts/ has already been migrated and is a working
reference.
Models
Old |
New |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ray placement / colocation
Old |
New |
|---|---|
|
|
|
|
|
|
|
|
|
|
vLLM / DeepSpeed
Old |
New |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Rollout / data / train / eval / ckpt / logger
Old |
New |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RL algorithm / loss
Old |
New |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Optimizer / scheduler
Old |
New |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
removed — aux-Adam subgroup reuses |
|
flat in SFT / RM / DPO; |
SFT / RM / DPO model-level loss knobs
Old |
New |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Removed flags
These were dead code or duplicates in earlier releases and have been deleted:
--actor_init_on_gpu(legacy init-on-GPU path; no longer needed).--ptx_coef/--actor.ptx_coef(PPO-PTX was never wired up in the trainer).--train.perf_tracking_enable(no corresponding implementation).--train_split(duplicate of--data.dataset_split).