Multi-reward RL usually adds the rewards up with weights, which turns every reward into the same currency. Harmony needs no weights. Within the group of samples of one prompt, it ranks each reward, multiplies the percentiles into the region of reward space that a sample dominates, and turns that order into symmetric advantages. It replaces only the advantage step of a group-based RL algorithm.
A weighted sum fixes an exchange rate between rewards. But OCR accuracy and aesthetics measure unrelated things, rewards come in different units, and some are closely entangled. Scale normalization cannot fully align them.
A sum lets one reward pay for another, so an unbalanced image can score as high as a balanced one. With DiffusionNFT, CorrGRPO w/ norm. reaches the highest OCR (0.942) but trails GDPO in PickScore (22.64 vs. 23.75).
Added in raw units, the easy reward runs ahead and the others stall. Under the weighted sum and CorrGRPO w/ norm., the weakest training reward stops at 0.72 and 0.67 of the best level. Harmony lifts it to 0.93.
Rewards can harmonize without uniformity.
Multi-reward Reinforcement Learning (RL) has become an essential post-training stage for frontier models. A common assumption behind current methods is that rewards can be exchanged through weights, converting a multi-reward learning problem into a single-reward one by a weighted summation of (normalized) rewards. While simple, we challenge such an assumption behind. First, rewards resist uniformity, as their entanglement complicates optimal weighting. Second, harmony is not a trade, demanding simultaneous improvement across all rewards. Third, uniformity breaks harmony, as it allows easily optimized rewards to dominate.
In this work, we propose a weight-free multi-reward RL method, Harmony. Rather than combining rewards into scalar, Harmony judges each sample by the region of reward space it dominates, and trains the policy to enlarge this dominance volume. The rewards are never made uniform, yet they move in harmony. Requiring no weights, Harmony is bounded by the weakest reward, dynamically emphasizing the rewards on which each sample ranks lowest among its peers in each iteration. Furthermore, we empower Harmony with a Lagrangian constraint without hand-set weights to meet real-world scenarios that have detailed reward requirements, such as OCR in image generation.
Experiments across various text-to-image tasks and RL algorithms demonstrate that Harmony outperforms strong baselines and can steer a reward toward a specified target when required. Experiments on language models further show its generalization ability.
What separates the methods is whether the lagging reward catches up. Each curve is a reward's test-set progress, (v − vbase) / (vbest − vbase): 0 is SD3.5-M before RL, 1 the best final level of any method in the setting, scored every 20 iterations.
Rewards resist uniformity: Spearman ρ between rewards over 4,000 prompts × 8 samples, for several prompt sets and models. Correlations vary widely across reward pairs.
For a prompt, the policy samples a group of G outputs, and K reward models score each output xi in their own units. Harmony turns the K scores into one advantage in three steps. Each step meets one requirement.
K rewards score a group of G samples (six real rollouts shown). Harmony ranks each reward within the group, multiplies the percentiles into a dominated volume (two of the K axes shown), and maps its rank to normal scores, which any group-based RL algorithm uses as advantages. An optional Lagrangian constraint raises the exponent of a reward with a target.
Rewards differ in magnitude, and their order within a group is more reliable than the raw scores. Each score becomes its in-group percentile, so the advantages stay the same under any strictly increasing transform of a reward. Like GRPO's normalization, the in-group comparison removes prompt difficulty without an external reference.
In rank space \([0,1]^K\), \(\prod_k u_{ik}\) is the volume that \(x_i\) dominates, and for independent rewards the chance that it beats a random group member on every reward. Since \(\partial S_i/\partial u_{ik}=1/u_{ik}\), a gain on a weaker reward counts more: \(0.5\times0.5=0.25\), but \(0.9\times0.1=0.09\).
The logarithm is steep near 0 and flat near 1, so raw \(S_i\) is skewed: 4.3% of text-rendering samples get advantages below −2 and none above +2. Harmony keeps the order of \(S_i\) (rank \(m_i\), ties averaged) and replaces its values with normal scores. Without ties, every group gets the same G values, within ±2.04 for G = 24.
The normal scores enter the usual group centring and batch std. Harmony takes K + 1 sorts of G numbers per group and needs no weights, hyper-parameters, or reference samples.
\(w_k\): weight; \(\sigma^g_k\), \(\rho^g\): in-group std and correlation; \(\mathcal{P}_g\): in-group Pareto front; \(u_{ik}\): in-group percentile; \(\mathcal{N}_g\): in-group rank to normal score. Unit-free: unchanged under any increasing transform of a reward. Weak-aware: a reward that ranks low counts more. Symmetric: the m-th best and m-th worst get advantages of equal size and opposite sign.
Six real rollouts of one prompt from training (text rendering, DiffusionNFT, iteration 100), drawn on two of the four rewards, PickScore and CLIPScore. Press play, or pick a step.
Each row is one sample of a group, each column a reward in its own units. Drag a point or type a score, and three rules recompute the advantages: the weighted sum, GDPO, and Harmony. Then give one reward new units. The same preference in new units moves the linear rules; Harmony's advantages stay exactly the same.
Drag a point to change its two scores. The shaded box is the region it dominates on these two rewards; Harmony uses the product over all K.
Some uses need one reward above a level, for example legible text. The weight that reaches a given OCR depends on the algorithm and on the other rewards, so it is hard to set by hand. Harmony-λ takes the target itself. A multiplier λ grows while the target is missed and shrinks once it is met.
The order stays ordinal: \(1+\lambda_k\) is the bargaining power of reward \(k\), and \(\lambda_k=0\) gives back Harmony. One projected dual step per iteration moves \(\lambda_k\) by the gap between the running mean \(\bar r_k\) and the target \(b_k\), in units of the in-group std. Because the values are still normal scores, the target changes the order of the samples, not the size of their advantages.
Training rollouts, every iteration: the multiplier λ (top) and the running mean of rollout OCR (bottom) with the target 0.92.
Tuning weights only moves a baseline along its own trade-off. With DiffusionNFT, tuning the weighted sum raises OCR from 0.903 to 0.937, while the other three training rewards fall from 0.86 to 0.77 of the best progress.
A target gives Harmony a better curve. With DiffusionNFT, Harmony-λ reaches OCR 0.916, above the weighted sum's 0.903, and keeps more of the other rewards (0.92 vs. 0.86). With Flow-GRPO-Fast, target 0.95 reaches 0.927, above CorrGRPO w/ norm. (0.923), at a much smaller cost (0.92 vs. 0.85).
All 12 target and cap settings tested raise OCR over Harmony.
Iterations 420–500. x: test OCR; y: mean progress of PickScore, HPSv3 and CLIPScore. Arrows go from equal to tuned weights. The green line joins Harmony and Harmony-λ with target 0.92 as the cap grows from 1 to 4; hollow circles: target 0.95.
SD3.5-M post-trained with LoRA by DiffusionNFT and Flow-GRPO-Fast, 500 iterations of 48 prompts × 24 images. Text rendering trains on OCR, PickScore, HPSv3 and CLIPScore; general prompts on PickScore, HPSv3 and CLIPScore. Five held-out rewards check that the gains carry over. Scores are means of the last five evaluations; each method is trained once (seed 42).
Averaged over the last five evaluations; lower is better. NFT: DiffusionNFT; FGF: Flow-GRPO-Fast.
Best in bold, second underlined, as in the paper. Training rewards first, then held-out: OCR-VL (a stricter text reader), ImageReward, Aesthetic V2.5, UnifiedReward and its alignment score. Rank: mean rank over all nine rewards at the last evaluation and over the last five.
Training samples whose mean in-group percentile is in [0.45, 0.55] (2,071 samples, 8 rollout batches), binned by their lowest percentile: mean advantage per bin.
Take samples that are equally good on average, and ask how much their advantage depends on their weakest reward. Across the weakest-percentile range, Harmony's advantage changes by 0.97 (−0.58 to +0.39), about twice GDPO's 0.47 and three times the weighted sum's 0.31. A sum of percentiles, with the same normal scores, changes by only 0.15.
Rank: mean rank over all nine rewards among the rows of the full ablation; four rewards shown. Raw \(S_i\) gives much larger negative than positive advantages (−2.59 vs. +1.35), and its KL to the reference rises from 0.095 to 0.257.
Replace PickScore by exp(PickScore) on text rendering with Flow-GRPO-Fast. The order of every pair of images is unchanged, so Harmony's advantages are the same bit for bit. The linear rules follow the new units toward PickScore and give up OCR, HPSv3 and CLIPScore.
Test-set means over iterations 420–500, raw units; the evaluation always reports the usual PickScore.
All images use the paper's protocol: one fixed initial noise per test prompt, 40 steps, 512 × 512, so every image of a prompt starts from the same noise. Each set is labelled: picked by eye, or random, a uniform draw from the test prompts that we did not filter for quality.
The models of the main table with DiffusionNFT, iteration 500. Text-rendering rows of the first set were chosen to show text that Harmony renders and the baselines misspell.
SD3.5-M at guidance 4.5 (left) against Harmony with DiffusionNFT (right). New renders of the released checkpoints, picked by eye.
Random draws: the first 12 prompts of a uniform draw per task, in draw order. Two general prompts were skipped: one with sexual content, one whose images show a real public figure. Drag across an image to compare; on a phone, tap or drag.
The model's estimate of the final image at each of the 40 steps, from the same noise: SD3.5-M at guidance 4.5, SD3.5-M at guidance 1, and Harmony (guidance 1, the setting it was trained in).
The policy is Safe RLHF's SFT model, a reproduction of Alpaca-7B, trained with GRPO in verl on PKU-SafeRLHF prompts. The two rewards are Safe RLHF's reward model for helpfulness and its cost model for harm, which often conflict. Since safety on a harmful request is a requirement, Harmony-λ also gets one target: at least 90% safe rollouts. All evaluations except the two training rewards use held-out models.
Iteration 100. Safe: share of responses rated safe by Safe RLHF's unified cost model (%). Sky.: Skywork-Reward-V2-Llama-3.1-8B. Guard.: Granite Guardian's probability of harm (%). These three on the 1,097 PKU-SafeRLHF test prompts. GPT-4o win (%): against the SFT model in both orders, on AlpacaEval (Help, 805 prompts) and PKU-SafeRLHF (Harm, 500 prompts). Len.: mean tokens; Trunc.: share reaching the 512-token limit (%).
The method is one numpy module with no training-framework dependency. The same class runs every baseline of the paper.
# install git clone https://github.com/GITHUB_USER/Harmony.git && cd Harmony pip install -e .
from harmony import MultiRewardAdvantage, PRESETS est = MultiRewardAdvantage(PRESETS["harmony"], rewards=["ocr", "pickscore", "hpsv3", "clipscore"]) # prompts: [N] group key of each sample # scores: {reward name: [N] scores in any units} adv, info = est(prompts, scores) # once per iteration, whole batch # Harmony-λ: mean OCR accuracy of the rollouts >= 0.92 est = MultiRewardAdvantage(PRESETS["harmony_lambda_ocr"], rewards=["ocr", "pickscore", "hpsv3", "clipscore"]) adv, info = est(prompts, scores) # info["lambda/ocr"]: the multiplier
Presets for the baselines: weighted_sum, gdpo, mo_grpo, corrgrpo, corrgrpo_norm, pareto. Training patches for DiffusionNFT and Flow-GRPO-Fast and a verl plugin for language models come with the code.
import torch from diffusers import StableDiffusion3Pipeline from huggingface_hub import snapshot_download from peft import PeftModel pipe = StableDiffusion3Pipeline.from_pretrained( "stabilityai/stable-diffusion-3.5-medium", torch_dtype=torch.float16) lora = snapshot_download("HF_USER/Harmony-SD3.5M", allow_patterns="ocr_diffusionnft/*") pipe.transformer = PeftModel.from_pretrained(pipe.transformer, f"{lora}/ocr_diffusionnft") pipe.to("cuda") image = pipe('A neon sign above a small diner that says "OPEN 24 HOURS"', num_inference_steps=40, guidance_scale=1.0, # trained without CFG height=512, width=512).images[0]
| Checkpoint | Prompts / task | Algorithm | Method |
|---|---|---|---|
Harmony-SD3.5M/ocr_diffusionnft | text rendering | DiffusionNFT | Harmony |
Harmony-SD3.5M/ocr_flowgrpofast | text rendering | Flow-GRPO-Fast | Harmony |
Harmony-SD3.5M/general_diffusionnft | general | DiffusionNFT | Harmony (advantage × 0.35) |
Harmony-SD3.5M/general_flowgrpofast | general | Flow-GRPO-Fast | Harmony |
Harmony-SD3.5M/ocr_diffusionnft_lambda | text rendering | DiffusionNFT | Harmony-λ, mean OCR ≥ 0.92 |
Harmony-SD3.5M/ocr_flowgrpofast_lambda | text rendering | Flow-GRPO-Fast | Harmony-λ, mean OCR ≥ 0.92 |
Harmony-Alpaca-7B-SafeRLHF | Safe RLHF | GRPO (verl) | Harmony |
Harmony-lambda-Alpaca-7B-SafeRLHF | Safe RLHF | GRPO (verl) | Harmony-λ, ≥ 90% safe rollouts |
SD3.5-M LoRA weights (rank 32) after 500 iterations (EMA), one per run of the main table; Alpaca-7B models after 100 iterations, seed 42. Links appear here when the checkpoints are public.