Skip to content
alignhs26Public

About

[๐—˜๐—–๐—–๐—ฉ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ] Aligning Human Sense: Calibrated Distributional Reward Learning for Video Generation

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

1 Commit

Folders and files

Repository files navigation

Aligning Human Sense

GitHub Video-Bench videos Video-Bench human annotations

image

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.

Repository layout

.
โ”œโ”€โ”€ 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)

Installation

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.txt

Log 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/videobench

Download 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-Instruct

Quick Start

Run 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=2

1. Create reliable supervision

Split 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.json

2. Train an Elite Scorer

Train 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.sh

3. Calibrate low-consistency labels

Use 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.json

4. Train the final reward model

Combine 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.sh

The 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/.

Citation

Acknowledgements

Our implementation builds on Video-Bench, VideoAlign, VisionReward, VideoScore. We thank their authors and contributors for their great works.

About

[๐—˜๐—–๐—–๐—ฉ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ] Aligning Human Sense: Calibrated Distributional Reward Learning for Video Generation

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages