Aligning video generation with human preferences is difficult because feedback is noisy and preferences span multiple dimensions. Aligning Human Sense calibrates human annotations with elite-guided filtering, then learns multidimensional reward distributions with Wasserstein alignment. The framework further applies distributional alignment in GRPO, improving reward reliability and the perceptual consistency of generated videos.
.
โโโ scripts/
โ โโโ train_reward_model.sh # DeepSpeed training launcher
โโโ prepare_videobench.py # Download Video-Bench data and create training JSON files
โโโ prepare_egpc_data.py # Split high- and low-consistency annotations
โโโ calibrate_annotations.py # Calibrate low-consistency annotations with an Elite Scorer
โโโ src/ # Reward model, data pipeline, trainer, and inference code
โ โโโ ds_config/ # DeepSpeed configurations
โโโ METHOD.md # Method and EGPC workflow details
โโโ requirements.txt # Python dependencies (install PyTorch separately)
conda create -n ahs-rm python=3.10 -y
conda activate ahs-rm
pip install torch==2.5.0 torchvision==0.20.0 --index-url https://download.pytorch.org/whl/cu124
pip install -r requirements.txtLog in to Hugging Face, accept the video dataset's access conditions, and prepare the data:
| Resource | Download |
|---|---|
| Video-Bench videos | ๐ค Hugging Face |
| Video-Bench human annotations | ๐ค Hugging Face |
huggingface-cli login
python prepare_videobench.py --output-dir data/videobenchDownload the base model locally because training loads it in offline mode:
huggingface-cli download Qwen/Qwen2-VL-2B-Instruct \
--local-dir /path/to/Qwen2-VL-2B-InstructRun the following commands from the repository root. This example uses the Action dimension; the same workflow applies to every supported dimension.
export DIM=action
export DATA_ROOT=data/videobench/videos
export MODEL_PATH=/path/to/Qwen2-VL-2B-Instruct
export NUM_GPUS=2Split the downloaded annotations into high- and low-consistency subsets with the EGPC rule:
python prepare_egpc_data.py \
--input-json data/videobench/annotations/${DIM}.json \
--high-output outputs/egpc/${DIM}_high.json \
--low-output outputs/egpc/${DIM}_low.jsonTrain the first reward model only on the high-consistency subset:
META_DATA="['outputs/egpc/${DIM}_high.json']" \
OUTPUT_DIR=outputs/elite/${DIM} \
bash scripts/train.shUse the Elite Scorer to replace the low-consistency records' vote_score values with calibrated continuous rewards:
python calibrate_annotations.py \
--checkpoint-dir outputs/elite/${DIM} \
--data-root ${DATA_ROOT} \
--input-json outputs/egpc/${DIM}_low.json \
--output-json outputs/egpc/${DIM}_calibrated.jsonCombine the reliable and calibrated records to train the final model on the expanded supervision set:
META_DATA="['outputs/egpc/${DIM}_high.json','outputs/egpc/${DIM}_calibrated.json']" \
OUTPUT_DIR=outputs/reward_model/${DIM}_final \
bash scripts/train.shThe data script downloads all supported dimensions by default. To train another dimension, set DIM to aesthetic_quality, color, imaging_quality, motion_effects, object_class, scene, temporal_consistency, or video_text_consistency. Checkpoints and logs are written to outputs/.
Our implementation builds on Video-Bench, VideoAlign, VisionReward, VideoScore. We thank their authors and contributors for their great works.
