Repository navigation
feat(rm): add the VideoAlign reward and an LTX-2.3 Flow-GRPO recipe - #421
Open
charon-agi wants to merge 5 commits into
Open
charon-agi wants to merge 5 commits into
charon-agi wants to merge 5 commits into
Conversation
charon-agi
requested review from
Rockdu,
guapisolo and
zhihengy
as code owners
November 24, 2026 03:25
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(rollout): add VideoAlign reward and LTX-2.3 Flow-GRPO validation
What
KwaiVGI/VideoRewardand the Qwen2-VL-2B configuration, with checkpoint remapping, the upstream rubric, PIL video preprocessing and sequential reward-model positions.vq,mq,taandoverallper sample. Normalization uses the published VideoReward constants;overall = vq_weight*vq + mq_weight*mq + ta_weight*ta, with per-head weights (--videoalign-vq-weight/--videoalign-mq-weight/--videoalign-ta-weight, all defaulting to 1.0).--reward-keyselects the scalar optimized by training.--videoalign-*CLI flags.--diffusion-eval-guidance-scaleso eval can enable the LTX-2.3 embedded-CFG guider (guidance > 1.0) while the RL rollout stays at guidance 1.0.Why
PickScore averages framewise CLIP scores. VideoAlign jointly processes sampled video frames and exposes visual quality, motion quality and text alignment as separate scores. This integration makes those heads available to the existing reward/advantage pipeline without introducing a new training algorithm.
The eval guidance flag exists because the RL rollout must run single-branch (guidance 1.0) for log-prob computation, while LTX-2.3 plain generation activates the embedded-CFG guider, which unconditionally reads
negative_prompt_embeds. Those embeds are only encoded when classifier-free guidance is enabled, so eval needs its own guidance scale.Training protocol
/fsx/group/kaixiangxu/env/miles_gpu(Torch 2.11 + sglang, with a Torch-2.11-compatiblesglang-kerneloverlay), LTX-2.3 materialized under/root/.cache/sgl_diffusion/materialized_models/.rockdu/miles-diffusion-datasets,flowgrpo_pickscore/train.jsonl(text prompts only).--reward-key overall); the reward-hacking rerun sets--videoalign-ta-weight 3.0with VQ/MQ left at 1.0.test.jsonl(seed 0),--eval-interval 20,--eval-reward-key overall,--diffusion-eval-guidance-scale 3.0.--save-interval 10.Validation
CUDA_VISIBLE_DEVICES="" /usr/local/bin/python -m pytest tests/fast -x -q.219ab9db64c045e5181a2202d11f686439351292, using an isolated Transformers 4.45.2 reference subprocess. Exact input IDs, video grids, pixel SHA256 and raw bf16 scores match for three synthetic clips and a padded mixed-resolution batch.train_diffusion.py --helpexits successfully in the prepared GPU environment; the full VideoAlign smoke arguments pass parsing/validation.log_prob_new_idx_0/log_prob_old_idx_0match the baseline standard to ~5–6 decimal places, andgrad_normstays in the same ~1e-5 range as the baseline. Only the reward (advantage) differs.vq/mq/ta/overallpersisted viaMILES_METRICS_JSONL); see the ta-weighted rerun in Results.tawhilevq/mqclimb; a--videoalign-ta-weight 3.0rerun holdstaroughly flat — see Results.Results (200 rollouts / 400 optimizer steps)
A full LTX-2.3 + Flow-GRPO run (exit 0, ~15.2 hours) optimizes the VideoAlign reward on the training set.
grad_normstays small throughout (8.5e-6 at step 1 → 5.6e-5 at step 400), matching the baseline ~1e-5 scale;clipfracrises from 0% to 7.3%, andratio_abs_minus_1from ~1e-6 to ~4e-6, showing the policy starts making larger updates late in training.iter_0000001…iter_0000200), one per 10 rollouts.Held-out eval on the 64-prompt test subset, loading
iter_0000200(LoRA only) and scoring with--diffusion-eval-guidance-scale 3.0, per-head weights were added, and a rerun with--videoalign-ta-weight 3.0(VQ/MQ at 1.0) was performed under the same protocol (400 optimizer steps, save every 10).Held-out eval on the 64-prompt test subset, run on all 20 checkpoints:
tastays inside -1.05…-1.57 for the whole run — no collapse (vs -2.40 at step 200 unweighted) — but it also does not improve, drifting slightly negative and staying there. That is the LTX-2.3 base model's text-alignment ceiling for this prompt set; weighting TA can stop the model from gaming TA, but cannot make the base model more prompt-faithful.vq/mqrise to ~+1.4/+1.5 by step 120–140, then the model begins to overfit: they fall to 0.58/0.95 by step 190 before a partial recovery at step 200.vq/mqare at their peak beforetadrifts more negative; the final checkpoint is not the best.Files
miles/rollout/rm_hub/videoalign.pymiles/rollout/rm_hub/core.pymiles/rollout/rm_hub/__init__.pymiles/rollout/sglang_diffusion_rollout.pymiles/utils/arguments.pyscripts/run_diffusion_grpo_ltx23_videoalign_sglang.pytests/fast/rollout/test_videoalign_reward.pytests/fast-gpu/test_videoalign_alignment.pytests/fixtures/videoalign_official_scores.pydocs/user-guide/rewards.mdOperational note
The standard example launcher invokes the existing machine-wide cleanup helper. The local validation instead captures its arguments and creates an isolated local Ray cluster, without broad process kills or external W&B uploads.