Skip to content

feat(rm): add the AudioBox-Aesthetics reward - #425

Open
charon-agi wants to merge 1 commit into
radixark:mainfrom
charon-agi:audiobox-reward
Open

charon-agi wants to merge 1 commit into
radixark:mainfrom
charon-agi:audiobox-reward

Conversation

@charon-agi

Copy link
Copy Markdown

feat(rm): add AudioBox-Aesthetics reward and MiniMax H3 t2va Flow-GRPO recipe

What

  • Add a local AudioBox-Aesthetics scorer using facebook/audiobox-aesthetics (Meta, arXiv 2502.05139): a WavLM encoder plus one 5-layer MLP head per axis, scoring the generated audio track on four perceptual axes — Production Quality (pq), Production Complexity (pc), Content Enjoyment (ce), Content Usefulness (cu).
  • Vendor the official audiobox_aesthetics model code (src/audiobox_aesthetics/model/{aes,utils,wavlm}.py) verbatim into miles/rollout/rm_hub/_audiobox/, with license headers preserved, so the reward scores bit-exact with the official package without a pip install audiobox_aesthetics.
  • Return pq, pc, ce, cu and overall per sample. overall = pq_weight*pq + pc_weight*pc + ce_weight*ce + cu_weight*cu, with per-head weights (--audiobox-pq-weight / --audiobox-pc-weight / --audiobox-ce-weight / --audiobox-cu-weight, all defaulting to 1.0). --reward-key selects the scalar optimized by training.
  • Add single/batched reward dispatch, standalone/colocated Ray pools, --audiobox-* CLI flags and validation.
  • Preserve dictionary rewards in the shared actor pool (AsyncRewardActorPool.score) while retaining scalar float conversion.
  • Add a MiniMax H3 t2va Flow-GRPO recipe (scripts/run_diffusion_grpo_h3_t2va_audiobox.py) that swaps PickScore for --rm-type audiobox --reward-key pq.

Why

PickScore averages framewise CLIP scores over the video. MiniMax H3 is a text-to-audio-video model that emits native stereo audio, and the framework already carries that soundtrack on Sample.generated_audio + Sample.audio_sample_rate; until now no built-in reward read it. AudioBox-Aesthetics is a no-reference perceptual quality predictor, so it grades the part of H3's output PickScore ignores, with no new training algorithm.

Training protocol

  • Model/algorithm: MiniMax H3 + existing Flow-GRPO, video branch only (audio rolled out, not trained). All hyper-parameters match the PickScore recipe: LoRA 64/128, lr 1e-4, weight_decay 1e-4, 10 inference steps, SDE window 2, flow_shift 12.0 / audio_flow_shift 3.0, 1344×768 / 107 frames at 24 fps.
  • Hardware: 2 GPUs, train + rollout + reward colocated (same topology as scripts/run_diffusion_grpo_h3_t2va_2gpu.py).
  • Reward: --rm-type audiobox --reward-key pq (Production Quality); --audiobox-batch-size 1. The predictor resamples to 16 kHz mono, windows the 4 s clip into one 10 s chunk, and de-normalises each head with the checkpoint's per-axis mean/std.
  • Rollout must return the audio track: this needs the sglang-miles engine change that adds the soundtrack to the rollout response (noted in docs/models/h3/h3.md); audiobox_rm raises if generated_audio is absent.

Validation

  • CPU fast suite (tests/fast/rollout): 197 passed, 16 skipped.
  • New tests/fast/rollout/test_audiobox_reward.py: 6 passed — actor unpacks (waveform, sample_rate) and returns one dict per sample; audiobox_rm ships pairs and records queue depth; audiobox_rm rejects silent rollouts; batched fast path; mixed-rm_type order; pool defaults to facebook/audiobox-aesthetics.
  • train_diffusion.py --help exits 0; --audiobox-* flags parse and validate.
  • ruff and black pass on all touched source/test/doc files; vendored _audiobox is excluded from ruff like flow_grpo.
  • End-to-end scorer on CPU: downloaded facebook/audiobox-aesthetics (model.safetensors 415 MB + config.json), scored two synthetic 2 s clips. Clean 440 Hz sine → pq=6.37, ce=2.53, cu=6.06, pc=1.74; same sine + noise → pq=4.97, ce=1.96, cu=4.45, pc=1.92. The noisier clip scores lower on PQ/CE/CU, as expected from a perceptual quality model.
  • Vendored model files are byte-identical to the official repo (diff -q clean).
  • Independent bit-exact comparison against the installed audiobox_aesthetics package: not run (package not installed); scores match by construction because the model code is verbatim and the inference wrapper is a faithful port of AesPredictor.forward / make_inference_batch / audio_resample_mono.
  • Real H3 t2va rollout with audio: not validated — requires the sglang-miles GPU engine with the audio-response change, the H3 weights, and a 2-GPU node; not available in this environment.
  • StoredTensor / Mooncake path: not validated; audiobox_rm reads generated_audio inline and the recipe does not enable the output store for the audio reward.

Results (reward sanity, not training)

A CPU forward through the vendored WavLM on the two clips above:

clip pq pc ce cu
clean sine 6.37 1.74 2.53 6.06
sine + noise 4.97 1.92 1.96 4.45

Production Quality — the axis the recipe trains on — drops by 1.4 on the noisy clip, confirming the reward discriminates perceptual quality. A full training curve needs the GPU engine and is left as the next validation step.

Files

  • miles/rollout/rm_hub/audiobox.py
  • miles/rollout/rm_hub/_audiobox/{__init__,aes,utils,wavlm}.py
  • miles/rollout/rm_hub/core.py
  • miles/rollout/rm_hub/__init__.py
  • miles/utils/arguments.py
  • scripts/run_diffusion_grpo_h3_t2va_audiobox.py
  • tests/fast/rollout/test_audiobox_reward.py
  • docs/user-guide/rewards.md, docs/user-guide/cli-reference.md, docs/models/h3/h3.md
  • pyproject.toml

Operational note

The vendored WavLM (_audiobox/) is a byte-for-byte copy of facebookresearch/audiobox-aesthetics (MIT for the Microsoft WavLM encoder, CC-BY 4.0 for the Meta wrapper/heads); it is excluded from lint. The reward reads Sample.generated_audio inline and does not use the output store, so it works with the existing sglang_diffusion_rollout response path once the engine returns the soundtrack.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant