Repository navigation
feat(rm): add the AudioBox-Aesthetics reward - #425
Open
charon-agi wants to merge 1 commit into
Open
charon-agi wants to merge 1 commit into
charon-agi wants to merge 1 commit into
Conversation
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(rm): add AudioBox-Aesthetics reward and MiniMax H3 t2va Flow-GRPO recipe
What
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).audiobox_aestheticsmodel code (src/audiobox_aesthetics/model/{aes,utils,wavlm}.py) verbatim intomiles/rollout/rm_hub/_audiobox/, with license headers preserved, so the reward scores bit-exact with the official package without apip install audiobox_aesthetics.pq,pc,ce,cuandoverallper 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-keyselects the scalar optimized by training.--audiobox-*CLI flags and validation.AsyncRewardActorPool.score) while retaining scalar float conversion.t2vaFlow-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
flow_shift 12.0/audio_flow_shift 3.0, 1344×768 / 107 frames at 24 fps.scripts/run_diffusion_grpo_h3_t2va_2gpu.py).--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.docs/models/h3/h3.md);audiobox_rmraises ifgenerated_audiois absent.Validation
tests/fast/rollout): 197 passed, 16 skipped.tests/fast/rollout/test_audiobox_reward.py: 6 passed — actor unpacks(waveform, sample_rate)and returns one dict per sample;audiobox_rmships pairs and records queue depth;audiobox_rmrejects silent rollouts; batched fast path; mixed-rm_type order; pool defaults tofacebook/audiobox-aesthetics.train_diffusion.py --helpexits 0;--audiobox-*flags parse and validate._audioboxis excluded from ruff likeflow_grpo.facebook/audiobox-aesthetics(model.safetensors415 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.diff -qclean).audiobox_aestheticspackage: not run (package not installed); scores match by construction because the model code is verbatim and the inference wrapper is a faithful port ofAesPredictor.forward/make_inference_batch/audio_resample_mono.t2varollout 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.audiobox_rmreadsgenerated_audioinline 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:
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.pymiles/rollout/rm_hub/_audiobox/{__init__,aes,utils,wavlm}.pymiles/rollout/rm_hub/core.pymiles/rollout/rm_hub/__init__.pymiles/utils/arguments.pyscripts/run_diffusion_grpo_h3_t2va_audiobox.pytests/fast/rollout/test_audiobox_reward.pydocs/user-guide/rewards.md,docs/user-guide/cli-reference.md,docs/models/h3/h3.mdpyproject.tomlOperational note
The vendored WavLM (
_audiobox/) is a byte-for-byte copy offacebookresearch/audiobox-aesthetics(MIT for the Microsoft WavLM encoder, CC-BY 4.0 for the Meta wrapper/heads); it is excluded from lint. The reward readsSample.generated_audioinline and does not use the output store, so it works with the existingsglang_diffusion_rolloutresponse path once the engine returns the soundtrack.